A PHP page about registration

Source: Internet
Author: User
 
  
 <title>Student Registration</title>
 
 Please write the information complete

"; Echo" "; exit;} $query = "SELECT * from $student _infor where no= ' $xuehao ' and name= ' $name '"; mysql_query ("Set names ' GB2312 '"); $result = mysql_query ($query); $row =mysql_fetch_array ($result); if ($row ==0) {echo "

You entered the wrong information, not a computer college graduate!

"; echo " "; Exit;} $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 "

This school number has been registered, please re-fill!

"; echo " "; Exit;} if ($password! = $password 1) {echo "

The password entered is inconsistent, please re-enter!

"; echo " "; Exit } $query = "INSERT INTO $student _table values (' $xuehao ', ' $name ', ' $sex ', ' $class ', ' $password ', ' $love ', ' $telephone ', ' $ Reward ', ') "; mysql_query ("Set names ' GB2312 '"); $result =mysql_query ($query); if ($result ==true) {echo]

Registration Successful!

"; echo " "; Exit }?>


Reply to discussion (solution)


This is the display result, show 2 seconds and then jump back to the registration page, where the error?

$xuehao ... Where are these variables coming from?

$xuehao ... Where are these variables coming from? This is another PHP page for me

 
  Student Registration Page
 
  

That's $_post[' Xuehao '.

That's $_post[' Xuehao ', what do you mean?

Error tip: $xuehao undefined!!!

register.php
Extract ($_post); Add this sentence.
if ($xuehao = = "" | | $name = = "" | | $class = = "" | | $password = = "" | | $password 1== "" | | $telephone = = "")

Is it possible to understand this?
$heihao defined variables:
$_get[' Xuehao ' is passed from another page.

I'm a rookie too, just touching

register.php
Extract ($_post); Add this sentence.
if ($xuehao = = "" | | $name = = "" | | $class = = "" | | $password = = "" | | $password 1== "" | | $telephone = = "") Thanks, problem solved!

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