Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy isn't this submitting to mysql?
    text
    copied!<pre><code> &lt;?php $host="localhost"; // Host name $username="root"; // Mysql username $password=""; // Mysql password $db_name="ureviewdu"; // Database name $tbl_name="Student"; // Table name // Connect to server and select databse. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); /* Obliterate bad input */ $secUser = mysql_real_escape_string($_POST['reguser']); $badpasses = $_POST['regpass']; $salt = '~Z`!@#$%I^&amp;*()_-+Q=}]{[\|"&gt;&lt;'; $secPass = md5($badpasses.$salt); $sql = "INSERT INTO Student (uname, pass, fname, lname, email, currGrade) VALUES('$secUser','$secPass','$_POST[regfirst]','$_POST[reglast]','$_POST[regemail]','$_POST[regclassrank]')"; $result = mysql_query($sql); if ($result) { echo "Thanks for signing up!"; } else { echo "Failed."; } ?&gt; </code></pre> <p><strong>HTML</strong></p> <pre><code>&lt;form action="inc/register/register.php" method="post" id="userRegistration"&gt; &lt;div class="cen"&gt;&lt;h5&gt;User Credentials&lt;/h5&gt;&lt;/div&gt; &lt;div class="field required"&gt; Username: &lt;input type="text" name="reguser" tabindex="1" /&gt;&lt;br /&gt; &lt;/div&gt; &lt;div class="field required"&gt; Password: &lt;input type="password" name="regpass" tabindex="2" /&gt;&lt;br /&gt; &lt;/div&gt; &lt;div class="cen"&gt;&lt;h5&gt;User Details&lt;/h5&gt;&lt;/div&gt; &lt;div class="field required"&gt; First Name:&lt;input type="text" name="regfirst" tabindex="3" /&gt;&lt;br /&gt; &lt;/div&gt; &lt;div class="field required"&gt; Last Name:&lt;input type="text" name="reglast" tabindex="4" /&gt;&lt;br /&gt; &lt;/div&gt; &lt;div class="field required"&gt; Email:&lt;input type="text" name="regemail" tabindex="5" /&gt;&lt;br /&gt; &lt;/div&gt; &lt;div class="field required"&gt; Current Class:&lt;select name="regclassrank" tabindex="6"&gt; &lt;option disabled="disabled"&gt;Select Class&lt;/option&gt; &lt;option value="1"&gt;Freshman&lt;/option&gt; &lt;option value="2"&gt;Sophomore&lt;/option&gt; &lt;option value="3"&gt;Pre-Junior&lt;/option&gt; &lt;option value="4"&gt;Junior&lt;/option&gt; &lt;option value="5"&gt;Senior&lt;/option&gt; &lt;option&gt;&lt;/option&gt; &lt;/select&gt; &lt;/div&gt; &lt;br /&gt; &lt;div class="cen"&gt;&lt;input type="submit" name="submitUser" /&gt;&lt;/div&gt; &lt;/form&gt; </code></pre> <p>Does anyone see anything wrong with this? It submits fine, but then nothing is INSERTED into the database....</p>
 

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