Hi Let me clarify, i think im confused myself...lol and tell me if it makes sense.
I have a booking1.php. This is a form that takes customer details when submitted this takes you to a insertdetails page. this page put the data in the db.
Now i would like to submit the customer details in to the paypal.php. This page has hidden fields. I would like to put the values in these hidden fields.
this is my insertdetails.php
<?php
if (!empty($POST['forename']) && !empty($POST['surname']) && !empty($POST['dob']) && !empty($POST['telephonenumber']) && !empty($POST['email'])) {
$forename = addslashes($POST['forename']);
$surname = addslashes($POST['surname']);
$dob = addslashes($POST['dob']);
$telephonenumber = addslashes($POST['telephonenumber']);
$email = addslashes($POST['email']);
$db = @mysql_connect('localhost', 'phpuser', 'phpuser03') or die('Could not connect to the database: '.mysql_error());
@mysql_select_db('booking') or die('Could not select the database: '.mysql_error());
$result = mysql_query('INSERT INTO `customer` (`forename`, `surname`, `date_of_birth`, `telephonenumber`, `email`)'.
"VALUES ('$forename', '$surname', '$dob', '$telephonenumber', '$email')") or die('Unable to insert record. '.mysql_error());
echo 'Your record was successfully inserted.';
} else {
echo 'You have not entered all the required details.<br />'."\n";
echo 'Please go back and try again.';
}
?>
and this is my paypal.php
<html>
<body>
<form name= "order" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_ext-enter"><br>
<input type="hidden" name="redirect_cmd" value="_xclick"><br>
<input type="hidden" name="return"
value = "http://81.106.219.3/m82/successful.php?status=T"><br>
<input type="hidden" name="cancel_return"
value = " http://81.106.219.3/m82/unsuccessful.php?status=F"><br>
<input type="hidden" name="business" value ="hlhome@hotmail.com">
<input type="hidden" name="item_name" value="Tickets">
<input type="hidden" name="shipping" value="0.00">
<input type="hidden" name="shipping2" value="0.00">
<?php
//get values from previous page
$forename=$POST[forename];
$surname=$POST[surname];
$age=$POST[age];
$telephonenumber=$POST[telephonenumber];
$email=$_POST[email];
if (count($POST)) { echo '<pre>'; print_r($POST); exit; }
$quantity = $HTTP_GET_VARS['quantity'];
$total = $HTTP_GET_VARS['total'];
echo "<input type=\"hidden\" name=\"quantity\" value=\"$quantity\"><br>\n";
echo "<input type=\"hidden\" name=\"amount\" value=\"$total\"><br>\n";
//include database password information etc.
$hostname = "localhost";
$username = "phpuser";
$password = "phpuser03";
if(!($link = mysql_connect($hostname, $username,$password)))
die("Could not connect to database.");
$databasename = "booking";
if(!(mysql_select_db($databasename,$link)))
die("Could not open table.");
//now get customer info from database
$customerid = $HTTP_GET_VARS['customerID'];
$strsql= "SELECT forename, surname, age, telephonenumber,email
FROM
customer
WHERE CustomerID = '$customerid'";
if(!($rs= mysql_query($strsql, $link)))
die("Could not open table.");
//only one row should be returned
$row = @ mysql_fetch_array($rs);
// now complete the form
echo "<input type=\"hidden\" name=\"forename\"value=\"$row[forename]\"><br>\n";
echo "<input type=\"hidden\" name=\"surname\"value=\"$row[surname]\"><br>\n";
echo "<input type=\"hidden\" name=\"age\"value=\"$row[age]\"><br>\n";
echo "<input type=\"hidden\" name=\"telephonenumber\"value=\"$row[telephonenumber]\"><br>\n";
echo "<input type=\"hidden\" name=\"email\"value=\"$row[email]\"><br>\n";
?>
<!-- end of form -->
</form>
<script type="text/javascript" language="JavaScript">
//submit form
document.order.submit();
</script>
</body>
<html>
so i want to be able to pass the customer details to the hidden form
is what im saying make sense