About your comment, i have the register_globals=on.
I have 2 questions:
1.- What's the relation to have register_globals=off with this notice message?
2.- I read the security comment about register_globals=on in the php.ini, but i set to on because if i set to off, i can't pass GET variables to other page. how can you pass GET variables to other page without setting register_globals=on?
From: Ernest E Vogelsinger <[EMAIL PROTECTED]>
To: "R B" <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED],[EMAIL PROTECTED]
Subject: Re: [PHP] Other Notice problem...
Date: Fri, 08 Nov 2002 17:14:30 +0100
At 17:04 08.11.2002, R B spoke out and said:
--------------------[snip]--------------------
>I'm going to explain how my script work.
>I have an php page (addProduct.php) with an input form. I have 2 buttons
>(add and cancel) and a hidden control with name=status. If i press the add
>button, the page submit the form data to the same page (<form
>action="addProduct.php">) with status hidden control name set to ADD, so the
>if statement its true only if i press the add button.
>I see the message when i call the page to add the data not when i submit the
>data.
--------------------[snip]--------------------
Ahhh.... your $status variable should be a form variable? Well, as pointed
out many times the last days, register_globals is OFF by default since PHP
v.4.something. Either turn register_globals on in your PHP.ini (bad and
deprecated, read the security bulletins), or you refer to the _POST array:
if ($_POST['status'] == "ADD")
if the data is not set (the status control empty), you'll still get a
notice about an undefined array index, so you might
if (array_key_exists('status', $_POST)) {
switch ($_POST['status']) {
case 'ADD':
break;
default:
echo 'Unsupported status!';
}
}
else echo 'No status sent!';
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
_________________________________________________________________ MSN. Más Útil Cada Día http://www.msn.es/intmap/
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php