Page 1 of 1
php page direction problem.
Posted: Tue May 31, 2005 12:03 am
by darkstarskaterboy
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.
Posted: Tue May 31, 2005 12:15 am
by ol4pr0
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>
When clicking on that proceed button it will jump to house.php
Fetch it with $_POST or $_REQUEST
already used
Posted: Tue May 31, 2005 11:28 am
by darkstarskaterboy
the form action is already used. <form action=\"$PHP_SELF\">.
Posted: Tue May 31, 2005 12:24 pm
by JAM
The either change that or perhaps use
header()?
Posted: Tue May 31, 2005 12:42 pm
by ashi2005
You need to just type the HTML command Target as follows
<form action="house.php" method="post" TARGET = " _house.php">
<input type="textbox" name="usr" value="USR NAME"/><br />
<input type="password" name="pwd" value="URE PASS"/><br />
<input type"submit" name="login" value="Proceed"/>
</form>
Posted: Tue May 31, 2005 1:39 pm
by anjanesh
darkstarskaterboy
echo '<form action=".'$_SERVER['PHP_SELF'].'">';
though direct html should work
ashi2005 : TARGET is deprecated in all tags
Posted: Tue May 31, 2005 11:31 pm
by smo
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.
This will also help in page expired problem.
Header redirect
Posted: Tue May 31, 2005 11:37 pm
by darkstarskaterboy
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.
Posted: Tue May 31, 2005 11:38 pm
by Burrito
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'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...
you only want to use those AFTER you've submitted the form however and checked they are a valid user.
Re: Header redirect
Posted: Wed Jun 01, 2005 12:52 am
by smo
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.
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 .
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