Re: setting request variables

From: Date: Thu, 04 Mar 2004 00:24:35 +0000
Subject: Re: setting request variables
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-179394@lists.php.net to get a copy of this message
Hi, Thursday, March 4, 2004, 9:08:19 AM, you wrote: mo> Hi, mo> I have created a small login system for my website. However mo> if a user logs in incorrectly I want to display a error message mo> currently I use the code mo> echo "You could not be logged in! Either the username and mo> password do not match or you have not validated your membership! mo> <br /> mo> Please try again! <br />"; mo> include ("login.php"); mo> However this appears at the top of my website but I want it mo> to appear above the login form so I though I could set a variable mo> in the request called "error" or similar then on the login page mo> just above the login form check for the presence of the request mo> variable "error" and print the appropriate message. So I want to mo> do the following: mo> SET REQUEST VARIABLE ERROR HERE mo> include ("login.php"); mo> But can I set a request variable? i.e in JAVA I would do mo> HttpRequest.setAttribute("error", true); etc.. mo> Any help? mo> Cheers add something like this to login.php if(!empty($error)){ echo '<tr><td>'.$error.'</td></tr>'; } as it is included it will have $error available to it -- regards, Tom

« previous php.general (#179394) next »