frio80 Posted July 10, 2007 Share Posted July 10, 2007 Perhaps, not a PHP question but I have a <form> variable that I need to access on a different website. <script language="JavaScript"> <!-- document.write("<form method='post' name='samplesearch' action='http://<my-website>'>"); document.write("<input type='hidden' name='data' value='<?=$data;?>'>"); document.samplesearch.submit(); //--> </script> This works in IE but now FF. Why? Security concern? Should I use cURL instead? Many thanks. Link to comment https://forums.phpfreaks.com/topic/59315-post-a-form-to-a-different-website/ Share on other sites More sharing options...
per1os Posted July 10, 2007 Share Posted July 10, 2007 Javascript is the reasoning. First of all language is no longer standard. Use type="text/javascript" instead. Second it would be the submit portion that is acting up. I am sure with FF document.forms[0].submit or something similiar is what you need to submit the form. I am not sure what it is but this is a javascript question, if you want a correct answer I suggest you ask them. Link to comment https://forums.phpfreaks.com/topic/59315-post-a-form-to-a-different-website/#findComment-294668 Share on other sites More sharing options...
cooldude832 Posted July 10, 2007 Share Posted July 10, 2007 have you thought about using the cURL() library/a socket connection? Link to comment https://forums.phpfreaks.com/topic/59315-post-a-form-to-a-different-website/#findComment-294671 Share on other sites More sharing options...
frio80 Posted July 10, 2007 Author Share Posted July 10, 2007 Thanks for the replies. I have not used cURL before but from what I'm reading about it, it is exactly what I need. Link to comment https://forums.phpfreaks.com/topic/59315-post-a-form-to-a-different-website/#findComment-294709 Share on other sites More sharing options...
cooldude832 Posted July 10, 2007 Share Posted July 10, 2007 Draw out a path of what happpens and we can help ie person goes to form (on local server) sends to a processer on faraway server far away server returns info returns are dbed in your database Link to comment https://forums.phpfreaks.com/topic/59315-post-a-form-to-a-different-website/#findComment-294712 Share on other sites More sharing options...
frio80 Posted July 13, 2007 Author Share Posted July 13, 2007 Thanks. cURL was exactly what I needed to avoid 'POST'ing to another server. Link to comment https://forums.phpfreaks.com/topic/59315-post-a-form-to-a-different-website/#findComment-297500 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.