How to send POST data?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Bongulim
Forum Newbie
Posts: 21
Joined: Thu Aug 07, 2003 12:50 pm

How to send POST data?

Post by Bongulim »

I'm sorry if it's answerd somewhere I couldn't find, but please help me: I want to read a page that requires me to in before I can read it. how can I send the POST data thorgh a script (that is so I won't have to click a button on a form)
Thanks inadvance
Bongulim
User avatar
xisle
Forum Contributor
Posts: 249
Joined: Wed Jun 25, 2003 1:53 pm

Post by xisle »

Code: Select all

print"<script language="JavaScript">\n";
print"<!-- hide me \n";
print"window.document.yourformname.submit();\n";
print"// show me -->\n";
print"</script>";
hedge
Forum Contributor
Posts: 234
Joined: Fri Aug 30, 2002 10:19 am
Location: Calgary, AB, Canada

Post by hedge »

do a search on my username.. I've answered this question many times and I am too lazy to search myself at the moment.
Bongulim
Forum Newbie
Posts: 21
Joined: Thu Aug 07, 2003 12:50 pm

Post by Bongulim »

thanks hedge - I've find viewtopic.php?t=7063 helpful. quite solved it actually :D
hedge
Forum Contributor
Posts: 234
Joined: Fri Aug 30, 2002 10:19 am
Location: Calgary, AB, Canada

Post by hedge »

Bongulim wrote:thanks hedge - I've find viewtopic.php?t=7063 helpful. quite solved it actually :D
BTW the function 'httpParseResponse' in my code is incorrect. It explodes by \r\n\r\n when it should just split the headers from the content at the first occurrance of \r\n\r\n
dataangel
Forum Newbie
Posts: 12
Joined: Thu Aug 07, 2003 7:29 pm

Post by dataangel »

Code: Select all

<form method="post" action="<?php echo $PHP_SELF ?>">
<input type="hidden" name="hiddenpostdata" value="hiddenpoststuff">
</form>
Post Reply