need ur help :o

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

need ur help :o

Post 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
User avatar
Derfel Cadarn
Forum Contributor
Posts: 193
Joined: Thu Jul 17, 2003 12:02 pm
Location: Berlin, Germany

Post 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>';
}

?>
Post Reply