[PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread Esteban Fernández
When you recivied that error ?, in a form ?, if is in a Form just put in the
top of .php files this code

$HTTP_GET_VARS[variable2];
$HTTP_GET_VARS[variable3];

Of course if you send with other method (post) change the GET for POST

$HTTP_POS_VARS[variable2];
$HTTP_POS_VARS[variable3];

Regards.

Esteban.



ØYstein HåLand [EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
 None of my old scripts worx nowadays and the most common error message is
 'undefined variable'. What is the best/simplest way to work around this
 situation?
 if !isset($myvar) {
 do this
 blah blah
 }
 ?





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread Øystein Håland
I'm not sure what you mean. To give ONE example:
Earlier I could use this code on top of every page:
if  ($printout != yeah) { include(header.php); }
This code gives an error today. The variable $printout is set if the visitor
choose to click on the 'print_page_image', otherwise the variable has no
value.

Esteban FernáNdez [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
 When you recivied that error ?, in a form ?, if is in a Form just put in
the
 top of .php files this code

 $HTTP_GET_VARS[variable2];
 $HTTP_GET_VARS[variable3];

 Of course if you send with other method (post) change the GET for POST

 $HTTP_POS_VARS[variable2];
 $HTTP_POS_VARS[variable3];

 Regards.

 Esteban.



 ØYstein HåLand [EMAIL PROTECTED] escribió en el mensaje
 news:[EMAIL PROTECTED]
  None of my old scripts worx nowadays and the most common error message
is
  'undefined variable'. What is the best/simplest way to work around this
  situation?
  if !isset($myvar) {
  do this
  blah blah
  }
  ?
 
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread Jonathan Wilkes
Hi,

What he means is that with register_globals=off you cannot do this:

echo $path

you need to do this (if the variable is sent by POST action)

echo _POST('path')

and through GET

echo _GET('path')

-Original Message-
From: Øystein Håland [mailto:[EMAIL PROTECTED]
Sent: 03 June 2003 17:02
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Migration from register_globals=on to
register_globals=off


I'm not sure what you mean. To give ONE example:
Earlier I could use this code on top of every page:
if  ($printout != yeah) { include(header.php); }
This code gives an error today. The variable $printout is set if the visitor
choose to click on the 'print_page_image', otherwise the variable has no
value.

Esteban FernáNdez [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
 When you recivied that error ?, in a form ?, if is in a Form just put in
the
 top of .php files this code

 $HTTP_GET_VARS[variable2];
 $HTTP_GET_VARS[variable3];

 Of course if you send with other method (post) change the GET for POST

 $HTTP_POS_VARS[variable2];
 $HTTP_POS_VARS[variable3];

 Regards.

 Esteban.



 ØYstein HåLand [EMAIL PROTECTED] escribió en el mensaje
 news:[EMAIL PROTECTED]
  None of my old scripts worx nowadays and the most common error message
is
  'undefined variable'. What is the best/simplest way to work around this
  situation?
  if !isset($myvar) {
  do this
  blah blah
  }
  ?
 
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread Leif K-Brooks
Uh, I think you mean
echo $_POST['path'];
and
echo $_GET['path'];
Jonathan Wilkes wrote:

Hi,

What he means is that with register_globals=off you cannot do this:

	echo $path

you need to do this (if the variable is sent by POST action)

	echo _POST('path')

and through GET

	echo _GET('path')

-Original Message-
From: Xystein Heland [mailto:[EMAIL PROTECTED]
Sent: 03 June 2003 17:02
To: [EMAIL PROTECTED]
Subject: [PHP] Re: Migration from register_globals=on to
register_globals=off
I'm not sure what you mean. To give ONE example:
Earlier I could use this code on top of every page:
if  ($printout != yeah) { include(header.php); }
This code gives an error today. The variable $printout is set if the visitor
choose to click on the 'print_page_image', otherwise the variable has no
value.
Esteban FernaNdez [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
 

When you recivied that error ?, in a form ?, if is in a Form just put in
   

the
 

top of .php files this code

$HTTP_GET_VARS[variable2];
$HTTP_GET_VARS[variable3];
Of course if you send with other method (post) change the GET for POST

$HTTP_POS_VARS[variable2];
$HTTP_POS_VARS[variable3];
Regards.

Esteban.



XYstein HeLand [EMAIL PROTECTED] escribis en el mensaje
news:[EMAIL PROTECTED]
   

None of my old scripts worx nowadays and the most common error message
 

is
 

'undefined variable'. What is the best/simplest way to work around this
situation?
if !isset($myvar) {
do this
blah blah
}
?
 

   



 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread Leif K-Brooks
Uh, just putting those variables at the top of your page won't help 
you.  You need to do something with them.

Esteban Fernández wrote:

When you recivied that error ?, in a form ?, if is in a Form just put in the
top of .php files this code
$HTTP_GET_VARS[variable2];
$HTTP_GET_VARS[variable3];
Of course if you send with other method (post) change the GET for POST

$HTTP_POS_VARS[variable2];
$HTTP_POS_VARS[variable3];
Regards.

Esteban.



ØYstein HåLand [EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
 

None of my old scripts worx nowadays and the most common error message is
'undefined variable'. What is the best/simplest way to work around this
situation?
if !isset($myvar) {
do this
blah blah
}
?
   



 

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread Esteban Fernandez
Then i don't understand you problem.

ØYstein HåLand [EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
 I'm not sure what you mean. To give ONE example:
 Earlier I could use this code on top of every page:
 if  ($printout != yeah) { include(header.php); }
 This code gives an error today. The variable $printout is set if the
visitor
 choose to click on the 'print_page_image', otherwise the variable has no
 value.

 Esteban FernáNdez [EMAIL PROTECTED] skrev i meddelandet
 news:[EMAIL PROTECTED]
  When you recivied that error ?, in a form ?, if is in a Form just put in
 the
  top of .php files this code
 
  $HTTP_GET_VARS[variable2];
  $HTTP_GET_VARS[variable3];
 
  Of course if you send with other method (post) change the GET for POST
 
  $HTTP_POS_VARS[variable2];
  $HTTP_POS_VARS[variable3];
 
  Regards.
 
  Esteban.
 
 
 
  ØYstein HåLand [EMAIL PROTECTED] escribió en el mensaje
  news:[EMAIL PROTECTED]
   None of my old scripts worx nowadays and the most common error message
 is
   'undefined variable'. What is the best/simplest way to work around
this
   situation?
   if !isset($myvar) {
   do this
   blah blah
   }
   ?
  
  
 
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread Øystein Håland
I tried changing my code to (since the variable $printout in this case is
sent with GET)
($_GET['printout'] != yeah) { include(header.php); }
and got the following error:
Undefined index: printout



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread Wouter van Vliet
One little addit:

use indeed $_GET for vars passed through the query string and $_POST to read
out postdate .. $_COOKIE for cookies, but you'll find a combination of them
all in $_REQUEST

(nobody happens to know why $_SESSION is not included in that one .. or
knows one that includes $_SESSION in it..?)

Wouter


-Oorspronkelijk bericht-
Van: Øystein Håland [mailto:[EMAIL PROTECTED]
Verzonden: dinsdag 3 juni 2003 18:45
Aan: [EMAIL PROTECTED]
Onderwerp: [PHP] Re: Migration from register_globals=on to
register_globals=off


I tried changing my code to (since the variable $printout in this case is
sent with GET)
($_GET['printout'] != yeah) { include(header.php); }
and got the following error:
Undefined index: printout



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread R'twick Niceorgaw
on top of your script add
extract ($_POST);

or may be a little more checking to see if its actually a form submission by
POST method like

if ($_SERVER[REQUEST_METHOD] == 'POST')
extract($_POST);

same thing goes for GET
Then you can access all form variables just as you were accessing.

HTH
R'twick
ØYstein HåLand [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I'm not sure what you mean. To give ONE example:
 Earlier I could use this code on top of every page:
 if  ($printout != yeah) { include(header.php); }
 This code gives an error today. The variable $printout is set if the
visitor
 choose to click on the 'print_page_image', otherwise the variable has no
 value.

 Esteban FernáNdez [EMAIL PROTECTED] skrev i meddelandet
 news:[EMAIL PROTECTED]
  When you recivied that error ?, in a form ?, if is in a Form just put in
 the
  top of .php files this code
 
  $HTTP_GET_VARS[variable2];
  $HTTP_GET_VARS[variable3];
 
  Of course if you send with other method (post) change the GET for POST
 
  $HTTP_POS_VARS[variable2];
  $HTTP_POS_VARS[variable3];
 
  Regards.
 
  Esteban.
 
 
 
  ØYstein HåLand [EMAIL PROTECTED] escribió en el mensaje
  news:[EMAIL PROTECTED]
   None of my old scripts worx nowadays and the most common error message
 is
   'undefined variable'. What is the best/simplest way to work around
this
   situation?
   if !isset($myvar) {
   do this
   blah blah
   }
   ?
  
  
 
 





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread R'twick Niceorgaw
probably because $_SESSION is a server side thing not coming from the client
side in a Request ?

R'twick
- Original Message - 
From: Wouter van Vliet [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 03, 2003 12:48 PM
Subject: RE: [PHP] Re: Migration from register_globals=on to
register_globals=off


 One little addit:

 use indeed $_GET for vars passed through the query string and $_POST to
read
 out postdate .. $_COOKIE for cookies, but you'll find a combination of
them
 all in $_REQUEST

 (nobody happens to know why $_SESSION is not included in that one .. or
 knows one that includes $_SESSION in it..?)

 Wouter


 -Oorspronkelijk bericht-
 Van: Øystein Håland [mailto:[EMAIL PROTECTED]
 Verzonden: dinsdag 3 juni 2003 18:45
 Aan: [EMAIL PROTECTED]
 Onderwerp: [PHP] Re: Migration from register_globals=on to
 register_globals=off


 I tried changing my code to (since the variable $printout in this case is
 sent with GET)
 ($_GET['printout'] != yeah) { include(header.php); }
 and got the following error:
 Undefined index: printout



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread Wouter van Vliet
yeah .. I knew it .. but it would be so very helpfull if it would be just
included in a superglobal similar to $_REQUEST ...

-Oorspronkelijk bericht-
Van: R'twick Niceorgaw [mailto:[EMAIL PROTECTED]
Verzonden: dinsdag 3 juni 2003 19:01
Aan: [EMAIL PROTECTED]
Onderwerp: Re: [PHP] Re: Migration from register_globals=on to
register_globals=off


probably because $_SESSION is a server side thing not coming from the client
side in a Request ?

R'twick
- Original Message -
From: Wouter van Vliet [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Tuesday, June 03, 2003 12:48 PM
Subject: RE: [PHP] Re: Migration from register_globals=on to
register_globals=off


 One little addit:

 use indeed $_GET for vars passed through the query string and $_POST to
read
 out postdate .. $_COOKIE for cookies, but you'll find a combination of
them
 all in $_REQUEST

 (nobody happens to know why $_SESSION is not included in that one .. or
 knows one that includes $_SESSION in it..?)

 Wouter


 -Oorspronkelijk bericht-
 Van: Øystein Håland [mailto:[EMAIL PROTECTED]
 Verzonden: dinsdag 3 juni 2003 18:45
 Aan: [EMAIL PROTECTED]
 Onderwerp: [PHP] Re: Migration from register_globals=on to
 register_globals=off


 I tried changing my code to (since the variable $printout in this case is
 sent with GET)
 ($_GET['printout'] != yeah) { include(header.php); }
 and got the following error:
 Undefined index: printout



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread CPT John W. Holmes
 yeah .. I knew it .. but it would be so very helpfull if it would be just
 included in a superglobal similar to $_REQUEST ...

Do it yourself, if you must: array_merge()

---John Holmes...

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Re: Migration from register_globals=on to register_globals=off

2003-06-04 Thread Monty
If you're getting errors for undefined variables, you can reduce the level
of error reporting in PHP.ini so it only does so for more serious errors. I
had a similar problem and this cleared things up. See the PHP manual...

http://www.php.net/manual/en/ref.errorfunc.php#ini.error-reporting

Also, I don't recommend using the extract($_POST) command as a way around
register_globals being off, it kind of defeats the purpose. Better to grab
only those variables you need like this:

$formvals = $_POST['my_formvals'];

I put all form values into an array so I only have to grab one POST
variable. It makes it a little easier. Also be sure to clean the data with
some kind of function that uses strip_tags() and similar functions.

Monty 
 

 From: [EMAIL PROTECTED] (ØYstein HåLand)
 Newsgroups: php.general
 Date: Tue, 3 Jun 2003 18:44:30 +0200
 To: [EMAIL PROTECTED]
 Subject: Re: Migration from register_globals=on to register_globals=off
 
 I tried changing my code to (since the variable $printout in this case is
 sent with GET)
 ($_GET['printout'] != yeah) { include(header.php); }
 and got the following error:
 Undefined index: printout
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php