Here's the code:
Copy the Code code as follows:
$id =$_get[id];
Include ("admin/config.php");
$sql = "SELECT * from user where id= $id";
$data =mysql_fetch_array (mysql_query ($sql));
$p =sbc_dbc ($data [phone],1);
function Get_str ($str, $strlen =16) {
$str =stripslashes ($STR);
for ($i =0; $i < $strlen; $i + +)
if (Ord (substr ($str, $i, 1)) >0xa0) $j + +;
if ($j%2!=0) $strlen + +;
$tmp _str=substr ($str, 0, $strlen);
return $tmp _str;
}
if ($p <> ") {
Generate a 5-bit digital picture
Header ("Content-type:image/png"); Tell the browser that the following data is a picture, not a text display
Define Picture Width height
$nwidth = 120;
$nheight = 25;
$im = @imagecreate ($nwidth, $nheight) or Die ("Can ' t initialize new GD image stream"); Creating images
Picture color settings
$background _color=imagecolorallocate ($im, 255,255,255); Match color
$text _color=imagecolorallocate ($im, 23,14,91);
Draw a picture border
Imagefilledrectangle ($im, 0,0, $nwidth-1, $nheight-1, $background); Rectangle Area Coloring
Imagerectangle ($im, 0,0, $nwidth-1, $nheight-1, $background _color); Draw a rectangle
Srand (Double) microtime () *1000000); Gets the current time of one out of 10,000 seconds value to execute when the random number of one out of 10,000 seconds seeds
$randval =rand ();
$randval = $p; 5-digit number
Imagestring ($im, 8,10,2, $randval, $text _color); Draw a cross-string
Adding interference factors
for ($i =0; $i <478; $i + +)
//{
$randcolor =imagecolorallocate ($im, Rand (0,255), Rand (0,255), Rand (0,255));
Imagesetpixel ($im, Rand ()%100,rand ()%30, $randcolor); Point
//}
Imagestring ($im, 3,5,5, "A simple Text String", $text _color);
Imageinterlace ($im, 1);
Imagepng ($im); Creating PNG patterns
Imagedestroy ($im); End chart Type
}else{
echo "The merchant did not enter a phone number";
}
?>
The above describes the phone number of the attribution of the query and the name of PHP to read the database phone number and generate images, including the phone number attribution to the query and the name of the content, I hope that the PHP tutorial interested friends have helped.