Jump to content

How do I send data onto a form on another site and retrieve the output?


jwk811

Recommended Posts

I may be pushing it here but I think it might be possible to do this like paypal does. When a visitor enters my site I want to send there IP address to another website and submit it and retrieve the output which would be their personal information. If there is something close to this that I could do, please help me out here. Thanks!

Link to comment
Share on other sites

If you don't already have it installed you do need to enable the curl extension

 

I think I might because I'm using godaddy's server and they probably have it.

 

$curl=curl_init("url");

$values=array("ip"=>$_SERVER['REMOTE_ADDR']);
curl_setopt($curl,CURLOPT_POST,true);
curl_setopt($curl,CURLOPT_POSTFIELDS,$values);

$results=curl_exec($curl);

 

Is this all I need to know?

 

Okay so the first line I put the url of the page with the form.

 

Next I have an array with the form's input name with the value, correct?

 

And do I need to change anything with the other two lines?

 

Will that get the country, city, etc.? Where will that information go, into an array?

Link to comment
Share on other sites

Godaddy does have curl enabled by default

Okay so the first line I put the url of the page with the form.

right

Next I have an array with the form's input name with the value, correct?

right

And do I need to change anything with the other two lines?

not really

Will that get the country, city, etc.? Where will that information go, into an array?

It'll go into the $_POST array

Link to comment
Share on other sites

yeah.. but.. i still dont get it.. okay so $_POST['ip']; will be my ip that i submitted i dont understand how  i can get the country etc.. did you see that site http://www.formyip.com/ipcountry.php when you put an ip in the box and submit it the coutry state and city come up on the next page.. are you saying that the country etc is in the $_POST array? can you be a little more informitive please? thanks.. i am very confused

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.