php page direction problem.
Moderator: General Moderators
-
darkstarskaterboy
- Forum Newbie
- Posts: 5
- Joined: Tue May 31, 2005 12:00 am
- Location: Pa
php page direction problem.
I have a login page that i use and it is in php and i can't figure out how to make the page go to the house.php page when you click login. I was wondering if anyone would be able to help me out.
Code: Select all
<form action="e;house.php"e; method="e;post"e;>
<input type="e;textbox"e; name="e;usr"e; value="e;USR NAME"e;/><br />
<input type="e;password"e; name="e;pwd"e; value="e;URE PASS"e;/><br />
<input type"e;submit"e; name="e;login"e; value="e;Proceed"e;/>
</form>Fetch it with $_POST or $_REQUEST
-
darkstarskaterboy
- Forum Newbie
- Posts: 5
- Joined: Tue May 31, 2005 12:00 am
- Location: Pa
already used
the form action is already used. <form action=\"$PHP_SELF\">.
The either change that or perhaps use header()?
-
darkstarskaterboy
- Forum Newbie
- Posts: 5
- Joined: Tue May 31, 2005 12:00 am
- Location: Pa
Header redirect
I think that was what i was trying to do. My index page contained the frame info for the rest of my site while i have index being a php file with the 'include login.php', that is what i was trying to do, but it didn't work for me.
you're probably going to want to submit the form as ol4 suggested, then if the credentials check out ok against the db or wherever you're storing your user info, use header() to relocate them, or JS or a meta tag...smo wrote:Using header redirect is better here. The form can be submitted to check the login status, if successful then redirect to a welcome page or house page. Otherwise send to re-login page with error message.
you only want to use those AFTER you've submitted the form however and checked they are a valid user.
Re: Header redirect
Here since you are including the login.php file, inside that login.php file with a if condition check the session exists or not ( to know the member is logged in or not ). If not existed then show the login window ( login form) and if exists then give a welcome message with a logout button. Like "Welcome john" | Logout .darkstarskaterboy wrote:I think that was what i was trying to do. My index page contained the frame info for the rest of my site while i have index being a php file with the 'include login.php', that is what i was trying to do, but it didn't work for me.
If some one is not logged in then with the entry of id and password, on submit, take them to one page where you can check the id and password and if found correct then start the session and redirect the browser to home page. Now as the session is logged in so the member will get welcome message with a logout link.
http://www.plus2net.com/php_tutorial/ph ... logout.php