Jump to content

Recommended Posts

hello! I'm catching what a client send with a POST form with culr, but, I don't know how to say it "wait until the form is send" because this is the only moment it can get the POST content:

 

<?php

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "post.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_exec($ch);
var_dump(curl_getinfo($ch, CURLOPT_POST));
?>

 

It always returns NULL, and I suppose this is the reason. Do you know where is my problem?

 

Thank you! regards!!!

Link to comment
https://forums.phpfreaks.com/topic/189829-culr-wait-a-response/
Share on other sites

Hi! maybe I didn't explain well, I want to capture the POST in the other web site, not in mine, I saw that CURLOPT_POST is just for send, it is not possible do what I want? I tried this:

 

$p = $_POST['p'];
$f = $_POST['f'];

 

In the correct web site they are perfect, but in mine, where I want to "steal" this they are empty.

 

Thank you very much!

I'm afraid you didn't understand me, with

 


curl_setopt($ch, CURLOPT_POST, $POSTData);

 

I send $POSTData to the www.server/post.php , but, what I want (and I'm starting thinking it's not possible) is:

 

In www.server/index.php I have a form, I insert whatever and push "send", redirect to www.server/post.php

So, in www.server/post.php  I have the post values $_POST['p'] and $_POST['f']

 

Now from www.othercomputer/index.php I want read $_POST['p'] and $_POST['f']

 

I hope you'll undestand me this time.

 

thank you!

Yes i understood and my last reply still applies!

post.php need to capture the POST and use cURL to send to another server..

however your code sends an empty post as you didn't send any post data,

what my lines does is use the received post and add's it to the cURL.

 

Hi again.

 

I want to configure a router and do a log of the configuration, in my computer I access to www.othercomputer/index.php, this page have a link "configure router" this link is:

 

<a href = 192.168.0.1 target='_blank'> Configure router </a> 

 

I open it in a new tab because I can't write a "back" button.

 

For example, I change the wireless password, so, I write it in a form and send, I want to capture this information and add it to my log file.

 

Did I explain it well this time?

 

Regards

 

 

 

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.