ok this is the form <form action="add.php" method="post"> <div id="info" style="width:360px;"> <div align="left"> <input type="text" name="name"> <strong>Name:</strong> <br> <br /> <input type="text" name="username"> <strong>Username:</strong> <br> <br /> <input type="text" name="password"> <strong>Password:</strong> <br> <br /> <input type="text" name = "email"> <strong>Email </strong><br> <br /> <input type="text" name="parkname"> <strong>Park Name:</strong> <br> <br /> <input type="text" name="parklocation"> <strong>Park Location</strong>: <br> <br /> <input type="text" name="caravandetails"> <strong>Caravan Details</strong>: <p><strong> <br/> <input type="submit" value="submit"> </div> </form> </div> HTML: this is the php code <?php //This gets all the other information from the form $name=$_POST['name']; $username=$_POST['username']; $password=$_POST['password']; $email=$_POST['email']; $parkname=$_POST['parkname']; $parklocation=$_POST['parklocation']; $caravandetails=$_POST['caravandetails']; // Connects to your Database mysql_connect("s", "", "s") or die(mysql_error()); mysql_select_db("u") or die(mysql_error()); //Writes the information to the database mysql_query("INSERT INTO `members` VALUES ('$name', '$username', '$password', '$email', '$parkname', '$parklocation', '$caravandetails')"); ?> <?php echo "your information has been added to the directory You will be redirected to Add Photo in three seconds!><br /><br /> <div class='info'>If you don't wish to wait, <a href='email.php'>click here</a>"; echo'<meta http-equiv="REFRESH" content="3;url=email.php">'; ?> PHP:
try adding the die(mysql_error()) to the mysql_query(), i'm almost positive that your problem lies there.
ok thanks for info working now my fault had more fields in database than on form ok can you tell me is this possable in this code <?php //This gets all the other information from the form $name=$_POST['name']; $username=$_POST['username']; $password=$_POST['password']; $email=$_POST['email']; $parkname=$_POST['parkname']; $parklocation=$_POST['parklocation']; $caravandetails=$_POST['caravandetails']; $pname=$_POST['pname']; // Connects to your Database mysql_connect("s", "d", "s") or die(mysql_error()); mysql_select_db("u") or die(mysql_error()); //Writes the information to the database mysql_query("INSERT INTO `members` VALUES ('$name', '$username', '$password', '$email', '$parkname', '$parklocation', '$caravandetails', '$pname')"); ?> PHP: $pname=$_POST['pname']; can i say some thing like if pname ="" then let pname ="pic0.jpg" so that if the field pname is blank it will insert the other into it cheers Doug