search
HomeBackend DevelopmentPHP TutorialCommon PHP codes_PHP tutorial
Common PHP codes_PHP tutorialJul 21, 2016 pm 04:00 PM
phpsessionstartcannotcodeoverall situationaddvariableCommonly usedsubmitdatadocument



Use ob_start(); when redirection is not possible; add it to the header file
// Write global variables
session_start(); // If data cannot be submitted, add: extract($_POST );extract($_GET);extract($_SESSION);

session_register('pt_usr_nm');//Write to browser global variables

//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 "Unable to connect to database";
}
//Disconnect the MySQL database
function dbclose($link)
{
global $link;
if(mysql_close($link))
{}
}
$quer8 = "select url,image from cpc_ad where id='$cid'";//Database call
$sult8 = mysql_query($quer8);//Send a query string.
$bank8 = mysql_fetch_array($sult8);//Return array data.
$no=mysql_num_rows($sult8);//Get the number of returned columns.Can be used to check whether there is data that meets the conditions

//Count the number of qualified data
$qrym="select count(*) from a_cip where TO_DAYS(date)=TO_DAYS(NOW())-1 ";
if($mres=mysql_query($qrym))
{
$mres=mysql_fetch_array($mres);
$membercount11=$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);
$membercount1=$mres[0];
}

// Insert new database data
$query = "INSERT INTO ptr_ptoc_clicks SET mem_id = '$pt_usr_nm', banner_id = $bank5[banner_id], click_date = now(),ip='$ip'";
mysql_query($ query);
//Modify 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 the source URL
if ($a=="") { echo " The link or code must be placed on the website You can get points";} else{
$b=parse_url($a);//Get the source URL data
$b[host];//Get the source URL domain name
//Automatically refresh in 3 seconds
print"";
/ /Transfer to other web pages
header("Location:$url")
// Remember variables
$a=number_format($money*0.00001,6)//Format data, keep 6 decimal places
//Loop flag
if ($output5==""){
session_register(' output5');
$output1=file("qizi.txt");
}
$show5=rand(0,count($output1)-1);
session_register('show5' );
print

$output1[$show5]

HTM;
//Text link
if ($textad==""){
session_register('output');
$textad=file("text.txt");}
for($i=0;$i
";

?>

//Time to mark

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
4 weeks agoBy尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),

ZendStudio 13.5.1 Mac

ZendStudio 13.5.1 Mac

Powerful PHP integrated development environment