TempleDMDKrazd Posted July 26, 2008 Share Posted July 26, 2008 I know there are two types of HTTP request methods GET and POST. GET is embedded into the URL while POST is embedded into the http request itself. the thing is in my PHP code for me to relocate the user to another page i use the following function: header("Location: somepage.php?status=T"); it passes the status variable ($_GET["status"]) by GET to somepage.php. is there a way where I can pass it by POST in my PHP code or is there a function similiar to header that I can pass it by POST? thanks Link to comment https://forums.phpfreaks.com/topic/116682-header-and-_post-question/ Share on other sites More sharing options...
Third_Degree Posted July 26, 2008 Share Posted July 26, 2008 This is rather complicated, but cURL is your best option. http://phpgfx.com/tutorials/?action=read&id=32 You could also use fsockopen and fwrite... Link to comment https://forums.phpfreaks.com/topic/116682-header-and-_post-question/#findComment-599937 Share on other sites More sharing options...
Lodius2000 Posted July 26, 2008 Share Posted July 26, 2008 i enable sessions and then i write $_POST['status'] = $_SESSION['status'] EDIT: dont know about security of that though, lemme know somebody if this is really bad Link to comment https://forums.phpfreaks.com/topic/116682-header-and-_post-question/#findComment-599938 Share on other sites More sharing options...
Third_Degree Posted July 26, 2008 Share Posted July 26, 2008 i enable sessions and then i write $_POST['status'] = $_SESSION['status'] EDIT: dont know about security of that though, lemme know somebody if this is really bad an interesting approach, unconventional, but not insecure. Link to comment https://forums.phpfreaks.com/topic/116682-header-and-_post-question/#findComment-599944 Share on other sites More sharing options...
TempleDMDKrazd Posted July 26, 2008 Author Share Posted July 26, 2008 i enable sessions and then i write $_POST['status'] = $_SESSION['status'] EDIT: dont know about security of that though, lemme know somebody if this is really bad an interesting approach, unconventional, but not insecure. i can't use $_SESSION because the person is logging out and I want to pass some variables to the receipt logout page, but I don't want to pass it in the URL. Link to comment https://forums.phpfreaks.com/topic/116682-header-and-_post-question/#findComment-599950 Share on other sites More sharing options...
Third_Degree Posted July 26, 2008 Share Posted July 26, 2008 Ok then, like i said, use a cURL or sockets to form a post request. Link to comment https://forums.phpfreaks.com/topic/116682-header-and-_post-question/#findComment-599951 Share on other sites More sharing options...
TempleDMDKrazd Posted July 26, 2008 Author Share Posted July 26, 2008 Ok then, like i said, use a cURL or sockets to form a post request. very interesting..thanks! Link to comment https://forums.phpfreaks.com/topic/116682-header-and-_post-question/#findComment-599955 Share on other sites More sharing options...
Lodius2000 Posted July 27, 2008 Share Posted July 27, 2008 not to drag this beast back up but if you are logging out, just unset() the loggedin session variables and write the rest of the post data to a new session variable Link to comment https://forums.phpfreaks.com/topic/116682-header-and-_post-question/#findComment-601123 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.