RE: [PHP] Re: HTTP header question.

From: Date: Mon, 30 Jul 2001 13:00:16 +0000
Subject: RE: [PHP] Re: HTTP header question.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-60200@lists.php.net to get a copy of this message
still don't see the need to pass as a header... <?PHP $success=0; $failure_notice=''; if($login){ # lets say we are checking against database for valid user #connect to db #do your query #get result in $valid_login, $valid_pass if($login==$valid_login & $passwd=$valid_pass) { $success=1 }else{ $failure_notice='FAILED'; } }else{ # nothing - not loggin in } if($success=1){ #correct login, proceed to page header("wherever.php"); #make sure no output to screen }else{ #login failed, we have to reprint the login with the failure notice echo $failure_notice; #willshow failed if login failed and nothing if first display of screen echo '<form...> <input... name=login value='.$login.'>'; #will display login so user doesnt' have to retype } ?> you avoid the http://his.website.com/rams/login.php?failure=true as you just get login.php each time as far as the displayed URL. my opinion, let the scripting handle all the logic and ease off the header functions. >-----Original Message----- >From: Matt Rogers [mailto:webdesign@desertstars.com] >Sent: Sunday, July 29, 2001 11:00 PM >To: php-general@lists.php.net >Subject: [PHP] Re: HTTP header question. > > >I don't know how to solve your problem, but I do know what you are talking >about.. People just aren't understanding. > >All he wants is if you go to "login.php" in your browser, the Location will >show: > >http://his.website.com/rams/login.php > >Okay? Got it? NOW....... If you attempt to log in and give the form an >INCORRECT login, he wants to SOMEHOW (and currently trying by headers) wants >the location to show this: > >http://his.website.com/rams/login.php > >AND NOT: > >http://his.website.com/rams/login.php?failure=true > >Is that hard to understand? >I hope I have helped to some degree. >-- >----------------------- >-- M&D Creations >- Matt Rogers >- Web Design Dept. >- webdesign@desertstars.com >"Ben Bleything" <bleythib@ucs.orst.edu> wrote in message >news:000001c11891$447271c0$0201a8c0@allegro... >> Hey all, >> >> I want to craft a header such that it seems to the page that data has >> been POST'ed to it... Here's the situation: I'm writing a login page to >> my application, and if they log in incorrectly, I want the page to >> redisplay, but I want it to throw out an error message. I'm currently >> doing it by >> >> header("Location: login.php?failure=true"); >> >> but I'd like to make it transparent. Any ideas? >> >> Thanks, >> Ben >> > > > >-- >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 (#60200) next »