Re: need help w/ variables

From: Date: Mon, 23 Jul 2001 05:09:29 +0000
Subject: Re: need help w/ variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-59124@lists.php.net to get a copy of this message
add to the top of the script error_reporting(E_ALL & ~E_NOTICE); ----- Original Message ----- From: Virgil Claritt <vclaritt@mediaone.net> To: <php-general@lists.php.net> Sent: Monday, July 23, 2001 2:57 PM Subject: [PHP] need help w/ variables > when i use this script: > > <?php > session_start(); > if ($op == "ds") { > if (($username != "admin") ||($password != "admin")) { > $msg = "<p><font color=\"#FF0000\"><strong>Bad > Login - Try > Again></strong></font></p>"; > $show_form = "yes"; > } else { > session_register('valid'); > $valid = "yes"; > $show_menu = "yes"; > } > } else { > if ($valid == "yes") { > $show_menu = "yes"; > } else { > $show_form = "yes"; > } > } > > $form_block = " > <h1>Login</h1> > <form method=post action=\"$PHP_SELF\">$msg > <p> > <strong>Login Name:</strong> > <br> > <input type=\"text\" name=\"username\" size =15 maxlength=25> > </p> > <p> > <strong>Password:</strong> > <br> > <input type=\"password\" name=\"password\" size=15 maxlength=25> > </p> > <input type=\"hidden\" name=\"op\" value=\"ds\"> > <br> > <p> > <input type=\"submit\" name=\"submit\" value=\"Login\"> > </p> > </form> > "; > > $menu_block = " > <h1>Contact Administration System</h1> > <p> > <strong>Administration</strong> > <ul> > <li><a href=\"add_contact.php\">Add Contact</a> > <li><a href=\"mod_contact.php\">Modify Contact</a> > <li><a href=\"del_contact.php\">Delete Contact</a> > </ul> > <p> > <strong>View Records</strong> > <ul> > <li><a href=\"show_contacts.php\">Show Contacts</a> > </ul> > "; > if ($show_form == "yes") { > $display_block = $form_block; > } else if ($show_menu == "yes") { > $display_block = $menu_block; > } > ?> > > <html> > <head> > <title.My contact Management System</title> > </head> > <body> > <p> > <? echo "$display_block"; ?> > </p> > </body> > </html> > > > i would get this error: > > Warning: Undefined variable: op in c:\inetpub\wwwroot\xxxx.php on line 3 > > Warning: Undefined variable: valid in c:\inetpub\wwwroot\xxxx.php on line 13 > > Warning: Undefined variable: msg in c:\inetpub\wwwroot\xxxx.php on line 23 > > my variables are clearly defined in the script > please help this is happening in all my scripts > > win2000 iis 5 > most recent php4 and mysql installed > phpinfo.php = http://24.165.118.187/phpinfo.php > > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#59124) next »