PHP Verification Code @ symbol

Source: Internet
Author: User
Help PHP Verification Code @ symbol
PHP Code
  
   
  
   



PHP Code
  
   
  
   


[email protected]?? Tips for errors
Notice:use of undefined constant code-assumed ' code ' in F:\wamp\apps\project\code_sub.php on line 3

Notice:use of undefined constant code-assumed ' code ' in F:\wamp\apps\project\code_sub.php on line 4

Notice:use of undefined constant check_pic-assumed ' check_pic ' in F:\wamp\apps\project\code_sub.php on line 4

[email protected] What's wrong with this?


------Solution--------------------
Quoted $_session["Check_pic"]

Undefined constant is the meaning of undefined constants, not quoted strings are treated as constants
------Solution--------------------
PHP Code
for ($i =0; $i <4; $i + +) {$rand = '; $rand. =dechex (rand (1,15));    [Email protected], the picture will not show. } $_session[' Check_pic ']= $rand; [Email protected] and it's all garbled.
------Solution--------------------
$rand. =

This variable is used without assignment, so the notice error is caused, the image is binary, the notice is text, and the mixture naturally causes the picture to fail to display.

Workaround:
Assign a value to $rand first

$rand = ";


------Solution--------------------
PHP Code
    Session_Start ();    $rand = ";    for ($i =0; $i <4; $i + +) {        $rand. =dechex (rand (1,15)); [ Email protected], the picture will not show.    }        $_session[' check_pic ']= $rand; [Email protected] and it's all garbled.     $im =imagecreatetruecolor (100,30);         $BG =imagecolorallocate ($im, 0,0,0);    $te =imagecolorallocate ($im, 255,255,255);    Imagestring ($im, 5,0,0, $rand, $te);      Header ("Content-type:image/jpeg");  Imagejpeg ($im);
------Solution--------------------
Explore
PHP Code

Session_Start ();

for ($i =0; $i <4; $i + +) {
@ $rand. =dechex (rand (1,15)); [Email protected], the picture will not show.
}
@$_session[check_pic]= $rand; [Email protected] and it's all garbled. ......
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.