Upload image error, this code I used before the error

Source: Internet
Author: User
 
  
 <title>War-game-add Your Score</title>

War Game-add your Score

0) {echo ' ERROR: '. $_files[' image_upload ' [' Error ']. '
';} else{$dbc =mysqli_connect (' localhost ', ' root ', ' pengyu2408 ', ' score_list ') or Die (' Error in connet '); $query = "INSERT Into Score_lis (first_name,last_name,score) VALUES (' $first _name ', ' $last _name ', ' $score '); Mysqli_query ($DBC, $query ) or Die (' error_2 '); $gpy =move_uploaded_file ($_files[' image_upload ' [' tmp_name '], $photo _dir.$_files[' Image_ Upload ' [' name ']); Echo '

Thanks for adding your new high score!

'; Echo '

first_name:'. $first _name. '
'; Echo 'last_name:'. $last _name. '

'; Echo '

score:'. $score. '

'; Echo '; Echo '

<<back to Hight Score

';//clear the score data to clear the Form$firet_name= ""; $last _name= ""; Mysqli_close ($DBC);}}? >


The error message here shows the undefined variable, what is the situation?


Reply to discussion (solution)

You go see addscore.php 39 line Look, you this code is not addscore.php in it

The server does not support uploading
Uploaded files are beyond the limits of post_max_size

You go see addscore.php 39 line Look, you this code is not addscore.php in it
This code is addscore.

You go see addscore.php 39 line Look, you this code is not addscore.php in it
What does the undefined index mean? Image_upload This is the name of the upload image, why is not defined

Entype wrote it wrong.

It should be enctype.

Got it, thank you very much, why is it obvious that the enctype is wrong, the error will be other variables undefined?

Got it, thank you very much, why is it obvious that the enctype is wrong, the error will be other variables undefined?
Receive when $_files is an array, which has $_files[' image_upload '] This array member, write the wrong not pass over, $_files array is empty, your code behind directly use $_files[' Image_upload '], The hint is not defined chant, besides this hint is a notice

Oh


Got it, thank you very much, why is it obvious that the enctype is wrong, the error will be other variables undefined?
Receive when $_files is an array, which has $_files[' image_upload '] This array member, write the wrong not pass over, $_files array is empty, your code behind directly use $_files[' Image_upload '], The hint is not defined chant, besides this hint is a notice
Thank you so much? I am learning PHP First, what good information, or learning methods introduced, I am not a computer science, learning this is always a way to find the feeling of direction

Oh



Got it, thank you very much, why is it obvious that the enctype is wrong, the error will be other variables undefined?
Receive when $_files is an array, which has $_files[' image_upload '] This array member, write the wrong not pass over, $_files array is empty, your code behind directly use $_files[' Image_upload '], The hint is not defined chant, besides this hint is a notice
Thank you so much? I am learning PHP First, what good information, or learning methods introduced, I am not a computer science, learning this is always a way to find the feeling of direction
A lot of online information, I was to see the free course, what Preach Intelligence podcast, Brother Lian, the basic video have it, more trained, like this write wrong mother's mistake just start will have, I remember a training teacher said, encountered error first don't worry, you first step by step debugging, Really do not check the information on the Internet, and then really can not go to consult others, slowly

o=


Oh



Got it, thank you very much, why is it obvious that the enctype is wrong, the error will be other variables undefined?
Receive when $_files is an array, which has $_files[' image_upload '] This array member, write the wrong not pass over, $_files array is empty, your code behind directly use $_files[' Image_upload '], The hint is not defined chant, besides this hint is a notice
Thank you so much? I am learning PHP First, what good information, or learning methods introduced, I am not a computer science, learning this is always a way to find the feeling of direction
A lot of online information, I was to see the free course, what Preach Intelligence podcast, Brother Lian, the basic video have it, more trained, like this write wrong mother's mistake just start will have, I remember a training teacher said, encountered error first don't worry, you first step by step debugging, Really do not check the information on the Internet, and then really can not go to consult others, slowly
Ask another question, have you already worked, or are you a student at school?

o=



Oh



Got it, thank you very much, why is it obvious that the enctype is wrong, the error will be other variables undefined?
Receive when $_files is an array, which has $_files[' image_upload '] This array member, write the wrong not pass over, $_files array is empty, your code behind directly use $_files[' Image_upload '], The hint is not defined chant, besides this hint is a notice
Thank you so much? I am learning PHP First, what good information, or learning methods introduced, I am not a computer science, learning this is always a way to find the feeling of direction
A lot of online information, I was to see the free course, what Preach Intelligence podcast, Brother Lian, the basic video have it, more trained, like this write wrong mother's mistake just start will have, I remember a training teacher said, encountered error first don't worry, you first step by step debugging, Really do not check the information on the Internet, and then really can not go to consult others, slowly
Ask another question, have you already worked, or are you a student at school?
I've been working for three years.

  • Related Article

    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.