Hello there, I recently started to learn PHP and i've got a question.
I am familiar with POST but instead of calling it from a <FORM> i want to call it from PHP to reroute information to a new page, is this even possible? and if so how can this be accomplished?
Im not sure what you are trying to accomplish.
But you can use sessions for temporarily storing data server side
If you ABSOLOUTLY want to use post towards a new page (only reason for this would be if the other site isn't yours), then look into curl in PHP ([url]http://php.net/manual/en/book.curl.php[/url]) Keep in mind, it has to be installed on the server, so if you use it on a webhost, and they don't have it installed, then you're out of luck. I guess you can also find a HTTP socket library somewhere that'd simulate this behaviour, but you'd have to look into that yourself.
Or just put the data in a form and have a javascript submit the form on page load if its something cross site..
With curl your user wont end up on the page you "redirect" to, but you will be able to make POST requests with it and echo the response, if thats what you need..
But if you just need to save a few variables for later use then go with sessions..
Nevermind guys, i've figured out a better way to do it, now i am using $_SESSION and 301 Redirect.
So in other words you used sessions.. Great it was the best way to do it anyways...
Sorry, you need to Log In to post a reply to this thread.