Hello Friends !
Need some of PHP.
I am working on a website that provides free email facility. what i have to do is that I have only one button for Sign In and Sign Out.When one one is Signed In it will show Sign In on it and when the user is Signed In means that the session is being started then it will show Sign Out on thebutton.
Can any one hepl me.
Regards.
Abdul Mannan
itsmani1@hotmail.com
need ur help :o
Moderator: General Moderators
- Derfel Cadarn
- Forum Contributor
- Posts: 193
- Joined: Thu Jul 17, 2003 12:02 pm
- Location: Berlin, Germany
How about this?
Code: Select all
<?php
if(!$_POST['status'] || $_POST['status'] == "out") { //
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
echo '<INPUT TYPE="hidden" NAME="status" VALUE="in">';
echo '<input type="submit" value="Sign in">';
echo '</form>';
} elseif ($_POST['status'] == "in") {
echo '<form action="'.$_SERVER['PHP_SELF'].'" method="POST">';
echo '<INPUT TYPE="hidden" NAME="status" VALUE="out">';
echo '<input type="submit" value="Sign out">';
echo '</form>';
}
?>