virruss Posted June 2, 2008 Share Posted June 2, 2008 Ok... Basically, what I need is to submit a form twice, to different locations with a single click. Why I need that? I'm running an affiliate program and I need to collect the name and email address of my visitors before I actually send that information to the merchant. I can ask them to confirm their information (and to get the second sumbit manually...) but this will obviously reduce the conversions. I cannot change the variables into GET variables because they won't work on merchant's page anymore. Is there a way to send POST variables after I store them into my database without having to resubmit the form? Thank you. Link to comment https://forums.phpfreaks.com/topic/108407-sending-post-variables-without-using-a-form/ Share on other sites More sharing options...
kbh43dz_u Posted June 2, 2008 Share Posted June 2, 2008 Here, on my Homepage is the source for 2 different scripts to "fake" POST-Data (curl and fsocks). http://benedikt.vamos-inc.at/pages/codingphp.php (you have to scroll down a little bit) Best regards! Link to comment https://forums.phpfreaks.com/topic/108407-sending-post-variables-without-using-a-form/#findComment-555740 Share on other sites More sharing options...
virruss Posted June 2, 2008 Author Share Posted June 2, 2008 Thank you very much! 3 more questions: 1.Do I need to install something in order to use the second method? 2.Do I need to modify anything besides $done = sendPost("www.benedikt.vamos-inc.at","/test/post.php", "http://benedikt.vamos-inc.at/test/index.php", $post_data); //Host, Path, Referer, Post-Data at the end? 3. Can I use more variables? Thank you. Link to comment https://forums.phpfreaks.com/topic/108407-sending-post-variables-without-using-a-form/#findComment-555745 Share on other sites More sharing options...
kbh43dz_u Posted June 2, 2008 Share Posted June 2, 2008 you are welcome! 1: for the version with fsocks you shouldn't need anything (just for curl version you need curl installed -depends on the webspace) 2: you shouldn't have to change anything except what you posted. 3: edit: you can use more variables ... if you extend the function Link to comment https://forums.phpfreaks.com/topic/108407-sending-post-variables-without-using-a-form/#findComment-555746 Share on other sites More sharing options...
virruss Posted June 2, 2008 Author Share Posted June 2, 2008 Sorry for all the questions... But, how does the code look like with more than one custom POST variable? I'm very unfamiliar with this stuff... Do I have to add another $post_data? Like... function sendPost($host, $location, $referer, $post_data1, $post_data2,) { ... $done = sendPost("www.benedikt.vamos-inc.at","/test/post.php", "http://benedikt.vamos-inc.at/test/index.php", $post_data1, $post_data2); //Host, Path, Referer, Post-Data Thank you again. P.S.: This was the last question... I promise Link to comment https://forums.phpfreaks.com/topic/108407-sending-post-variables-without-using-a-form/#findComment-555752 Share on other sites More sharing options...
kbh43dz_u Posted June 2, 2008 Share Posted June 2, 2008 Oh, sorry, i misunderstood your question. You simply have to connect your vars in one string... like with GET - connected with "&". In my example on my homepage there were more than one variables. example: "var1=14&var2=2&var3=tasdf" Link to comment https://forums.phpfreaks.com/topic/108407-sending-post-variables-without-using-a-form/#findComment-555783 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.