[PHP] OK guys, thank you so far

2003-06-04 Thread Øystein Håland
Now my code is

extract ($_GET);
if ($_GET['printout'] != yeah) { include(header.php); }

but I still get the following error:

Undefined index: printout

I understand nothing

Jonathan Wilkes [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
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



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



RE: [PHP] OK guys, thank you so far

2003-06-04 Thread Edward Peloke
can you try if ($HTTP_GET_VARS['printout']!=yeah) {include(header.php);}

does that work?

-Original Message-
From: Øystein Håland [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 03, 2003 1:17 PM
To: [EMAIL PROTECTED]
Subject: [PHP] OK guys, thank you so far


Now my code is

extract ($_GET);
if ($_GET['printout'] != yeah) { include(header.php); }

but I still get the following error:

Undefined index: printout

I understand nothing

Jonathan Wilkes [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
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



--
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] OK guys, thank you so far

2003-06-04 Thread Wendell Brown
On Tue, 3 Jun 2003 19:16:30 +0200, +ystein H†land wrote:

Now my code is

extract ($_GET);
if ($_GET['printout'] != yeah) { include(header.php); }

but I still get the following error:

Undefined index: printout

I understand nothing

Ok, it looks like you are mixing your metaphors ;)

If you use extract( $_GET ); -- you should have a $printout variable
available (assuming you aren't doing a POST form and you are on a
version of PHP that supports $_GET).  At least two of the following
should work...

--- Option 1 --- GET method - New PHP
 
extract($_GET);
if ($printout != yeah) { include(header.php); }

--- Option 2 --- POST method - New PHP 

extract($_POST);
if ($printout != yeah) { include(header.php); }

--- Option 3 --- GET method - Older PHP

extract($HTTP_GET_VARS);
if ($printout != yeah) { include(header.php); }

--- Option 4 --- POST method - Older PHP

extract($HTTP_POST_VARS);
if ($printout != yeah) { include(header.php); }

--- Option 5 --- GET method - new php - No extract

if ( $_GET[ 'printout' ] != yeah) { include(header.php); }

--- Option 6 --- POST method - new php - No extract

if ( $_POST[ 'printout' ] != yeah) { include(header.php); }

--- Option 7 --- GET method - older php - No extract

if ( $HTTP_GET_VARS[ 'printout' ] != yeah) { include(header.php); }

--- Option 8 --- POST method - older php - No extract

if ( $HTTP_POST_VARS[ 'printout' ] != yeah) { include(header.php);
}

 End ---




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



Re: [PHP] OK guys, thank you so far

2003-06-04 Thread Øystein Håland
I've tried and here's the output:
Undefined index: input

if ($HTTP_GET_VARS['printout'] != yeah) { include(header.php); }

Edward Peloke [EMAIL PROTECTED] skrev i meddelandet
news:[EMAIL PROTECTED]
 can you try if ($HTTP_GET_VARS['printout']!=yeah)
{include(header.php);}

 does that work?

 -Original Message-
 From: Øystein Håland [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, June 03, 2003 1:17 PM
 To: [EMAIL PROTECTED]
 Subject: [PHP] OK guys, thank you so far


 Now my code is

 extract ($_GET);
 if ($_GET['printout'] != yeah) { include(header.php); }

 but I still get the following error:

 Undefined index: printout

 I understand nothing

 Jonathan Wilkes [EMAIL PROTECTED] skrev i meddelandet
 news:[EMAIL PROTECTED]
 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



 --
 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] OK guys, thank you so far

2003-06-04 Thread David Nicholson
Hello,

This is a reply to an e-mail that you wrote on Tue, 3 Jun 2003 at 20:04,
lines prefixed by '' were originally written by you.
 I've tried and here's the output:
 Undefined index: input
 if ($HTTP_GET_VARS['printout'] != yeah) { include(header.php); }

You have error reporting set to E_ALL, turn it down a bit.

More information at:
http://uk2.php.net/error_reporting

David.

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



Re: [PHP] OK guys, thank you so far

2003-06-04 Thread Lars Torben Wilson
On Tue, 2003-06-03 at 13:20, David Nicholson wrote:
 Hello,
 
 This is a reply to an e-mail that you wrote on Tue, 3 Jun 2003 at 20:04,
 lines prefixed by '' were originally written by you.
  I've tried and here's the output:
  Undefined index: input
  if ($HTTP_GET_VARS['printout'] != yeah) { include(header.php); }
 
 You have error reporting set to E_ALL, turn it down a bit.
 
 More information at:
 http://uk2.php.net/error_reporting
 
 David.

This is a good idea for a production machine, but for your development
environment, turning down error reporting is not a good idea. :) You 
will kill yourself trying to track down subtle errors when they aren't
displayed.

Try checking your variables before using them:

 if (isset($_GET['printout'])  $_GET['printout'] != 'yeah') { 
// . . .
 }



Torben


-- 
 Torben Wilson [EMAIL PROTECTED]+1.604.709.0506
 http://www.thebuttlesschaps.com  http://www.inflatableeye.com
 http://www.hybrid17.com  http://www.themainonmain.com
 - Boycott Starbucks!  http://www.haidabuckscafe.com -




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