Note that there are some explanatory texts on larger screens.

plurals
  1. PORegistration php
    primarykey
    data
    text
    <p>I have created a registration form in which you can submit your details and they are saved in the database. I have a drop-down box for one of the fields called "Title" and this data is not submitted. I am hoping that I could get some feedback on this issue and maybe resolve the issue.</p> <pre><code> &lt;!DOCTTYPE html&gt; &lt;head&gt;&lt;link rel="stylesheet" type="text/css" href="style/style.css"&gt;&lt;/head&gt; &lt;title&gt;Registration&lt;/title&gt; &lt;body&gt; &lt;form name="form1" method="post" action="register_ac.php"&gt; &lt;li&gt;Title&lt;select name="title" id="title"&gt;&lt;option value="MR"&gt;MR&lt;/option&gt;&lt;option value="MRS"&gt;MRS&lt;/option&gt;&lt;/option&gt;&lt;option value="MISS"&gt;MISS&lt;/option&gt;&lt;/select&gt;&lt;/li&gt; &lt;li&gt;FirstName&lt;input type="text" name="firstname" class="#" id="firstname"/&gt;&lt;/li&gt; &lt;li&gt;Surname&lt;input type="text" name="surname" class="#" id="surname"/&gt;&lt;/li&gt; &lt;li&gt;Username&lt;input type="text" name="username" class="#" id="username"/&gt;&lt;/li&gt; &lt;li&gt;Password&lt;input type="password" name="password" class="#" iid="password"/&gt;&lt;/li&gt; &lt;li&gt;Email&lt;input type="text" name="email" class="#" id="email"/&gt;&lt;/li&gt; &lt;li&gt;Addressline1&lt;input type="text" name="addressline1" class="#" id="addressline1"/&gt;&lt;/li&gt; &lt;li&gt;Addressline2&lt;input type="text" name="addressline2" class="#" id="addressline2"/&gt;&lt;/li&gt; &lt;li&gt;City&lt;input type="text" name="city" class="#" id="city"/&gt;&lt;/li&gt; &lt;li&gt;County&lt;input type="text" name="county" class="#" id="county"/&gt;&lt;/li&gt; &lt;li&gt;Postcode&lt;input type="text" name="postcode" class="#" id="postcode"/&gt;&lt;/li&gt; &lt;input type="submit" id="textarea" name="submit" value="Submit" class="button"/&gt; &lt;/form&gt; &lt;/body&gt; &lt;/html&gt; &lt;?php $host="localhost"; // Host name $username="#####"; // Mysql username $password="#####"; // Mysql password $db_name="#####"; // Database name $tbl_name="Register"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Get values from form $username=$_POST['username']; $title=$_POST['title']; $firstname=$_POST['firstname']; $surname=$_POST['surname']; $password=$_POST['password']; $email=$_POST['email']; $addressline1=$_POST['addressline1']; $addressline2=$_POST['addressline2']; $city=$_POST['city']; $county=$_POST['county']; $postcode=$_POST['postcode']; // Insert data into mysql $sql="INSERT INTO $tbl_name(username, title, firstname, surname, password, email, addressline1, addressline2, city, county, postcode) VALUES('$username', '$title', '$firstname','$surname','$password','$email','$addressline1','$addressline2','$city','$county','$postcode')"; $result=mysql_query($sql); // if successfully insert data into database, displays message "Successful". if($result){ echo "Successful"; echo "&lt;BR&gt;"; echo "&lt;a href='index.php'&gt;Back to main page&lt;/a&gt;"; } else { echo "ERROR"; } ?&gt; &lt;?php // close connection mysql_close(); ?&gt; </code></pre>
    singulars
    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.
 

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