Parse error: syntax error, unexpected }

Gestart doorBjarnootjuh21 reacties49 weergaven

22 berichten · pagina 1 van 2

Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hoi,

Ik krijg deze error:
Parse error: syntax error, unexpected } in /home/***/justfm.nl/admin/uitloggen.php on line 95

Dit is de code:

[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]"functions.php"[/COLOR][COLOR= #007700];[/COLOR]

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>JUST! DJ Paneel</title>
</head>

<body>
<div id="header">
    <div id="logo"><b>JUST! FM DJ Paneel</b></div>
    <div id="user">
    [COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR]checklogin[COLOR= #007700]()) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Ingelogd als user: <span>[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$get_userdata[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]</span>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br /> Je bent een: <span>[/COLOR] [COLOR= #007700].[/COLOR][COLOR= #0000BB]$get_userdata[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rang[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]</span>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<br /><a href="uitloggen.php">Uitloggen</a>[/COLOR][COLOR= #007700];[/COLOR]
?>
<br />    </div>
</div>
<div id="menu">
    <div id="menu-nav">
        [COLOR= #0000BB]<?php[/COLOR]
        [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$get_userdata[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rang[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"DJ"[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$get_userdata[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rang[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"Hoofd-DJ"[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$get_userdata[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rang[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"Manager"[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$get_userdata[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]rang[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"Admin"[/COLOR][COLOR= #007700]) {[/COLOR]
        ?>
        <ul>
            <li><a href="index">Home</a></li>
            <li><a href="djsays">DJ Zegt</a></li>
            <li><a href="radioconnection">Radio Info</a></li>
            <li><a href="faq">Help!</a></li>
            <li><a href="rules">Regels</a></li>
            <li><a href="requests">Requests</a></li>
            <li><a href="timetable">Timetable</a></li>
            <li><a href="beheer">Beheer</a></li>
        </ul>
        [COLOR= #0000BB]<?php[/COLOR]
        [COLOR= #007700]}[/COLOR]
        ?>
    </div>
</div>
<div id="container">
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR]checklogin[COLOR= #007700]()) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<center><div style="font-family:calibri;width:600px; text-align:center; margin-left:auto; margin-right:auto;margin-top:50px; padding:8px; border:1px solid #9c0006; background:#ffc7ce; color:#9c0006;"><strong>Foutmelding</strong> <br><br>Je bent niet ingelogd, je moet eerst ingelogd zijn om uit te kunnen loggen.</div></center>[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]

     [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logout[/COLOR][COLOR= #007700]]) {[/COLOR]
[COLOR= #0000BB]$count_sessions[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT COUNT(*) FROM sessions WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR]sqlsafe[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$sessionscounted[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_result"]mysql_result[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$count_sessions[/COLOR][COLOR= #007700],[/COLOR][COLOR= #0000BB]0[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$sessionscounted[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]) {[/COLOR] [COLOR= #0000BB]$browserstring[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"browser"[/COLOR][COLOR= #007700]; }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR] [COLOR= #0000BB]$browserstring[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"browsers"[/COLOR][COLOR= #007700]; }[/COLOR]

[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<p>Je bent op dit moment ingelogd op <b>"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sessionscounted[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"</b> "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$browserstring[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]".<br />Maak een keuze uit een van de volgende opties:</p>"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<form method="POST" action="">"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<input name="logoutmode" type="radio" value="onlythissession">Alleen deze PC.<br />"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<input name="logoutmode" type="radio" value="allsessions">Alle PCs.<br />"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<input name="logoutmode" type="radio" value="choosesession" id="logout_by_session">Kies een sessie:<br />"[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<table border="1">"[/COLOR][COLOR= #007700];[/COLOR]
        ?>
       <tr>
       <td>&nbsp;</td>
       <td>SessID</td>
       <td>Datum / tijd</td>
      </tr>
[COLOR= #0000BB]<?php
$sessioninfo[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM sessions WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR]sqlsafe[COLOR= #007700]([/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sessions[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sessioninfo[/COLOR][COLOR= #007700])){[/COLOR]
?>
      <tr>
       <td><input name="sessionid[]" type="checkbox" value="[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]];[/COLOR]?>" onChange="document.getElementById(logout_by_session).checked = true" /></td>
       <td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]];[/COLOR]?></td>
       <td>[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sessions[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logintime[/COLOR][COLOR= #007700]];[/COLOR]?></td>
      </tr>
       [COLOR= #0000BB]<?php[/COLOR]
       [COLOR= #007700]}[/COLOR]
       ?>
     </table>
     <input type="submit" name="logout" value="Uitloggen">
     [COLOR= #0000BB]<?php[/COLOR]
     [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"</form>"[/COLOR][COLOR= #007700];

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

              [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"onlythissession"[/COLOR][COLOR= #007700]) {[/COLOR]
               [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE hash = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]hash[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
               [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div style="font-family:calibri;width:600px; text-align:center; margin-left:auto; margin-right:auto;margin-top:50px; padding:8px; border:1px solid #9c0006; background:#ffc7ce; color:#9c0006;"><strong>Foutmelding</strong> <br><br>Je huidige sessies zijn uitgelogd.</div>[/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]<div style="font-family:calibri;width:600px; text-align:center; margin-left:auto; margin-right:auto;margin-top:50px; padding:8px; border:1px solid #9c0006; background:#ffc7ce; color:#9c0006;"><strong>Foutmelding</strong> <br><br>Je sessie is niet uitgelogd wegens een fout:<br />[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();[/COLOR][COLOR= #DD0000]</div>[/COLOR]
             [COLOR= #007700]}  
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"allsessions"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE userid = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_COOKIE[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
               [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div style="font-family:calibri;width:600px; text-align:center; margin-left:auto; margin-right:auto;margin-top:50px; padding:8px; border:1px solid #9c0006; background:#ffc7ce; color:#9c0006;"><strong>Foutmelding</strong> <br><br>Al jouw sessies zijn uitgelogd.</div>[/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]<div style="font-family:calibri;width:600px; text-align:center; margin-left:auto; margin-right:auto;margin-top:50px; padding:8px; border:1px solid #9c0006; background:#ffc7ce; color:#9c0006;"><strong>Foutmelding</strong> <br><br>Je sessies zijn niet uitgelogd wegens een fout:<br />[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();[/COLOR][COLOR= #DD0000]</div>[/COLOR]
               [COLOR= #007700]}
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"allothersession"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div style="font-family:calibri;width:600px; text-align:center; margin-left:auto; margin-right:auto;margin-top:50px; padding:8px; border:1px solid #9c0006; background:#ffc7ce; color:#9c0006;"><strong>Foutmelding</strong> <br><br>Deze functie werkt nog niet!</div>[/COLOR][COLOR= #007700];
            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"choosesession"[/COLOR][COLOR= #007700]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div style="font-family:calibri;width:600px; text-align:center; margin-left:auto; margin-right:auto;margin-top:50px; padding:8px; border:1px solid #9c0006; background:#ffc7ce; color:#9c0006;"><strong>Foutmelding</strong> <br><br>Je sessies zijn uitgelogd!</div>[/COLOR][COLOR= #007700];[/COLOR]

                [URL="http://www.php.net/foreach"]foreach[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]sessionid[/COLOR][COLOR= #007700]] as[/COLOR] [COLOR= #0000BB]$index[/COLOR] [COLOR= #007700]=>[/COLOR] [COLOR= #0000BB]$sessid[/COLOR][COLOR= #007700]) {[/COLOR]
                 [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"DELETE FROM sessions WHERE hash = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$sessid[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]" "[/COLOR][COLOR= #007700])) {[/COLOR]
                       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div style="font-family:calibri;width:600px; text-align:center; margin-left:auto; margin-right:auto;margin-top:50px; padding:8px; border:1px solid #9c0006; background:#ffc7ce; color:#9c0006;"><strong>Foutmelding</strong> <br><br>Je sessie is niet uitgelogd wegens een fout:<br />[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();[/COLOR][COLOR= #DD0000]</div>[/COLOR]
                       [COLOR= #007700]}
                }


            }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [URL="http://www.php.net/if"]if[/URL] [COLOR= #007700](![/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]logoutmode[/COLOR][COLOR= #007700]]) {[/COLOR]
              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<div style="font-family:calibri;width:600px; text-align:center; margin-left:auto; margin-right:auto;margin-top:50px; padding:8px; border:1px solid #9c0006; background:#ffc7ce; color:#9c0006;"><strong>Foutmelding</strong> <br><br>je bent vergeten een uitlog optie te kiezen.</div>[/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]<div style="font-family:calibri;width:600px; text-align:center; margin-left:auto; margin-right:auto;margin-top:50px; padding:8px; border:1px solid #9c0006; background:#ffc7ce; color:#9c0006;"><strong>Foutmelding</strong> <br><br>Deze uitlogoptie is niet bekend!</div>[/COLOR][COLOR= #007700];
            }








   }
}[/COLOR] 
?>
</div>
</body>

</html>
[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]<center><div style="font-family:calibri;width:600px; text-align:center; margin-left:auto; margin-right:auto;margin-top:50px; padding:8px; border:1px solid #9c0006; background:#ffc7ce; color:#9c0006;"><strong>Foutmelding</strong> <br><br>Je moet ingelogd zijn om deze pagina te bekijken!</div></center>[/COLOR][COLOR= #007700];
}[/COLOR]
?>


Wat is er fout aan? Ik heb veel geprobeerd, verschuift de error alleen maar een line.
0
Fass

Lid

Berichten
3.771
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Achter regel 94 moet nog een ;
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nu werkt hij wel, dit heb ik over het hoofd gezien. Het was op meerdere plekken het geval.

Ook Notepad++ zag dit niet.

GEEN SLOTJE PLZ, miss nog vraagjes dalijk xD
0
Berichten
2.609
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bjarnootjuh schreef:
Nu werkt hij wel, dit heb ik over het hoofd gezien. Het was op meerdere plekken het geval.

Ook Notepad++ zag dit niet.

GEEN SLOTJE PLZ, miss nog vraagjes dalijk xD

wilde net zeggen op regel 100 ook.
toevoeging op 1 juni 2012, 18:37:52:
109 bedoel ik.
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
Die punt komma hoort er niet. De regel gaat gewoon verder door als string, dus gebruik een punt.

Even wat opmerkingen:
- Inline CSS is vies, plaats alles in een stylesheet. Dat maakt het overzichtelijk, beter leesbaarder en makkelijker te debuggen
- Ik mis SQL-injection in je DELETE-queries.
- Die else-if voor de logout-mode zou zelfs in een switch() kunnen. Veel mooier...
- is oud.
0
Fass

Lid

Berichten
3.771
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ja idd ik zie het nu ook, je hebt een aantal keer
.mysql_error();</div>


wat natuurlijk moet zijn
.mysql_error().</div>;
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
Die punt komma hoort er niet. De regel gaat gewoon verder door als string, dus gebruik een punt.

Even wat opmerkingen:
- Inline CSS is vies, plaats alles in een stylesheet. Dat maakt het overzichtelijk, beter leesbaarder en makkelijker te debuggen
- Ik mis SQL-injection in je DELETE-queries.
- Die else-if voor de logout-mode zou zelfs in een switch() kunnen. Veel mooier...
- is oud.
Is alleen voor de error divjes.

Hoe bedoel je SQL-Injection in DELETE-queries?

Switch ken ik nog niet wink Beginnend phper.

Vind ik soms wel makkelijk bloos
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
- Inline CSS is vies, en het beste is dat je dit helemaal niet gebruikt. Later ga je bij het debuggen en ontwikkelen hier vast wel tegen de lamp mee aanlopen. Of je het nou alleen voor errors gebruikt maakt het in mijn ogen geen uitzondering.

- SQL injection... Lees dit maar eens: http://nl.wikipedia.org/wiki/SQL-injectie
Iemand kan je cookie aanpassen en e.v.t diverse records deleten, dat wil je zeker niet....

- Center is oud, afleren. gebruik divjes en CSS, en verdiep je eens in margins en text-align

- Switch: Probeer het eens... Het maakt het veel leesbaarder in mijn ogen.

PS: Je kan ook je quote onderbreken, i.pv. alle regels te markeren met UBB wink.
gemak dient de mens....
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
- Inline CSS is vies, en het beste is dat je dit helemaal niet gebruikt. Later ga je bij het debuggen en ontwikkelen hier vast wel tegen de lamp mee aanlopen. Of je het nou alleen voor errors gebruikt maakt het in mijn ogen geen uitzondering.

- SQL injection... Lees dit maar eens: http://nl.wikipedia.org/wiki/SQL-injectie
Iemand kan je cookie aanpassen en e.v.t diverse records deleten, dat wil je zeker niet....

- Center is oud, afleren. gebruik divjes en CSS, en verdiep je eens in margins en text-align

- Switch: Probeer het eens... Het maakt het veel leesbaarder in mijn ogen.

PS: Je kan ook je quote onderbreken, i.pv. alle regels te markeren met UBB wink.
gemak dient de mens....
Hoe kan ik die sql injection daar tegen gaan? Moet ik mysql_real_escape() eromheen zetten?
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
jep...... (of sqlsafe, welke MultiSess op een kansloze manier gebruikt wink )
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Aarclay schreef:
jep...... (of sqlsafe, welke MultiSess op een kansloze manier gebruikt wink )
Oke, ik heb dus mysql_real_escape eromheen gezet en krijg deze error:

Fatal error: Call to undefined function mysql_real_escape() in /home/bjarnb43828/justfm.nl/admin/uitloggen.php on line 72

En dit is het:

$sessioninfo = mysql_real_escape("SELECT * FROM sessions WHERE userid = ".sqlsafe($_COOKIE[id])."");
while($sessions = mysql_fetch_assoc($sessioninfo)){
?>
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
mysql_real_escape_string() als je even goed naar de Wikipedia kijkt.
0
Bjarnootjuh

Lid · Topicstarter

Berichten
7.806
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dan krijg ik weer dit:

Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in /home/***/justfm.nl/admin/uitloggen.php on line 73
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Bjarno, je moet wel gewoon nog de query uitvoeren met mysql_query
Het is niet zo dat mysql_real_escape_string de mysql_query kan vervangen.
Maar die sqlsafe functie van jou, doet die hetzelfde als mysql_real_escape_string() ?
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