Re: file organization question
| From: | O. | Date: | Fri, 21 Jul 2000 15:42:21 +0000 |
| Subject: | Re: file organization question | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1403@lists.php.net to get a copy of this message | ||
"Rusty Wright" <rusty@socrates.Berkeley.EDU> wrote in message
news:200007210003.RAA03516@socrates.Berkeley.EDU...
> I'm trying to figure out the best way to organize my html and php
> files; no doubt others have already addressed these issues. If there
> is a web page that explains this feel free to post the url.
<snip>
> At the moment I'm working on the login page and the new user page.
> The new user page is an html file with a form that has fields for
> their name, address, phone numbers, email address and password. Their
> email address will be their login id.
>
<snip>
> The output0.php file does all the "usual" stuff; checks to see if the
> email address is not empty, same with the password, connects to mysql
> and fetches the password, compares the password with the stored
> password, etc. etc.
Use a redirect.
Header("Location: nextpage.html");
Header() has some restrictions that are documented in the manual. The most
important of these is that you cannot output anything (to the browser) prior
to the header() command. So, if the login was successful, redirect the user
appropriately. If the login was not successful, redirect the user to some
error page.
One thing I do is include a login processor in all my pages, so each page
can (conceivably) process a login and the same page loads up. See
www.slashdot.org (I did *not* write that, that's just an example of how it's
done, and incidentally, where I got the idea). That way, the URL is never
ugly, and it doesn't break things as much ...
--
O.