Jump to content

Post a form to a different website?


frio80

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.