Admin script

Gestart doorShahiem6 reacties18 weergaven

7 berichten · pagina 1 van 1

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb een admin script maar hij logt van zelf inconfusedHeel raar, kan iemand me helpen?

Code:

[COLOR= #0000BB]<?php[/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]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]])){[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]inc/config.php[/COLOR][COLOR= #007700];
{[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700])
    {[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aName[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aPass[/COLOR][COLOR= #007700]]))
        {[/COLOR]
        [COLOR= #0000BB]$fouten[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Je moet alle velden invullen.[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
    [COLOR= #0000BB]$Query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT aId, aName, aPass FROM admin WHERE aName =     

"[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/strtolower"]strtolower[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aName[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or 

[URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Query[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) 
        {[/COLOR]
        [COLOR= #0000BB]$fouten[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]De opgegevens gebruikersnaam bestaat niet.[/COLOR][COLOR= #007700];
                        }[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
                [COLOR= #0000BB]$Fetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Query[/COLOR][COLOR= #007700]);[/COLOR]
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aPass[/COLOR][COLOR= #007700]] !=[/COLOR] hash[COLOR= #007700]([/COLOR][COLOR= #DD0000]sha256[/COLOR][COLOR= #007700],[/COLOR] hash[COLOR= #007700]([/COLOR][COLOR= #DD0000]sha512[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aPass[/COLOR][COLOR= #007700]])))
                {[/COLOR]
                    [COLOR= #0000BB]$fouten[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Het opgegeven wachtwoord is onjuist[/COLOR][COLOR= #007700];
                }  
}     
            
        }[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$fouten[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
         
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U bent nu ingelogd en word doorverwezen naar de <a 

href="index.php">home.</a>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<meta http-equiv="refresh" content="3;url=index.php">[/COLOR][COLOR= #007700];
        }    
}[/COLOR]
?>

<form name="login_form" method="post" action="admin.php">
  <label>
  <input name="user" type="text" id="user">ID<br />
  <input name="pass" type="password" id="pass">Password<br />
  </label>
<input type="submit" name="login" id="login" value="Login">
   </label>
</p>
</form>
<form name="Register" method="post" action="reg.php">
  <input type="submit" name="register" id="register" value="Register">
</form><br />
<form name="news" method="post" action="news.php">
  <input type="submit" name="news" id="news" value="News">
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]al ingelogd[/COLOR][COLOR= #007700];
}[/COLOR]
?>
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
if(!isset($_SESSION[user])){
require_once inc/config.php;
[red]{[red]

Na een require moet er geen { als ik mij niet vergis.
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@Alemaalte, Het kan geeneens, er moet daar een }
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik zei dat er geen moest emo
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nu geeft hij geen bericht aan :

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]inc/config.php[/COLOR][COLOR= #007700];[/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]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]]))
{[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]POST[/COLOR][COLOR= #007700])
    {[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aName[/COLOR][COLOR= #007700]]) ||[/COLOR] [URL="http://www.php.net/empty"]empty[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aPass[/COLOR][COLOR= #007700]]))
        {[/COLOR]
        [COLOR= #0000BB]$fouten[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Je moet alle velden invullen.[/COLOR][COLOR= #007700];
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
    [COLOR= #0000BB]$Query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT aId, aName, aPass FROM admin WHERE aName =     "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/strtolower"]strtolower[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aName[/COLOR][COLOR= #007700]])) .[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/trigger_error"]trigger_error[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Query[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]) 
        {[/COLOR]
        [COLOR= #0000BB]$fouten[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]De opgegevens gebruikersnaam bestaat niet.[/COLOR][COLOR= #007700];
                        }[/COLOR]
            [URL="http://www.php.net/else"]else[/URL]
            [COLOR= #007700]{[/COLOR]
                [COLOR= #0000BB]$Fetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$Query[/COLOR][COLOR= #007700]);[/COLOR]
                [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aPass[/COLOR][COLOR= #007700]] !=[/COLOR] hash[COLOR= #007700]([/COLOR][COLOR= #DD0000]sha256[/COLOR][COLOR= #007700],[/COLOR] hash[COLOR= #007700]([/COLOR][COLOR= #DD0000]sha512[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]aPass[/COLOR][COLOR= #007700]])))
                {[/COLOR]
                    [COLOR= #0000BB]$fouten[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]Het opgegeven wachtwoord is onjuist[/COLOR][COLOR= #007700];        
        }[/COLOR]
        [URL="http://www.php.net/else"]else[/URL]
        [COLOR= #007700]{[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U bent nu ingelogd en word doorverwezen naar de <a href="index.php">home.</a>[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<meta http-equiv="refresh" content="3;url=index.php">[/COLOR][COLOR= #007700];
        }  
}
}[/COLOR]
?>

<form name="login" action="admin.php" method="post">
        <input type="text" name="aName" size="14" value="Gebruikersnaam" onfocus="if (this.value == Gebruikersnaam) this.value = ;" /><br />
        <input type="password" name="aPass" size="14" value="Wachtwoord" onfocus="if (this.value == Wachtwoord) this.value = ;" /><br />
        <input type="submit" value="Login" name="submitshort" class="submit" />
    </form>

[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
[URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]al ingelogd[/COLOR][COLOR= #007700];
}
}[/COLOR]
?>


Bijv: Als je geen gegevens invult.
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
je zegt nergens dat $fouten ge-echod moet worden
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
LOL, Je hebt gelijk xD
Stom foutje!
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