Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

Drop down boxe selections to php my admin

Links for php scripts

Moderators: macek, egami, gesf

Drop down boxe selections to php my admin

Postby melcox80 » Tue Jan 10, 2012 7:11 pm

Hi All, I am new herer this is my first post. I have only in the last couple of weeks started using/learning php. I have created an online registration form for our club. In that form I have dropdown boxes. All the other information gets to myphpadmin table correctly. However there is no entry in the table where the dropdown boxes were. I'm not sure if I have the tag wrong or if I have to change the option in the table.

Can anyone help? What have I done wrong? It's urgent as people are registering and I don't know what their class or age is!

Form

<form method="post" action="event_rego.php">
<h3>Event</h3>
<div class="formbox"><select name="age" type="text" width="400" >
<option>Choose One</option>
<option>Sundown superx race 1 (21st Jan)</option>
<option>Sundown superx race 2 (18th Feb)</option>
<option>Sundown superx race 3 (24th March)</option>
<option>Sundown superx race 4 (28th April)</option>
</select></div>
<H3>Firstname</h3>
<div class="formbox"><input name="fname" type="text" width="400" /></div>
<h3>Surname</h3>
<div class="formbox"><input name="sname" type="text" width="400" /></div>
<h3>Email</h3>
<div class="formbox"><input name="email" type="text" width="400" /></div>
<h3>Phone</h3>
<div class="formbox"><input name="phone" type="text" width="400" /></div>
<h3>Address</h3>
<div class="formbox"><input name="address" type="text" width="400" /></div>
<h3>City</h3>
<div class="formbox"><input name="city" type="text" width="400" /></div>
<h3>State</h3>
<div class="formbox"><input name="state" type="text" width="400" /></div>
<h3>Postcode</h3>
<div class="formbox"><input name="postcode" type="text" width="400" /></div>
<h3>Country</h3>
<div class="formbox"><input name="country" type="text" width="400" /></div>
<h3>Age</h3>
<div class="formbox"><select name="age" type="text" width="400" >
<option>Choose One</option>
<option>Under 12</option>
<option>Under 16</option>
<option>16 - 30</option>
<option>31 - 40</option>
<option>Over 40</option>
</select></div>
<h3>Sex</h3>
<div class="formbox"><select name="sex" type="text" width="400" >
<option>Choose One</option>
<option>Male</option>
<option>Female</option>
</select></div>
<h3>Class</h3>
<div class="formbox"><select name="class">
<option>Choose One</option>
<option>Pro A</option>
<option>B</option>
<option>C (Clubman)</option>
<option>Vets (40+)</option>
<option>Ladies</option>
<option>Blasters</option>
<option>Juniors (90cc)</option>
<option>Juniors (50cc)</option>
<option>UTV's</option>
<option>Pit Bikes</option></select>
</div>

<div class="formbox"><input type="submit" name="submit" value="Submit" /></div>

</form></div>
<p>&nbsp;</p>
</div>

config_rego.php

<?php
Include"config_rego.php";

$event=$_POST['event'];
$fname=$_POST['fname'];
$sname=$_POST['sname'];
$email=$_POST['email'];
$phone=$_POST['phone'];
$address=$_POST['address'];
$city=$_POST['city'];
$state=$_POST['state'];
$postcode=$_POST['postcode'];
$country=$_POST['country'];
$age=$_POST['age'];
$sex=$_POST['sex'];
$class=$_post['class'];

mysql_query("INSERT INTO event_register (event, fname, sname, email, phone, address, city, state, postcode, country, age, sex, class)
VALUES
('$event','$fname','$sname','$email','$phone','$address','$city','$state','$postcode','$country','$age','$sex','$class') ")
or die(mysql_error());

echo "Thankyou!";

?>
</div>
melcox80
New php-forum User
New php-forum User
 
Posts: 1
Joined: Tue Jan 10, 2012 6:58 pm

Re: Drop down boxe selections to php my admin

Postby rupali » Tue Jan 10, 2012 9:14 pm

hello,

use value keyword there after option

for example

<select name="colour">
<option value="Choose one">Choose one</option>
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
</select>
rupali
New php-forum User
New php-forum User
 
Posts: 140
Joined: Thu Oct 13, 2011 10:32 pm
Location: Chandigarh, INDIA


Return to PHP Scripts

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron