Jump to content

Controlling The $_GET Variables


Northern Flame

Recommended Posts

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

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)

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.