PHP plot function to generate image verification code

Source: Internet
Author: User
: This article describes how to generate an image verification code by using the PHP plot function. if you are interested in the PHP Tutorial, refer to it. PHP plot function to generate image verification code


  

Use the script to generate the verification code on the page.


  
  
   
   Guitar Wars-Add Your High Score
   
   

Guitar Wars-Add Your High Score

0) & ($ screenshot_size <= GW_MAXFILESIZE) {if ($ _ FILES ['screenshot '] ['error'] = 0) {// Move the file to the target upload folder $ target = GW_UPLOADPATH. $ screenshot; if (move_uploaded_file ($ _ FILES ['screenshot '] ['tmp _ name'], $ target )) {// Write the data to the database $ query = "insert into guitarwars (date, name, score, screenshot) VALUES (NOW (), '$ name ', '$ score', '$ screenshot') "; mysqli_query ($ dbc, $ query); // Confirm success with the userecho'

Thanks for adding your new high score! It will be reviewed and added to the high score list as soon as possible.

'; Echo'

Name:'. $ Name .'
'; Echo'Score:'. $ Score .'
'; Echo'. GW_UPLOADPATH. $ screenshot. '"alt =" PHP plot function generation image verification code "/>

'; Echo'

<Back to high scores

'; // Clear the score data to clear the form $ name = ""; $ score = ""; $ screenshot = ""; mysqli_close ($ dbc );} else {echo'

Sorry, there was a problem uploading your screen shot image.

';}} Else {echo'

The screen shot must be a GIF, JPEG, or PNG image file no greater than '. (GW_MAXFILESIZE/1024). 'kb in size.

';} // Try to delete the temporary screen shot image file @ unlink ($ _ FILES ['screenshot'] ['tmp _ name']);} else {echo'

Please enter all of the information to add your high score.

';}} Else {echo'

Please enter the verification pass-phrase exactly as shown.

';}}?> "/> Name: "/>
Score: "/>
Screen shot:
Verification:

'). AddClass ('pre-numbering '). hide (); $ (this ). addClass ('Has-numbering '). parent (). append ($ numbering); for (I = 1; I <= lines; I ++) {$ numbering. append ($ ('
  • '). Text (I) ;}; $ numbering. fadeIn (1700) ;}) ;}; script

    The above describes how to generate an image verification code by using the PHP plot function, including some content. I hope to help anyone who is interested in the PHP Tutorial.

    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.