Northern Flame Posted August 7, 2007 Share Posted August 7, 2007 I have a form that uses the method of $_GET, I only want certain variables to be used as $_GET and the rest as $_POST, how can i do this? I know that $_REQUEST works for both, but what I am trying to do is only display the email address and their action as a part of the URL when they hit "submit", how can i get the rest of the variables not to be displayed? Link to comment https://forums.phpfreaks.com/topic/63665-controlling-the-_get-variables/ Share on other sites More sharing options...
pyrodude Posted August 7, 2007 Share Posted August 7, 2007 The only way to do that is with two separate forms. However, a creative option would be to use 1 form, have it redirect to a session-enabled page that would assign the values of variables to be whatever they need to be, and then redirect using header() to www.yoursite.com/[email protected]&othervar=nothing This won't work, however, if you're trying to use get to make it easier for people to bookmark (as they won't have the session variables from the form) Link to comment https://forums.phpfreaks.com/topic/63665-controlling-the-_get-variables/#findComment-317286 Share on other sites More sharing options...
cooldude832 Posted August 7, 2007 Share Posted August 7, 2007 set the process page to include the given variables in the process part <form action="process.php?GET VARS HERE" might have to use javascript to get it just right more over why do you need this? Link to comment https://forums.phpfreaks.com/topic/63665-controlling-the-_get-variables/#findComment-317287 Share on other sites More sharing options...
Northern Flame Posted August 7, 2007 Author Share Posted August 7, 2007 alright ill give that a try thanks for the help Link to comment https://forums.phpfreaks.com/topic/63665-controlling-the-_get-variables/#findComment-317288 Share on other sites More sharing options...
Northern Flame Posted August 7, 2007 Author Share Posted August 7, 2007 it didnt work but its ok, it wasnt that big of a deal Link to comment https://forums.phpfreaks.com/topic/63665-controlling-the-_get-variables/#findComment-317289 Share on other sites More sharing options...
cooldude832 Posted August 7, 2007 Share Posted August 7, 2007 well of course it won't i f you say <form action="process.php?id=<?php echo $_GET['id'];?>" because that isn't set you have to build into your submit button a function with javascript to insert those values into the string (in js) that is the action part its more complicated than it sounds Link to comment https://forums.phpfreaks.com/topic/63665-controlling-the-_get-variables/#findComment-317292 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.