|
Posted by J.O. Aho on 11/11/06 10:24
affiliateian@gmail.com wrote:
> Ooops, spoke too soon. The if statement works but now other varibles
> variables are not registering in MySQL once Global Register is turned
> off. In the VALUES line after INSERT, what should go in here?
>
> VALUES ('$name', '$email')
>
You have to do that with all the variable that has been passed from the form
to the script
$name=$_REQUEST['name'];
and so on...
Or if you aren't that concerned that someone would try to overwrite your
internal variables, you could just add the following code to the top of your
scripts
if(!get_cfg_var("register_globals")) {
if (!empty($_GET)) {
extract($_GET);
} else if (!empty($HTTP_GET_VARS)) {
extract($HTTP_GET_VARS);
}
if (!empty($_POST)) {
extract($_POST);
} else if (!empty($HTTP_POST_VARS)) {
extract($HTTP_POST_VARS);
}
if (!empty($_COOKIE)) {
extract($_COOKIE);
} else if (!empty($HTTP_COOKIE_VARS)) {
extract($HTTP_COOKIE_VARS);
}
}
What it does it translating all $_GET/$_POST/$_COOKIE to standard variables as
$name and $email.
//Aho
[Back to original message]
|