<? Php // do not leave blank lines $ 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-digit digital image Header ("Content-type: image/png"); // tell the browser that the following data is an image instead of text
// Define the image width and height $ Nwidth = 120; $ Nheight = 25; $ Im = @ imagecreate ($ nwidth, $ nheight) or die ("Can't initialize new GD image stream"); // create an image // Set the image color $ Background_color = imagecolorallocate ($ im, 255,255,255); // match the color $ Text_color = imagecolorallocate ($ im, 23, 14, 91 ); // Draw the image border Imagefilledrectangle ($ im, $ nwidth-1, $ nheight-1, $ background); // rectangular area coloring Imagerectangle ($ im, $ nwidth-1, $ nheight-1, $ background_color); // draw a rectangle // Srand (double) microtime () * 1000000); // obtain the value of one second in the current time to one second in the execution time. // $ Randval = rand (); $ Randval = $ p; // 5-digit Imagestring ($ im, 8, 10, 2, $ randval, $ text_color); // draw a horizontal string // Add 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); // Create a png image Imagedestroy ($ im); // End Chart type
} Else { Echo "<font size = 2> The Merchant did not enter the phone number </font> "; } ?> |