Page 1 of 1

need ur help :o

Posted: Wed Oct 01, 2003 10:52 am
by itsmani1
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

Posted: Wed Oct 01, 2003 11:52 am
by Derfel Cadarn
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>';
}

?>