Hi im developing in php and keep ending up with a blank entry when I try the following form.
It registers that something must enter the database as it auto increments but all the fields are blank.
if you can help it would be great.
form :
<form action="add_contact.php" method="post">
Name: <input type="text" name="name" id="name"/>
Address1: <input type="text" name="Address1" id="address1"/>
Address2: <input type="text" name="Address2" id="address2"/>
Address3: <input type="text" name="Address3"id="address3"/>
suburb: <input type="text" name="Suburb" id="suburb"/>
City: <input type="text" name="City" id="city"/>
Area: <input type="text" name="Area" id="area"/>
Province: <input type="text" name="Province" id="Province"/>
Country: <input type="text" name="Country" id="Country"/>
Tel: <input type="number" name="Tel" id="tel"/>
Rooms: <input type="number" name="Rooms" id="rooms"/>
Description: <input type="text" name="Description" id="description"/>
POBox: <input type="number" name="POBox" id="pobox"/>
<input type="Submit"name="submit" value="submit" />
</form>
Php:
<?php
$DBhost="localhost";
$DBpass= "";
$DBName = "hotel";
$table = "hotel_detail";
$DBuser="root";
$name=$post['name'];
$address1=$post['address1'];
$address2=$post['address2'];
$address3=$post['address3'];
$suburb=$post['suburb'];
$city=$post['city'];
$area=$post['area'];
$province=$post['province'];
$country=$post['country'];
$tel=$post['tel'];
$rooms=$post['rooms'];
$description=$post['description'];
$pobox=$_post['pobox'];
$dbh = mysql_connect($DBhost,$DBuser) or die("Unable to connect to database");
Echo "connected to mysql";
$db_selected = mysql_select_db('Hotel',$dbh) or die(mysql_error());
Echo "dbase selected";
Mysql_query("INSERT INTO Hotel_detail (name,address1,address2,address3,suburb,city,area,
province,country,tel,rooms,description,pobox) VALUES ('$name','$address1','$address2','$address3
','$suburb','$city','$area','$province','$country','$tel','$rooms','$description','$pobox')",$dbh) ;
$db_selected = mysql_select_db('Hotel',$dbh) or die(mysql_error());
Echo "dbase selected data entered";
?>
Regards
Malcolm