PHP Registration code

后端 未结 4 953
小蘑菇
小蘑菇 2021-01-16 23:27

I am currently attempting to create a registration script to enter registration information into my UserAccount table. Below is my connection:



        
4条回答
  •  心在旅途
    2021-01-16 23:55

    Try the following by changing the single and double quotes around:

    $insert = "INSERT INTO UserAccount(email_address, password, f_name, s_name) 
    VALUES('".$email_address."','".$password."','".$f_name."','".$l_name."')";
    

    This is good practice! The page will be blank but at least you should get entry in the table.

    Also check if the database name $db should be the same as the $usr? Is this correct?

    $db = $usr;
    

    Shouldn't this be something like

    $db = "databaseName";
    

    Final thought:

    There is a keyword variable transfer; that looks funny. Because of the setup of php error reporting/handling it might cause an error but not show/report it thus the blank page. Use echo at specific places in the code to see where it stops.

    Should it be $transfer; and should it receive a variable?

    The other thought is that if you have $_SESSION['conn'] there should be a session_start(); just after the opening tag. This might all cause the conn.php to fail thus breaking the INSERT.

提交回复
热议问题