27 users online (1 members and 26 guests)  


  Results 1 to 2 of 2

Related

  1. Form Submit Problem    Forum: HTML Forum
    Replies: 2
  2. submit form problem    Forum: HTML Forum
    Replies: 0
  3. form submit button    Forum: HTML Forum
    Replies: 1
  4. overwrite results on submit form    Forum: HTML Forum
    Replies: 5
  1. #1
    SWMagic's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2007
    Posts
    1

    1 submit, 2 form posts

    I need to be able to submit a form twice with one submit button. Html can't do this by itself but I think PHP or Javascript can.
    Effectively I simply want to submit this twice using a different merchant ID.
    Does anybody know how to do this in PHP?
    Thanks, Paul
    Code:
     <form name="form1" method="post" action="h t t p://www.blah.com/contactsave.asp"> 
    <input name="merchantid" type="hidden" id="merchantid" value="108194"> 
    <input name="ARThankyouURL" type="hidden" id="ARThankyouURL" value=" w w w .domainname.com/xyz.htm> 
    <input name="copyarresponse" type="hidden" id="copyarresponse" value="1"> 
    <input name="custom" type="hidden" id="custom" value="1"> 
    <input name="defaultar" type="hidden" id="defaultar" value="269327"> 
    <input name="allowmulti" type="hidden" id="allowmulti" value="0"> 
    <input name="visiblefields" type="hidden" id="visiblefields" value="Name,Email1,Company"> 
    <input name="requiredfields" type="hidden" id="requiredfields" value="Name,Email1,Company"> 
    <table> 
        <tr> 
          <td>Name</td> 
          <td><input name="Name" type="text" size="40"></td> 
        </tr> 
    (blah,blah,blah, other fields) 
    <tr align="center"> 
      <td colspan="2"> 
       <input type="Submit" name="cmdSubmit" value="Submit"> 
      </td> 
    </tr> 
      </table> 
    </form>

  2. #2
    redlorry919's Avatar
    New User

    Status
    Offline
    Join Date
    Nov 2007
    Posts
    4

    Re: 1 submit, 2 form posts

    2 options that come to my mind immediately:
    - Use php to capture the vars, then create a url full of GET vars. i.e. ?var1=value1&var2=value2... etc. You can then bolt this on the end of each url and use file_get_contents or fopen to send to the recipient url.
    - The other method is to use Curl. It's more complicated however it's far more secure and also means the vars can be sent as POST vars rather than GETs. Look at php.net for more info on Curl.



Tags for this Thread