The system prompts the undefined variable about the code of the course to be deselected.

Source: Internet
Author: User
The system prompts the undefined variable about the code of the course to be deselected. After the course is rejected and submitted, the system prompts an error. lines 15th, 35, and 38 have undefined variable "xuehao". how can I modify it?
 Unselect subject
 
 The selected topic is rejected!"; Echo"
 "; Exit;} else {echo"

An error occurred while unselecting. please return and reselect

"; Echo" "; Exit ;}}?>


Reply to discussion (solution)

See what the form on your previous page has

See what the form on your previous page has

 Unselect subject
  
 Complete the information.

"; Echo" "; Exit;} else $ query =" select * from $ student_table where xuehao = '$ xuehao' "; mysql_query (" set names 'gb2312 '"); $ result = mysql_query ($ query); $ row = mysql_fetch_array ($ result); if ($ row = 0) {echo"

Your input is incorrect. please enter it again.

"; Echo" "; Exit ;}$ query =" select id as sm from $ student_table where xuehao = '$ xuehao' "; mysql_query (" set names 'gb2312 '"); $ result = mysql_query ($ query); $ row = mysql_fetch_array ($ result); if ($ row ['SM '] = 0) {echo"

You have not selected a subject!

"; Echo" "; Exit;} $ query =" select * from $ jiaoshi_table where id = '$ ID' "; mysql_query (" set names 'gb2312 '"); $ result = mysql_query ($ query); $ row = mysql_fetch_array ($ result); if ($ row = 0) {echo"

The topic number does not exist. please enter it again!

"; Echo" "; Exit ;}?> ";} Else {echo" ";} Echo" "; $ N ++ ;}?>

Student ID

Student Name

Topic Name

Instructor

Title

Unselect

". $ Row ['xuehao']."

". $ Row ['name']."

". $ Row ['subobject']."

". $ Row ['teacher']."

". $ Row ['zhicheng']."

Unselect

Unselect
Brother, isn't this a GET commit? Use POST to accept the request ??? Something goes wrong.

Unselect
Brother, isn't this a GET commit? Use POST to accept the request ??? I am ashamed of having a problem. it means I changed POST to GET?

If it is changed, other variables in back_keti2.php will not be obtained.
I have read it. in back_keti2.php, there is nothing except the variable $ xuehao.
Try again. I think it can be used.

If it is changed, other variables in back_keti2.php will not be obtained.
I have read it. in back_keti2.php, there is nothing except the variable $ xuehao.
Try it again. I think I should have tried it. it seems wrong and nothing is displayed.

How did you change the code.

In back_keti2.php, var_dump $ _ GET first ..
PS: I'm curious. on the course withdrawal page, only one student id variable is passed. how does back_keti2.php know which course to return?

How did you change the code. I don't understand the syntax. I just changed POST to GET. What should be the correct statement?

Echo" ";
This sentence indicates automatic jump.
I guess you have succeeded. But you cannot see the success. As soon as the call succeeds, it will jump to back_keti.php.

Echo" ";
This sentence indicates automatic jump.
I guess you have succeeded. But you cannot see the success. After the operation is successful, the system immediately jumps to back_keti.php. If no, it stays on that page. in the address bar, is back_keti2.php? Xuehao = Student id I entered
I just changed extract ($ _ POST); to extract ($ _ GET); right?

So the change is correct. do you still report an error?

Var_dump ($ _ GET );
?>
Accept this in the header of the interface to see if there are any results.

So the change is correct. do you still report an error? no, but the page is blank and nothing is displayed. Check again and find that the course is still available.


So the change is correct. do you still report an error? no, but the page is blank and nothing is displayed. Check again and find that the course is still available. The result is as follows:

Array (size = 1) 'xuehao' => string 'student id I entered '(length = 9)

There should be no error in getting the value.
The problem lies in several SQL statements on the second page.
The bottom if statement is not found.
The SQL statements in the middle are unclear about the variables.

Who can help me solve the problem ~~

Wait for two days and continue.

Extract ($ _ REQUEST );
The content of $ _ POST and $ _ GET is included in $ _ REQUEST, which has no special requirements and does not need to be detailed.

You just unselect
Only the student ID is passed and no course is passed.

I didn't see how you implemented the "unselect" code.

Extract ($ _ REQUEST );
The content of $ _ POST and $ _ GET is included in $ _ REQUEST, which has no special requirements and does not need to be detailed.

You just unselect
Only the student ID is passed and no course is passed.

I didn't see how you implemented the "Undefined variable" code. the code I returned was the several update statements, which seemed to be the problem on Lines 15, 35, and 38, and always prompted me "Undefined variable: does xuehao have a problem with my writing format?

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.