Permalink
Browse files

Merge pull request #1 from FranciscoP/patch-1

Update example1.php
  • Loading branch information...
HumanWorks committed Jul 22, 2013
2 parents 073a2e7 + 02e94e2 commit 1d034e38ebe2c9bbe204ee18c0ce7fc70cc3f74f
Showing with 13 additions and 10 deletions.
  1. +13 −10 example1.php
View
@@ -17,17 +17,20 @@
//user is now loaded
header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
}
}
echo '<h1>Login</h1>
<p><form method="post" action="'.$_SERVER['PHP_SELF'].'" />
username: <input type="text" name="uname" /><br /><br />
password: <input type="password" name="pwd" /><br /><br />
Remember me? <input type="checkbox" name="remember" value="1" /><br /><br />
<input type="submit" value="login" />
} ?>
<h1>Login</h1>
<p><form method="post" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>" />
username: <input type="text" name="uname" /><br /><br />
password: <input type="password" name="pwd" /><br /><br />
Remember me? <input type="checkbox" name="remember" value="1" /><br /><br />
<input type="submit" value="login" />
</form>
</p>';
</p>
<?php
}else{
//User is loaded
echo '<a href="'.$_SERVER['PHP_SELF'].'?logout=1">logout</a>';
?>
<a href="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>'?logout=1">logout</a>
<?php
}
?>
?>

0 comments on commit 1d034e3

Please sign in to comment.