Beveiliging

Gestart doorWereldhotel27 reacties148 weergaven

28 berichten · pagina 2 van 2

Berichten
1.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
laat is je hele script zien + pagina
0
Wereldhotel

Lid · Topicstarter

Berichten
542
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"upper.php"[/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]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uid[/COLOR][COLOR= #007700]])) {[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"U bent niet ingelogd"[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$dbres[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM `users` WHERE `id`="[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uid[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$strLoggedIn[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_array"]mysql_fetch_array[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$dbres[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$strLoggedIn[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rang[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"admin"[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$strLoggedIn[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rang[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"developer"[/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]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Submit1[/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]Text1[/COLOR][COLOR= #007700]])) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft niet alle velden ingevuld![/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
                [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO shoutbar (sendedby,message,senderid) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$strLoggedIn[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]Text1[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]", "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uid[/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/echo"]echo[/URL] [COLOR= #DD0000]Bericht Toegevoegd![/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]<form method="post">
        <input name="Text1" type="text" maxlength="80" style="width: 362px" /><input name="Submit1" type="submit" value="Verzend Bericht!" style="height: 21px; width: 101px" /></form>[/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 geen Admin of Developer!"[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"footer.php"[/COLOR][COLOR= #007700]);[/COLOR]
?>
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wss een fout in de database.
Weet je zeker dat je in de database bij jouw account de kolum rang admin is?
0
Berichten
1.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
precies wat eleky zegt, kloppen je velden wel?
0
Wereldhotel

Lid · Topicstarter

Berichten
542
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Jep, Keb script net getest onder de 2 ranks. Werkt niet
0
Berichten
1.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
das wel heel raar, weet je ook zeker dat Admin en / of Devoloper niet met hoofdletter is?
en staat die rang ook wel bij je account?
0
Wereldhotel

Lid · Topicstarter

Berichten
542
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb nu rank developer op me account. Niet met hoofdletter.
0
Berichten
1.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
weet je ook zeker dat de sessie uid is?
en de rang, rang is in de tabel?
0
Wereldhotel

Lid · Topicstarter

Berichten
542
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja,Ja,Ja,Ja,Ja yummie
0
Berichten
1.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
dan geef ik het op
0
Rik

Lid

Berichten
18.393
Reputatie
0
Punten
0,04
Lid sinds
Laatst gezien
Een momentje, eventjes mijn IDE opstarten. Zie mijn edit over paar minuutjes.

EDIT:

[COLOR= #0000BB]<?php[/COLOR]
    [URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/include"]include[/URL] [COLOR= #DD0000]"upper.php"[/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]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uid[/COLOR][COLOR= #007700]])) 
    {[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U bent niet ingelogd[/COLOR][COLOR= #007700];
    }[/COLOR]
    [URL="http://www.php.net/else"]else[/URL] 
    [COLOR= #007700]{[/COLOR]
        [COLOR= #0000BB]$sQuery[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM `users` WHERE `id` = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uid[/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= #0000BB]$sFetch[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sQuery[/COLOR][COLOR= #007700]);[/COLOR]
        
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]( ([/COLOR][COLOR= #0000BB]$sFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rang[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]admin[/COLOR][COLOR= #007700]) || ([/COLOR][COLOR= #0000BB]$sFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rang[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]developer[/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]Text1[/COLOR][COLOR= #007700]])) 
                {[/COLOR]
                    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]U heeft niet alle velden ingevuld![/COLOR][COLOR= #007700];
                }[/COLOR] 
                [URL="http://www.php.net/else"]else[/URL] 
                [COLOR= #007700]{[/COLOR]
                    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO shoutbar (sendedby,message,senderid) VALUES ("[/COLOR] [COLOR= #007700].[/COLOR] [URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sFetch[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]naam[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/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]Text1[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]", "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]uid[/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/echo"]echo[/URL] [COLOR= #DD0000]Bericht Toegevoegd![/COLOR][COLOR= #007700];
                }
            }[/COLOR] 
            [URL="http://www.php.net/else"]else[/URL] 
            [COLOR= #007700]{[/COLOR]
                ?>
                <form method="post">
                    <input name="Text1" type="text" maxlength="80" style="width: 362px" />
                    <input name="Submit1" type="submit" value="Verzend Bericht!" style="height: 21px; width: 101px" />
                </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]"U bent geen Admin of Developer!"[/COLOR][COLOR= #007700];
        }
    }[/COLOR]
    
    [URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"footer.php"[/COLOR][COLOR= #007700]);[/COLOR]
?>


Werkt dit? Zoniet: welke error krijg je.
0
Wereldhotel

Lid · Topicstarter

Berichten
542
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Script werkt perfect, aleen nu staat er boven de lay:
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/icorne/domains/icorne.one2xs.com/public_html/vandex/addshout.php:1) in /home/icorne/domains/icorne.one2xs.com/public_html/vandex/config.php on line 2
0
Berichten
1.314
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
je verstuurd al html voor je session_start(); het ligt waarschijnlijk aan je include files
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