Dear visitors! This article will help understand how to read all values of Edit dialogue elements from the window of another application using Delphi and WinAPI functions. We will use WinAPI functions to get the Edit class dialogue elements. For instance, we need to get Edit values from the form with the title “MyProgram”, so we will use the WinAPI function FindWindow.
Read more
Dear visitors of the blog SoftMaker.kz. Today I would like to discuss how to insert a code of context advertisement in
the body of articles using the PHP language (ru).
- Some rules of placing advertisement in the body of articles
- Inserting an ad between paragraphs of the article
- A function for replacing a tag <!–advertisement–> in the body of the article
- Combining methods of ads insertion in the body of the articles for achieving the best results
Some rules of placing advertisement in the body of articles
- It is no good when there are too many ads in the body of the article and it complicates the reading.
- Also it is not convenient when the advertisement code goes right under the title of the article and it’s hard to understand where the title and the advertisement code are. After the article’s title an ad should be inserted at least between two first paragraphs.
- You don’t want to insert the ad in the center of the paragraph thus breaking it into two parts. It’s better to insert a context ad between the paragraphs.
- It would be good if ad blocks are separated by one thousand or more characters.
Inserting an ad between paragraphs of the article
In order to insert a block of context ad , it is necessary to determine places for advertisement block in the body of article using the rules described above. In harmony with these rules, this is a space between the paragraphs. How to get the needed values which will indicate such places between the paragraphs?
At the writing of:
<?php session_start(); ?>
An error message appeared:
Warning: session_start() [function.session-start]:
Cannot send session cache limiter – headers already sent (output started at X:/home/localhost/www/phpbloguser/header.html:6) in X:/home/localhost/www/phpbloguser/blocks/global.inc.phpon line 110
In php.ini it is necessary to write directive output_buffering “On” (on default – Off), see php.ini. And it will be all right! To make it works it is necessary to restart your server.
This error may appear for other reasons as well:
It is necessary to check if there is a space, tab, hyphen before “<?”.
In addition, it is necessary to start a session before any text appear in the browser’s window. Because in this case session identifier is written down in cookie files. Cookies in their turn are always installed through headers sending. The error message says that headers have ALREADY been sent.
Therefore it is necessary to check if any text appears in the browser’s window before you start a session by means of session_start()?
Your php file must be saved in UTF 8 coding (without BOM). If it is with BOM, three symbols will be typed at the beginning of the file and this results in this error.
Content
- How to create automatic counter of record number in MySQL table using PHP?
- How to delete all files in a folder?
- Is it possible in PHP to replace blocks if…else with another conditional operation?
- How to delete strings from a text file using the PHP language?
How to create automatic counter of record number in MySQL table using PHP?
For this, we’ll use the following function:
<?php // The function is designed for obtainment of record number of the table function get_id($tbl_dt) { // Do descending sorting $result = mysql_query("SELECT id FROM ".$tbl_dt." ORDER BY `id` DESC"); $myrow = mysql_fetch_array($result); $num_rows = mysql_num_rows($result); // if a number of records coincide with the last id, then... if ($num_rows==$myrow['id']) { // ...take the first element //in the sampling with the highest id value , // by increasing this value by a unity return $myrow['id'] + 1; } else { // Do ascending sorting, then... $res1=mysql_query("SELECT id FROM ".$tbl_dt." ORDER BY `id` ASC"); $myrow1 = mysql_fetch_array($res1); $i = 1; do // ...look for "empty" id and add a record for this id { if ($i == $myrow1['id']) { $i++; continue; } else { return $i; } } while ($myrow1 = mysql_fetch_array($res1)); } } ?>
Content
- Using what query in MySQL it is possible to display several maximum values?
- What does the error ‘Too many connections’ mean?
- How to provide access to MySQL Denwer from the local network?
- How to delete records from a table if their date is 10 days earlier than the current one?
- How to use queries with UPDATE MySQL command?
- How to output the data from the primary and subordinated table into one by means of UNION MySQL query?
Using what query in MySQL it is possible to display several maximum values?
Example of query:
SELECT field1 FROM Table ORDER BY field1 DESC LIMIT 5
or if there is one value
SELECT MAX(field) FROM Table
What does the error ‘Too many connections’ mean?
Setting up XAMPP on Mac OS X01.02.2016 - 16:31
The article deals with setting up XAMPP, which must be done so that the local web-server Apache work properly. After reading the article you will be able to set up virtual hosts and quickly correct any error that prevents proper operations of the mod_rewrite mode in the file .htacces.
Test: Find out your level of knowledge in PHP basics30.01.2016 - 15:23
This test was made to help memorize material on the basics of PHP programming language. It helps to better understand what PHP was created for and how it differs from other programming languages.
Recent Comments