Do not use Ob_start () when turning, add to header file
Write a global variable
Session_Start ();//cannot submit data after adding: Extract ($_post); extract ($_get); extract ($_session);
Session_register (' pt_usr_nm ');//write Browser global variable
Connect to MySQL Database
function Dbconnect ()
{
Global $site _domain, $db _host, $db _name, $db _user, $db _pass;
if ($link = mysql_connect ($db _host, $db _user, $db _pass))
{
$res =mysql_select_db ($db _name) or Die (Mysql_error ());
if ($res)
return $link;
}
else print "Cannot connect to database";
}
Disconnecting the MySQL database
function Dbclose ($link)
{
Global $link;
if (Mysql_close ($link))
{}
}
$quer 8 = "Select Url,image from Cpc_ad where id= ' $cid '";//Database call
$sult 8 = mysql_query ($quer 8);//Send a query string.
$bank 8 = mysql_fetch_array ($sult 8);//returns array data.
$no =mysql_num_rows ($sult 8);//Gets the number of returned columns. Can be used to check for any data that meets the criteria
Count the number of eligible
$qrym = "SELECT count (*) from A_CIP where to_days (date) =to_days (now ())-1";
if ($mres =mysql_query ($qrym))
{
$mres =mysql_fetch_array ($mres);
$membercount 11= $mres [0];
}
$qrym = "SELECT count (*) from A_CIP where ipuse=" and time_to_sec (date) >time_to_sec (now ()) -1800 and to_days (date) =to_ Days (now ()) ";
if ($mres =mysql_query ($qrym))
{
$mres =mysql_fetch_array ($mres);
$membercount 1= $mres [0];
}
Inserting new database data
$query = "INSERT into ptr_ptoc_clicks SET mem_id = ' $pt _usr_nm ', banner_id = $bank 5[banner_id], click_date = Now (), ip= ' $ip '";
mysql_query ($query);
modifying database data
$query = "UPDATE ptr_member_clicks SET self_banner_click =self_banner_click+ $clamt WHERE mem_id = ' $pt _usr_nm '";
mysql_query ($query);
$a =$_server[' http_referer '];//get an unsolicited website
if ($a = = "") {echo "link or code must be placed on the website to get Points";} else{
$b =parse_url ($a);//Obtain the data of the antecedents URL
$b [host];//access to the URL domain name
3 seconds Auto Refresh
Print ";
Transfer to other pages
Header ("Location: $url")
Remember variables
$a =number_format ($money *0.00001,6)//Format data, retain 6 decimal places
Cycling Banner
if ($output 5== "") {
Session_register (' output5 ');
$output 1=file ("Qizi.txt");
}
$show 5=rand (0,count ($output 1)-1);
Session_register (' show5 ');
Print << $output 1[$show 5]
HTM;
Text link
if ($textad = = "") {
Session_register (' output ');
$textad =file ("Text.txt");}
for ($i =0; $i
";
?>
//to time
Weak window control
//Load page stress Live
window.open (//Reference Window object, open method
' Blogchina. COM ',//The URL of the window that will pop up
' Detail ',//Window name
' Toolbar=yes,//whether to display the browser's toolbar (forward back and so on button), yes= display, no= does not show
Location=yes, Whether to display the address bar, yes= display, no= does not display
Status=yes,//Whether the status bar is displayed, yes= display, no= does not display
Menubar=yes,//Whether the menu bar is displayed, yes= display, no= does not display
Scroll Bars=yes,//Whether the scroll bar is displayed, yes= display, no= does not display
Resizable=yes,//whether to allow drag-and-drop resizing, yes= display, no= do not display
width=100,//pop-up window width, in pixels, px
height=100 '///pop-up window height, unit is pixel, px
) "
Above introduces the QQ space background music player code PHP common code, including the QQ space background music player code content, I hope the PHP tutorial interested friends have some help Help.