default value of a variable

From: Date: Thu, 22 Aug 2002 15:37:06 +0000
Subject: default value of a variable
Groups: php.general 
Request: Send a blank email to php-general+get-113636@lists.php.net to get a copy of this message
Hey everyone... I'm fairly new to PHP, and this is my first post to the list. I've been developing on the web for about 6 years now with other languages, but need some help getting started with this one. 1) This isn't working unless the form is submitted... if (!isset($HTTP_POST_VARS['step'])) { $step=$HTTP_POST_VARS['step']; } I get the error: Notice: Undefined index I need to set Step=1 as default, but set Step=x when form is posted, where x is a value from the submitted form. This to control whether or not to show certain parts of the page. 2) Is there an easier/alternate way to default the value of a variable if it's not already set? Thanks in advance, Peter - - - - - - - - - - - - - - - - - - - - - Fourth Realm Solutions pbechard@fourthrealm.com http://www.fourthrealm.com Tel: 519-739-1652 - - - - - - - - - - - - - - - - - - - - -

« previous php.general (#113636) next »