: 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.