this form save as choose.html : it is separated from my car.php. so this means Posting form data to a different PHP script which every time i run this i get an error : Undefined index for ‘selType’ and ‘txtcolor’. please help me i am newbie here and id really like to learn. :’(
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head><title /></head>
<body>
<h2>Select Your Car</h2>
<form method="post" action="car.php">
Type: <br />
<select name="selType">
<option value="Porsche 911">Porsche 911</option>
<option value="Volkswagen Beetle">Volkswagen Beetle</option>
<option value="Ford Taurus">Ford Taurus</option>
</select><p />
Color: <br />
<input type="text" name="txtColor" /> <p />
<input type="submit" />
</form>
</body>
</html>
[php]
<?php // get form input $type = $_POST['selType']; $color = $_POST['txtColor']; // use form input echo "Your $color $type is ready. Safe driving!"; ?>[/php]