Jump to content

POST to MySQL Then send the form values to another url? HELP!


marcfolio

Recommended Posts

I have a from that I need to do 2 things with the values. I can do both seperately but I need them to happen either at the same time or after one's complete.

 

FIRST, the form post the data and PHP writes it to a MySQL database, I then need the informtion passed to a ARP3 script that adds the data to another separate database. The post variables that I can get to work for the ARP3 is the following: <FORM name="form1" method="post" action="http://www.balancemydiet.com/cgi-bin/arp3/arp3-formcapture.pl

 

Is there anyway to post the variables twice? HELP.

i dont know what functions the ARP3 script has but you could add a line onto the end of your php script

header('Location: http://www.balancemydiet.com/cgi-bin/arp3/arp3-formcapture.pl?id='.$id);

make $id to be it id of the row you insert into th database then find that row and insert it into the other DB

 

Scott.

Figured it out. Your solution would have worked if it was another php form. Anyway this is my solution.

 

Basically it uses javascript to submit the form again.

 

        echo '<body onLoad="document.form1.submit()">';

 

echo '<FORM name="form1" method="post" action="/cgi-bin/arp3/arp3-formcapture.pl">';

echo '<input type="hidden" name="first_name" value="'.$firstName.'"/>';

echo '<input type="hidden" name="email" value="'.$email1.'"/>';

     

echo '<input type="hidden" name="source" value="134" />';

  echo '<input type="hidden" name="tracking_tag" value="bajaliving" />';

echo '<input type="hidden" name="id" value="3">';

echo '<input type="hidden" name="extra_ar" value="">';

echo '<input type="hidden" name="first_name_man" value="1">';

echo '<input type="hidden" name="subscription_type" value="E">';

 

echo '</body>';

 

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.