Click to See Complete Forum and Search --> : form POST via headers only


Anon
04-19-2002, 06:50 PM
Has anyone ever POSTed a form via headers only?

For example, I want to create a form that is to POST to another website, but I want an entry in my Apache log of where we are taking the user:

<FORM METHOD="POST" ACTION="redirect.php3?url=http://www.yahoo.com">
<INPUT TYPE="hidden" NAME="name1" VALUE="value1">
<INPUT TYPE="hidden" NAME="name2" VALUE="value2">
</FORM>

redirect.php3 will get recorded in my Apache log as
redirect.php3?url=http://www.yahoo.com
(which is what I want) so I can see where we directed the user.

Then I need to (finish up the POST) and take the user to the page they want:
header ( "Content-type: application/x-www-form-urlencoded" );
header ( "Content: name1=value1&name2=value2" );
header ( "Location: $url" );

Those headers are not sending the content. Any help would be greatly appreciated!

vincente
04-20-2002, 11:41 AM
So you want an entry in _your_ webserver's log that says where your script sent some client _to_?

Wouldn't it make a lot more sense to log this anywhere but in the apache log?

Anyway, you can learn all about how to post with headers by reading the HTTP rfc, freely available at your local www.google.com