Re: POST_with_PHP_--_please_help_!
| From: | Krzysztof Dziekiewicz | Date: | Tue, 04 Feb 2003 09:00:40 +0000 |
| Subject: | Re: POST_with_PHP_--_please_help_! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-134224@lists.php.net to get a copy of this message | ||
> That's right, but with curl it's not a true redirection: you just print the content
> of the target page, you don't redirect to the page.
> What I need is "automated forms", that send the same data as forms but without user
> interaction.
> I can't use javascript to automatically send a form.
Maybe something like this:
$fs = fsockopen("target.com",80);
fputs($fs, '
POST /index.html HTTP/1.1
Accept: */*
Content-Type: application/x-www-form-urlencoded
Accept-Encoding: gzip, deflate
Host: target.com
Content-Length: 41
data1=value1data2=value2
');
Your script sends data to http://target.com/index.html
At the end you can do "location".
That is all you can do.