Jump to content

Sending POST variables without using a form


virruss

Recommended Posts

Ok... Basically, what I need is to submit a form twice, to different locations with a single click.

 

Why I need that? I'm running an affiliate program and I need to collect the name and email address of my visitors before I actually send that information to the merchant.

 

I can ask them to confirm their information (and to get the second sumbit manually...) but this will obviously reduce the conversions.

 

I cannot change the variables into GET variables because they won't work on merchant's page anymore.

 

Is there a way to send POST variables after I store them into my database without having to resubmit the form?

 

Thank you.

Thank you very much!

 

3 more questions:

 

1.Do I need to install something in order to use the second method?

2.Do I need to modify anything besides

 

$done = sendPost("www.benedikt.vamos-inc.at","/test/post.php", 
        "http://benedikt.vamos-inc.at/test/index.php", 
        $post_data); //Host, Path, Referer, Post-Data 

 

at the end?

 

3. Can I use more variables?

 

Thank you.

you are welcome!

 

1: for the version with fsocks you shouldn't need anything (just for curl version you need curl installed -depends on the webspace)

 

2: you shouldn't have to change anything except what you posted.

 

3: edit: you can use more variables ... if you extend the function :)

Sorry for all the questions... But, how does the code look like with more than one custom POST variable?

 

I'm very unfamiliar with this stuff... Do I have to add another $post_data? Like...

 

function sendPost($host, $location, $referer, $post_data1, $post_data2,) { 
...
$done = sendPost("www.benedikt.vamos-inc.at","/test/post.php", 
        "http://benedikt.vamos-inc.at/test/index.php", 
        $post_data1, $post_data2); //Host, Path, Referer, Post-Data 

 

Thank you again.

 

P.S.: This was the last question... I promise :P

Oh, sorry, i misunderstood your question.

 

You simply have to connect your vars in one string... like with GET - connected with "&". In my example on my homepage there were more than one variables. example: "var1=14&var2=2&var3=tasdf"

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.