1
糾正登錄後這個簡單的PHP腳本後重定向頁面,配置超鏈接http://www.mysite.it頁 我如何可以改變腳本,以便如果登錄是正確的,你直接打開鏈接http://www.mysite.it的登錄在PHP
<?php
session_start();
$username = $_POST['username'];
$password = $_POST['pw'];
if($username == "" or $password == ""){
echo "Non puoi accedere senza Username o password";
}else if($username == "" and $password == ""){
echo "Non puoi accedere senza Username e password";
}else{
// configure your username and password
if($username == "test" AND $password == "test"){
echo "Benvenuto $username";
echo "<a href='http://www.mysite.it'>Vai alla pagina</a>";
}else{
echo "Accesso negato, questo username non esiste";
}
}
function loggeduser($username){
}
?>
你需要使用頭重定向和它的解釋很好這裏http://stackoverflow.com/questions/768431/how-to-make-a-redirect-in-php – Achayan