php重定向到其他文件夹

时间:2015-06-11 10:53:44

标签: php redirect

我正试图用html / php为学校做一个网上商店。我想在登录到另一个文件夹中的页面后重定向。 当您登录时,您将被重定向到:249471.fiorettileerling.nl/po3/client/249471.fiorettileerling.nl/po3/home.php 虽然它应该重定向到:249471.fiorettileerling.nl/po3/home.php 我该如何解决?我是html和php的新手,所以我可能需要对基础知识进行一些解释......

<html>
<head>
<title>Categorie</title>
</head>
<body>
<form action="clientlogin.php" method="post">
Vul je gebruikersnaam in:<br />
<input type="text" name="gabrnaam" /><br />
<br/>
<input type="text" name="wachtwoord" /><br />
<input type="submit" value="Verzend" />
</form>

<?php
$username=1;
$password=1;
if(isset($_POST["gabrnaam"]))
{
    if(isset($_POST["wachtwoord"]))
    {
    $username= $_POST["gabrnaam"];
    $password= $_POST["wachtwoord"];
    $mysql = mysql_connect("localhost","250252","250252myadmin")
    or die("Fout: Er is geen verbinding met de MySQL-server tot  stand gebracht!");
    mysql_select_db("250252",$mysql)
    or die("Fout: Het openen van de database is mislukt!");
    $resultaat = mysql_query("SELECT nickname, wachtwoord FROM klantgegevens WHERE nickname = '$username' and wachtwoord='$password'",$mysql)
    or die("De query op de database is mislukt!");
    mysql_close($mysql)
    or die("Het verbreken van de verbinding met de MySQL-server is mislukt!");
    while(list($nickname,$wachtwoord)=mysql_fetch_row($resultaat))
    {
    header("Location: 249471.fiorettileerling.nl/po3/home.php");
    }
}
else
{
    echo "U heeft uw wachtwoord niet ingevuld";
}
}
else
{
    echo "u heeft uw gebruikersnaam niet ingevuld";
}
?>

</body>
</html>

1 个答案:

答案 0 :(得分:0)

header('Location: http://249471.fiorettileerling.nl/po3/home.php');

header('Location:home.php');

这样做就添加home.php