Hi i have a form which also uses php to insert records into database, just name and address but also need them to pay via paypal, please help
Form code
<form action="insert.php" method="post">
<div align="center">Firstname:
<input type="text" name="firstname" />
Lastname:
<input type="text" name="lastname" />
Email:
<input type="text" name="email" />
<input type="submit" />
</div>
</form>
<div align="center">
insert.php code
<?php
$con = mysql_connect("x","x","x");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("databasename", $con);
$sql="INSERT INTO Persons (FirstName, LastName, Email)
VALUES
('$_POST[firstname]','$_POST[lastname]','$_POST[email]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
$to = "mymail"; //Your email address
$subject = " Paying member"; //Email subject
$message = "new details have been entered into the database"; //Body of email
mail($to, $subject, $message);
echo "Thank you you will recieve information shortly";
mysql_close($con)
?>
thanks