[PHP] need help w/ variables
when i use this script: ?php session_start(); if ($op == ds) { if (($username != admin) ||($password != admin)) { $msg = pfont color=\#FF\strongBad 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 = h1Login/h1 form method=post action=\$PHP_SELF\$msg p strongLogin Name:/strong br input type=\text\ name=\username\ size =15 maxlength=25 /p p strongPassword:/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 = h1Contact Administration System/h1 p strongAdministration/strong ul lia href=\add_contact.php\Add Contact/a lia href=\mod_contact.php\Modify Contact/a lia href=\del_contact.php\Delete Contact/a /ul p strongView Records/strong ul lia 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\.php on line 3 Warning: Undefined variable: valid in c:\inetpub\wwwroot\.php on line 13 Warning: Undefined variable: msg in c:\inetpub\wwwroot\.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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] need help w/ variables
add to the top of the script error_reporting(E_ALL ~E_NOTICE); - Original Message - From: Virgil Claritt [EMAIL PROTECTED] To: [EMAIL PROTECTED] 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 = pfont color=\#FF\strongBad 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 = h1Login/h1 form method=post action=\$PHP_SELF\$msg p strongLogin Name:/strong br input type=\text\ name=\username\ size =15 maxlength=25 /p p strongPassword:/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 = h1Contact Administration System/h1 p strongAdministration/strong ul lia href=\add_contact.php\Add Contact/a lia href=\mod_contact.php\Modify Contact/a lia href=\del_contact.php\Delete Contact/a /ul p strongView Records/strong ul lia 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\.php on line 3 Warning: Undefined variable: valid in c:\inetpub\wwwroot\.php on line 13 Warning: Undefined variable: msg in c:\inetpub\wwwroot\.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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] need help w/ variables
i dont quite get it what your saying it is clearly defined at the top $op is equal to ds $valid is equal to yes $msg is equal to Bad Login Reductor [EMAIL PROTECTED] wrote in message 002701c11335$ac5dafe0$0200a8c0@ReDucTor">news:002701c11335$ac5dafe0$0200a8c0@ReDucTor... add to the top of the script error_reporting(E_ALL ~E_NOTICE); - Original Message - From: Virgil Claritt [EMAIL PROTECTED] To: [EMAIL PROTECTED] 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 = pfont color=\#FF\strongBad 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 = h1Login/h1 form method=post action=\$PHP_SELF\$msg p strongLogin Name:/strong br input type=\text\ name=\username\ size =15 maxlength=25 /p p strongPassword:/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 = h1Contact Administration System/h1 p strongAdministration/strong ul lia href=\add_contact.php\Add Contact/a lia href=\mod_contact.php\Modify Contact/a lia href=\del_contact.php\Delete Contact/a /ul p strongView Records/strong ul lia 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\.php on line 3 Warning: Undefined variable: valid in c:\inetpub\wwwroot\.php on line 13 Warning: Undefined variable: msg in c:\inetpub\wwwroot\.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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] need help w/ variables
did u try what i said??? - Original Message - From: Virgil Claritt [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, July 23, 2001 3:13 PM Subject: Re: [PHP] need help w/ variables i dont quite get it what your saying it is clearly defined at the top $op is equal to ds $valid is equal to yes $msg is equal to Bad Login Reductor [EMAIL PROTECTED] wrote in message 002701c11335$ac5dafe0$0200a8c0@ReDucTor">news:002701c11335$ac5dafe0$0200a8c0@ReDucTor... add to the top of the script error_reporting(E_ALL ~E_NOTICE); - Original Message - From: Virgil Claritt [EMAIL PROTECTED] To: [EMAIL PROTECTED] 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 = pfont color=\#FF\strongBad 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 = h1Login/h1 form method=post action=\$PHP_SELF\$msg p strongLogin Name:/strong br input type=\text\ name=\username\ size =15 maxlength=25 /p p strongPassword:/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 = h1Contact Administration System/h1 p strongAdministration/strong ul lia href=\add_contact.php\Add Contact/a lia href=\mod_contact.php\Modify Contact/a lia href=\del_contact.php\Delete Contact/a /ul p strongView Records/strong ul lia 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\.php on line 3 Warning: Undefined variable: valid in c:\inetpub\wwwroot\.php on line 13 Warning: Undefined variable: msg in c:\inetpub\wwwroot\.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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] need help w/ variables
On Mon, 23 Jul 2001, Virgil Claritt wrote: i dont quite get it what your saying it is clearly defined at the top $op is equal to ds $valid is equal to yes $msg is equal to Bad Login Reductor [EMAIL PROTECTED] wrote in message 002701c11335$ac5dafe0$0200a8c0@ReDucTor">news:002701c11335$ac5dafe0$0200a8c0@ReDucTor... add to the top of the script error_reporting(E_ALL ~E_NOTICE); - Original Message - From: Virgil Claritt [EMAIL PROTECTED] To: [EMAIL PROTECTED] 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) { == means is equal?: if(1 == 1){ echo true; } = sets a value: $a = 1; He is suggesting to lower your error reporting so undeclaired variable sdo not produce errors. Another solution is to not call variables that have no value, or use isset() to check. -- --- destiney - (des-ti-ny) - n. 1. deity of all things html, 2. common internet addict, 3. lover of late 80's heavy metal music, 4. Activist for the terminally un-elite; see also - cool guy, des, mr. php... It's 4:00am, your web site is still up, why are you? http://destiney.com/ --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]