rabidbeast Posted March 16, 2008 Share Posted March 16, 2008 Hi i am trying to make an order form which a user will fill in, and will then be inserted into the database and then the details to be submitted to paypal for payment. I have looked at paypal codes but I cant find anyway of submitting details to the database before submitting them to paypal. My code is below. Can anyone help? <?php include 'library/connect.php'; if(isset($_POST['txtNamea'])) { $LL = $_POST['txtNamea']; $id = $_POST['txtName1']; $email = $_POST['txtName2']; $contact = $_POST['txtName3']; $query = "INSERT INTO detail (ll, id, date, email, contact) VALUES ('$LL, '$id', NOW(), 'n', '$contact')"; mysql_query($query) or die('Error, failed : ' . mysql_error()); echo "<script>window.location.href='main?page=contact';</script>"; exit; } ?> <form action="" method="post" enctype="multipart/form-data" name="frmAlbum" id="frmAlbum"> <table width="100%" border="0" cellpadding="2" cellspacing="1" class="table_grey"> <tr> <th width="150">item</th> <td width="80" bgcolor="#FFFFFF"> <input name="txtNamea" type="text" id="txtNamea"></td><br> </tr> <tr> <th width="150">id</th> <td width="80" bgcolor="#FFFFFF"> <input name="txtName1" type="text" id="txtName1"></td><br> </tr> <tr> <th width="150">email</th> <td width="80" bgcolor="#FFFFFF"> <input name="txtName2" type="text" id="txtName2"></td><br> </tr> <tr> <th width="150">contact name</th> <td width="80" bgcolor="#FFFFFF"> <input name="txtName3" type="text" id="txtName3"></td><br> </tr> <tr> <td width="150" bgcolor="#FFFFFF"> </td> <td bgcolor="#FFFFFF"> <input name="btnAdd" type="submit" id="btnAdd" value="Submit"> <input name="btnCancel" type="button" id="btnCancel" value="Cancel" onClick="window.history.back();"></td> </tr> </table> </form> Link to comment https://forums.phpfreaks.com/topic/96430-form-add-to-database-submit-to-paypal/ Share on other sites More sharing options...
BlueSkyIS Posted March 16, 2008 Share Posted March 16, 2008 it looks like you're inserting the details here. what's the problem? $query = "INSERT INTO detail (ll, id, date, email, contact) VALUES ('$LL, '$id', NOW(), 'n', '$contact')"; mysql_query($query) or die('Error, failed : ' . mysql_error()); Link to comment https://forums.phpfreaks.com/topic/96430-form-add-to-database-submit-to-paypal/#findComment-493546 Share on other sites More sharing options...
rabidbeast Posted March 16, 2008 Author Share Posted March 16, 2008 Hi, It inserts it into the database but i cant find any way of then sending the submitted info from the form to paypal.... i dont know if there is a simple way of doing it. Thanks Link to comment https://forums.phpfreaks.com/topic/96430-form-add-to-database-submit-to-paypal/#findComment-493558 Share on other sites More sharing options...
rabidbeast Posted March 25, 2008 Author Share Posted March 25, 2008 can anyone help me. the script above works, inserting it into the database, but how do i add the $LL to a paypal cart after inserting it into the database.... thanks Link to comment https://forums.phpfreaks.com/topic/96430-form-add-to-database-submit-to-paypal/#findComment-500732 Share on other sites More sharing options...
BlueSkyIS Posted March 25, 2008 Share Posted March 25, 2008 have you looked at the examples provided by PayPal? php_nvp_samples Link to comment https://forums.phpfreaks.com/topic/96430-form-add-to-database-submit-to-paypal/#findComment-500743 Share on other sites More sharing options...
rabidbeast Posted March 25, 2008 Author Share Posted March 25, 2008 i havent heard of php_nvp_samples. do you have a link that i could follow? thanks Link to comment https://forums.phpfreaks.com/topic/96430-form-add-to-database-submit-to-paypal/#findComment-500826 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.