Nieuw lid |
|
De fout is dat hij altijd die cookies ziet ookal verwijder is ze ik blijf zien : "U bent ingelogd" dus met die isset zal iets fout zijn maar de vraag is wat ???
<?php
$Login = $_GET['submit'];
$User = $_POST['gebruiker'];
$Pass = $_POST['paswoord'];
if(isset($_COOKIE['EDuser']) && isset($_COOKIE['EDpassword'])){
echo"U bent ingelogd";
}else{
$host = "localhost";
$user = "***";
$pass = "***";
$dbas = "***";
if(mysql_connect($host, $user, $pass)) {
mysql_select_db($dbas) or die(mysql_error());
} else {
echo "Can't connect to the database!";
exit;
}
if($Login == "Inloggen"){
if ($User != "" && $Pass != "") {
$query = mysql_query("SELECT * FROM Members WHERE wachtwoord='$Pass' AND gebruikersnaam='$User'");
$results = mysql_num_rows($query);
if ($results == 1){
$login=mysql_query("SELECT * FROM Members WHERE wachtwoord='$Pass' AND gebruikersnaam='$User'");
$obj = mysql_fetch_object($login);
Setcookie("EDuser", $User, Time()+3600*24*7, "/");
Setcookie("EDpassword", $Pass, Time()+3600*24*7, "/");
echo '<script language="javascript">';
echo' document.location.href="http://www.winterslag.be/ed-tuning/Index.php?pagina=Home"';
echo '</script>';}
else {
echo '<script language="javascript">';
echo 'document.location.href="http://www.winterslag.be/Swismo/Index.php?pagina=Logincorrect"';
echo '</script>';}}
else {
echo '<script language="javascript">';
echo 'document.location.href="http://www.winterslag.be/Swismo/Index.php?pagina=Loginvelden"';
echo '</script>';}}
else {
echo"
<form method=\"POST\" action=\"http://www.winterslag.be/ed-tuning/Index.php?pagina=Home&submit=Inloggen\">
<input type=\"text\" name=\"gebruiker\" size=\"17\" style=\"font-size: 8 pt; font-family: Tahoma; color: #000000; background-color: #F4F7FC; border: 1 solid #CBC4FF\">
<input type=\"password\" name=\"paswoord\" size=\"17\" style=\"font-size: 8 pt; font-family: Tahoma; color: #000000; background-color: #F4F7FC; border: 1 solid #CBC4FF\">
<input type=\"submit\" value=\"Inloggen\" name=\"Inloggen\" style=\"color: #000000; background-color: #F4F7FC; font-family: Tahoma; font-size: 8 pt; border: 1 solid #CBC4FF\">
</form>";}}
?>
<?php $Login = $_GET['submit']; $User = $_POST['gebruiker']; $Pass = $_POST['paswoord']; if(isset($_COOKIE['EDuser']) && isset($_COOKIE['EDpassword'])){ }else{ $host = "localhost"; $user = "***"; $pass = "***"; $dbas = "***"; } else { echo "Can't connect to the database!"; } if($Login == "Inloggen"){ if ($User != "" && $Pass != "") { $query = mysql_query("SELECT * FROM Members WHERE wachtwoord='$Pass' AND gebruikersnaam='$User'"); if ($results == 1){ $login=mysql_query("SELECT * FROM Members WHERE wachtwoord='$Pass' AND gebruikersnaam='$User'"); echo '<script language="javascript">'; echo' document.location.href="http://www.winterslag.be/ed-tuning/Index.php?pagina=Home"'; else { echo '<script language="javascript">'; echo 'document.location.href="http://www.winterslag.be/Swismo/Index.php?pagina=Logincorrect"'; else { echo '<script language="javascript">'; echo 'document.location.href="http://www.winterslag.be/Swismo/Index.php?pagina=Loginvelden"'; else { <form method=\"POST\" action=\"http://www.winterslag.be/ed-tuning/Index.php?pagina=Home&submit=Inloggen\"> <input type=\"text\" name=\"gebruiker\" size=\"17\" style=\"font-size: 8 pt; font-family: Tahoma; color: #000000; background-color: #F4F7FC; border: 1 solid #CBC4FF\"> <input type=\"password\" name=\"paswoord\" size=\"17\" style=\"font-size: 8 pt; font-family: Tahoma; color: #000000; background-color: #F4F7FC; border: 1 solid #CBC4FF\"> <input type=\"submit\" value=\"Inloggen\" name=\"Inloggen\" style=\"color: #000000; background-color: #F4F7FC; font-family: Tahoma; font-size: 8 pt; border: 1 solid #CBC4FF\"> </form>";}} ?>
|