Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>you should also check whether POST was really sent:</p> <pre><code>if (!empty($_POST)) { // ... your code here } </code></pre> <p>next thing: you don't need closing tag ?> if your *.php file consist only PHP code - end of file is also correct end of PHP block of code - it's "good-to-have" habit, because in some cases it helps you to avoid error: "Cannot add/modify header information - headers already sent by..."</p> <p>next problem - wrong way of inserting variables into string:</p> <pre><code>$sql = 'INSERT INTO Members (ID, FName, LName, Phone, EmailAddress, Month, Day, Year, Username, Password) VALUES' . '(\'\', \'$FName\', \'$LName\', \'$Phone\', \'$EmailAddress\', \'$Month\', \'$Day\', \'$Year\', \'$Username\', \'$Password\')'; </code></pre> <p>correct way:</p> <pre><code>$sql = "INSERT INTO Members (ID, FName, LName, Phone, EmailAddress, Month, Day, Year, Username, Password) VALUES (null, '$FName', '$LName', '$Phone', '$EmailAddress', '$Month', '$Day', '$Year', '$Username', '$Password')"; </code></pre> <p>more <a href="http://www.php.net/manual/en/language.types.string.php" rel="nofollow noreferrer">info here</a></p> <p>next - as Deniss said, instead of:</p> <pre><code>$FName = $_POST["FName"]; </code></pre> <p>should be:</p> <pre><code>$FName = mysql_real_escape_string($_POST["FName"]); </code></pre> <p>actually you should fist check weather <a href="http://php.net/manual/en/security.magicquotes.php" rel="nofollow noreferrer">magic quotes gpc</a> are on or off:</p> <pre><code>if (get_magic_quotes_gpc()) { if (!empty($_POST)) { array_walk_recursive($_POST, 'stripslashes_value'); } } function stripslashes_value(&amp;$value) { $value = stripslashes($value); } </code></pre> <p>without this you could have problem with double \\ inserted into db (it depends on your server configuration)</p> <p>and last but not least: as Robert said you miss one more important thing:</p> <pre><code>mysql_query($sql); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload