I have various .php documents, mostly handles for sessions.
Is there a way to combine a "login html page" with the php that actually "logs" them in?
Example...
login.php
// Has the actual inputs and submit button for the user logging in, the HTML side of it. Possibly setting the "action" to itself?
// Then has the PHP part, where it checks, sets sessions, etc.
I don't want a million .php documents all linking together, seems like quite messy code.
Also; I see many sites have a thing as such..
[Main banner here]
LOGIN: ---- PASSWORD: ---
[content]
then if they submit the wrong password, the webpage "reloads" as such..
[main banner here]
LOGIN: ---- PASSWORD: --- LOGIN INCORECT
[content]
How do they add messages to the page, without redirecting the user to a new unique page?
[EDIT: I was having problems posting before, so I just posted it to my blog also; but feel FREE to reply here!]
ID:277623
Aug 28 2007, 2:46 pm (Edited on Aug 28 2007, 3:53 pm)
|
|
Aug 28 2007, 3:42 pm
|
|
I have not done PHP scripting in a while but can't you have it POST to itself (POST is not sarcasm, it is the method IIRC)? That would lessen the amount of files you need and probably wouldn't be too complicated.
|
In response to Shlaklava
|
|
do you GET what he is saying (This is just a snarky comment relating to the method GET and not intentionally helpful in anyway)
|
POST it to that original page and then use if($_POST['SubmitButtonName']) Then, in there, check to make sure that your POSTS actually stored information, and if it didn't, set a $error to your error message and output that at the form you return to. (Sorry for bringing back an oldish post, and I'm sure you mighta fixed it already, but yeah.)
|