Omleidingslus

Gestart doorDylan14 reacties34 weergaven

15 berichten · pagina 1 van 1

Dylan

Lid · Topicstarter

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR] 

 [COLOR= #FF8000]// Connects to your Database [/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
 
 [COLOR= #FF8000]//checks cookies to make sure they are logged in [/COLOR]

 [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ID_my_site[/COLOR][COLOR= #007700]])) 

 {[/COLOR] 

     [COLOR= #0000BB]$username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ID_my_site[/COLOR][COLOR= #007700]];[/COLOR] 

     [COLOR= #0000BB]$pass[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Key_my_site[/COLOR][COLOR= #007700]];[/COLOR] 

          [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE username = "[/COLOR][COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR]or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR] 

     [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$info[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR] [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]))      

         {[/COLOR] 

 

 [COLOR= #FF8000]//if the cookie has the wrong password, they are taken to the login page [/COLOR]

         [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$pass[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]$info[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]]) 

             {[/COLOR]             [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Location: login.php"[/COLOR][COLOR= #007700]); 

             }[/COLOR] 

 

 [COLOR= #FF8000]//otherwise they are shown the admin area     [/COLOR]

     [URL="http://www.php.net/else"]else[/URL] 

             [COLOR= #007700]{[/COLOR] 

              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<p>"[/COLOR][COLOR= #007700];[/COLOR] 

 [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR] 
?>
<center><h1>Volg de stappen hieronder:</h1>
Let op: Bent u <strong>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700])[/COLOR] ?></strong>? Zoniet <a href="loguit.php">klik hier</a> en log opnieuw in!<br /></strong>
<iframe src"-" width="400" height="305" border="no" frameborder="0" marginheight="0" marginwidth="0" scrolling="no"></iframe>
</center>
[COLOR= #0000BB]<?php[/COLOR]
 [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]; 

             } 

         } 

         }[/COLOR] 

 [URL="http://www.php.net/else"]else[/URL] 

 

 [COLOR= #FF8000]//if the cookie does not exist, they are taken to the login screen [/COLOR]

 [COLOR= #007700]{[/COLOR]             

 [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Location: login.php"[/COLOR][COLOR= #007700]); 

 }[/COLOR] 

 ?>


Ik heb opeens een omleidingslus? ik weet niet hoe je dit moet fixen? En gisteren deed ie het nog wel?
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoe kunnen mensen een form zien als je form binnen je check zit ?
0
Dylan

Lid · Topicstarter

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Dit is de log in niet. Dit is de pagina waar je komt wanneer je word ingelogd. Of als je dat niet bedoeld; weet ik niet.
0
Berichten
3.037
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je hebt zeker chrome, bij firefox is dat er niet, ik vraag me ook af waarom.
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Misschien komt het doordat deze pagina is geinclude op dezelfde pagina waardoor hij steeds doorgestuurd wordt naar die pagina.

Dat heb ik meestal ook.
0
Dylan

Lid · Topicstarter

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Shahiem schreef:
Misschien komt het doordat deze pagina is geinclude op dezelfde pagina waardoor hij steeds doorgestuurd wordt naar die pagina.

Dat heb ik meestal ook.
Is er een fix? Of gewoon mensen aan raden om Firefox/IE te gebruiken
0
Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dylanh schreef:
Eerdere citaten tonen
Shahiem schreef:
Misschien komt het doordat deze pagina is geinclude op dezelfde pagina waardoor hij steeds doorgestuurd wordt naar die pagina.
Dat heb ik meestal ook.

Is er een fix? Of gewoon mensen aan raden om Firefox/IE te gebruiken
Include je die pagina ergens?
0
Dylan

Lid · Topicstarter

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Nee.
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Zal toch wel moeten. Om een lus te maken moet je naar een pagina header-en die meteen weer verder headerd

Overigens is je indenting echt bagger:

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]// Connects to your Database [/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
 
[COLOR= #FF8000]//checks cookies to make sure they are logged in [/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ID_my_site[/COLOR][COLOR= #007700]])) {[/COLOR]
    
    [COLOR= #0000BB]$username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ID_my_site[/COLOR][COLOR= #007700]];[/COLOR] 
    [COLOR= #0000BB]$pass[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Key_my_site[/COLOR][COLOR= #007700]];[/COLOR] 

    [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE username = "[/COLOR][COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR] 

    [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$info[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR] [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700])) {[/COLOR] 
        [COLOR= #FF8000]//if the cookie has the wrong password, they are taken to the login page [/COLOR]
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$pass[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]$info[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]]) {[/COLOR]
            [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Location: login.php"[/COLOR][COLOR= #007700]); 
        }[/COLOR] 
        [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] 
?>
<p> 
    <center>
        <h1>Volg de stappen hieronder:</h1>
        Let op: Bent u <strong>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700])[/COLOR] ?></strong>? Zoniet <a href="loguit.php">klik hier</a> en log opnieuw in!<br /></strong>
        <iframe src"-" width="400" height="305" border="no" frameborder="0" marginheight="0" marginwidth="0" scrolling="no"></iframe>
    </center>
</p>
[COLOR= #0000BB]<?php[/COLOR]
        [COLOR= #007700]} 
    } 
}[/COLOR] 
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]             
    [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Location: login.php"[/COLOR][COLOR= #007700]); 
}[/COLOR] 
?>
0
Dylan

Lid · Topicstarter

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Rik schreef:
Zal toch wel moeten. Om een lus te maken moet je naar een pagina header-en die meteen weer verder headerd

Overigens is je indenting echt bagger:
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #FF8000]// Connects to your Database [/COLOR]
[URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]
 
[COLOR= #FF8000]//checks cookies to make sure they are logged in [/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ID_my_site[/COLOR][COLOR= #007700]])) {[/COLOR]
    
    [COLOR= #0000BB]$username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ID_my_site[/COLOR][COLOR= #007700]];[/COLOR] 
    [COLOR= #0000BB]$pass[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Key_my_site[/COLOR][COLOR= #007700]];[/COLOR] 

    [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE username = "[/COLOR][COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR] 

    [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$info[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR] [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700])) {[/COLOR] 
        [COLOR= #FF8000]//if the cookie has the wrong password, they are taken to the login page [/COLOR]
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$pass[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]$info[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]]) {[/COLOR]
            [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Location: login.php"[/COLOR][COLOR= #007700]); 
        }[/COLOR] 
        [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] 
?>
<p> 
    <center>
        <h1>Volg de stappen hieronder:</h1>
        Let op: Bent u <strong>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700])[/COLOR] ?></strong>? Zoniet <a href="loguit.php">klik hier</a> en log opnieuw in!<br /></strong>
        <iframe src"-" width="400" height="305" border="no" frameborder="0" marginheight="0" marginwidth="0" scrolling="no"></iframe>
    </center>
</p> 
[COLOR= #0000BB]<?php[/COLOR]
        [COLOR= #007700]} 
    } 
}[/COLOR] 
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]             
    [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Location: login.php"[/COLOR][COLOR= #007700]); 
}[/COLOR] 
?>


In login.php staat wel header();?
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Laat die dan ook zien aub. Waarschijnlijk zorgt die header in login.php ervoor dat er een lus ontstaat.
0
Dylan

Lid · Topicstarter

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Rik schreef:
Laat die dan ook zien aub. Waarschijnlijk zorgt die header in login.php ervoor dat er een lus ontstaat.
[COLOR= #0000BB]<?php[/COLOR] 

 [COLOR= #FF8000]// Connects to your Database [/COLOR]

 [URL="http://www.php.net/include"]include[/URL] [COLOR= #007700]([/COLOR][COLOR= #DD0000]config.php[/COLOR][COLOR= #007700]);[/COLOR]

 [COLOR= #FF8000]//Checks if there is a login cookie[/COLOR]

 [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ID_my_site[/COLOR][COLOR= #007700]]))[/COLOR]


 [COLOR= #FF8000]//if there is, it logs you in and directes you to the members page[/COLOR]

 [COLOR= #007700]{[/COLOR] 
     [COLOR= #0000BB]$username[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]ID_my_site[/COLOR][COLOR= #007700]];[/COLOR] 

     [COLOR= #0000BB]$pass[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Key_my_site[/COLOR][COLOR= #007700]];[/COLOR]

          [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE username = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR][COLOR= #007700]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR]or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]

     [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$info[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR] [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]))     

         {[/COLOR]

         [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$pass[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #0000BB]$info[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]]) 

             {

                          }[/COLOR]

         [URL="http://www.php.net/else"]else[/URL]

             [COLOR= #007700]{[/COLOR]

             [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Location: member.php"[/COLOR][COLOR= #007700]);



             }

         }

 }[/COLOR]


 [COLOR= #FF8000]//if the login form is submitted [/COLOR]

 [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]])) {[/COLOR] [COLOR= #FF8000]// if form has been submitted



 // makes sure they filled it in[/COLOR]

     [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]] | ![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]]) {[/COLOR]

         [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Je hebt niet alle velden ingevuld.[/COLOR][COLOR= #007700]);

     }[/COLOR]

     [COLOR= #FF8000]// checks it against the database[/COLOR]



     [URL="http://www.php.net/if"]if[/URL]  [COLOR= #007700](![/COLOR][URL="http://www.php.net/get_magic_quotes_gpc"]get_magic_quotes_gpc[/URL][COLOR= #007700]()) {[/COLOR]

          [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/addslashes"]addslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]email[/COLOR][COLOR= #007700]]);

     }[/COLOR]

     [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM users WHERE username = "[/COLOR][COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR]or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]



 [COLOR= #FF8000]//Gives error if user dosent exist[/COLOR]

 [COLOR= #0000BB]$check2[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check[/COLOR][COLOR= #007700]);[/COLOR]

 [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$check2[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) {[/COLOR]

         [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Verkeerde login![/COLOR][COLOR= #007700]);

                 }[/COLOR]

 [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$info[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR] [COLOR= #0000BB]$check[/COLOR] [COLOR= #007700]))     

 {[/COLOR]

 [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]]);[/COLOR]

     [COLOR= #0000BB]$info[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$info[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]]);[/COLOR]

     [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/md5"]md5[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]]);[/COLOR]



 [COLOR= #FF8000]//gives error if the password is wrong[/COLOR]

     [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #0000BB]$info[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]]) {[/COLOR]

         [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Verkeerd wachtwoord![/COLOR][COLOR= #007700]);

     }[/COLOR]
     [URL="http://www.php.net/else"]else[/URL] 

 [COLOR= #007700]{[/COLOR] 

 
 [COLOR= #FF8000]// if login is ok then we add a cookie [/COLOR]

      [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]] =[/COLOR] [URL="http://www.php.net/stripslashes"]stripslashes[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]);[/COLOR] 

      [COLOR= #0000BB]$hour[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/time"]time[/URL][COLOR= #007700]() +[/COLOR] [COLOR= #0000BB]3600[/COLOR][COLOR= #007700];[/COLOR] 

 [URL="http://www.php.net/setcookie"]setcookie[/URL][COLOR= #007700]([/COLOR]ID_my_site[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$hour[/COLOR][COLOR= #007700]);[/COLOR] 

 [URL="http://www.php.net/setcookie"]setcookie[/URL][COLOR= #007700]([/COLOR]Key_my_site[COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]pass[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #0000BB]$hour[/COLOR][COLOR= #007700]);[/COLOR]     

 

 [COLOR= #FF8000]//then redirect them to the members area [/COLOR]

 [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Location: member.php"[/COLOR][COLOR= #007700]); 

 } 

 } 

 }[/COLOR] 

 [URL="http://www.php.net/else"]else[/URL] 

[COLOR= #007700]{[/COLOR]     

 

 [COLOR= #FF8000]// if they are not logged in [/COLOR]

 ?> 
<center>


 <form action="login.php" method="post"> 

 <table border="0"> 

 <tr><td colspan=2><h1>Log hier in:</h1></td></tr> 

 <tr><td>Gebruikersnaam:</td><td> 

 <input type="text" name="username" maxlength="40"> 

 </td></tr> 

 <tr><td>Wachtwoord:</td><td> 

 <input type="password" name="pass" maxlength="50"> 

 </td></tr> 

 <tr><td colspan="2" align="right"> 

 <input type="submit" name="submit" value="Log in ->"> 

 </td></tr> 

 </table> 

 </form> 
</center>
 [COLOR= #0000BB]<?php[/COLOR] 

 [COLOR= #007700]}[/COLOR] 

 

 ?>
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
En hoe heet het script in de startpost?

Overigens, username en wachtwoord opslaan in een cookie? Dat is echt zo gevoelig als het maar zijn kan. À‰én fout in je site, en iemand kan via een XSS lek cookies (en dus het wachtwoord van de leden) gaan loggen.
0
Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
En geen die(); !
0
Dylan

Lid · Topicstarter

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Rik schreef:
En hoe heet het script in de startpost?
Overigens, username en wachtwoord opslaan in een cookie? Dat is echt zo gevoelig als het maar zijn kan. À‰én fout in je site, en iemand kan via een XSS lek cookies (en dus het wachtwoord van de leden) gaan loggen.

member.php

Heeft iemand dan een ander systeem voor mij? Zonder cookies?

toevoeging op 3 juni 2012, 09:54:32:
& $_POST[username] = stripslashes($_POST[username]);

geen xss mogelijk dan?

toevoeging op 3 juni 2012, 09:57:54:
En als iemand dan inlogt, krijg ie toch alleen maar een betaal scherm te zien? Omdat mijn IIS niet goed is volgens mij heb ik dus xammp gedowload en heb ik dus een pagina een iframe gezet die die login dus weergeeft, als je daar dan weer inlogt zie je een betaal systeem. op die pagina waar die iframe staat (van inloggen) moet je ook eerst ingelogt zijn en dat werkt niet met cookies
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren