View Full Version : POST variables without sending a form
djr33
05-07-2006, 08:18 PM
I've looked around google and php.net, but no luck.
Is there any way to send post vars to another page?
Sending a form works, I suppose... but... kinda limited at times.
Is there any way around this?
Or, failing that, I know that an image can be an input for a form, but is there a way that a link could be a "submit button" like an image can?
mwinter
05-07-2006, 08:47 PM
Is there any way to send post vars to another page?From browser to server? The only reliable way is using a form.
Or, failing that, I know that an image can be an input for a form, but is there a way that a link could be a "submit button" like an image can?Style the submit button to look like a link.
Mike
GET vars, yes. POST vars are trickier; PHP provides, insofar as I know, no direct support. Instead, you must use fsockopen() to connect with the server and construct the HTTP request yourself.
From browser to server? The only reliable way is using a form.From PHP.
djr33
05-07-2006, 09:59 PM
Twey, you seem to imply there might be a way with another setup? What is that, and how hard would it be?
And, could you provide a bit more info about the fsockopen, http request, etc? Totally new territory for me.
Mike, the only "reliable" way? What else?
And, how would one style a button like that?
Mike, the only "reliable" way? What else?If Mike dismissed it as "unreliable," it's not worth doing :) In this case, it would likely involve XMLHttpRequest, which allows you to send POST data as an argument to the send() method, in the form send("name=value").
Twey, you seem to imply there might be a way with another setup? What is that, and how hard would it be?I think libcurl provides handlers for this kind of thing, but I don't know anything about it.
And, could you provide a bit more info about the fsockopen, http request, etc? Totally new territory for me.http://www.w3.org/Protocols/rfc2616/rfc2616.html
http://www.php.net/fsockopen
And, how would one style a button like that?
input.notAButtonHonest {
border-style: none;
background-color: transparent;
color: blue;
text-decoration: underline;
}
input.notAButtonHonest:visited {
color: purple;
}
input.notAButtonHonest:active {
color: red;
}
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.