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
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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.