PHP exploit zoeker

Gestart doorShahiem31 reacties84 weergaven

32 berichten · pagina 1 van 3

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Hi,

Ik wil controleren op een selectieveld of je een foutieve geslacht hebt ingevuld. Mijn code die ik nu heb moet werken maar om de een of andere manier werkt het niet. Wie weet waardoor dat komt?

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]geslacht[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700])
{[/COLOR]
      [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]fouten[COLOR= #007700]->[/COLOR]add[COLOR= #007700]([/COLOR][COLOR= #DD0000]Foutief geslacht[/COLOR][COLOR= #007700]);
}[/COLOR]
?>


Bedankt wink
0
Berichten
449
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
if($_POST[geslacht] != 1 || $_POST[geslacht] != 2)
{
$core->fouten->add(Foutief geslacht);
}
moet het doen denk ik
0
Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]geslacht[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]geslacht[/COLOR][COLOR= #007700]] !=[/COLOR] [COLOR= #0000BB]2[/COLOR][COLOR= #007700])
{[/COLOR]
      [COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]fouten[COLOR= #007700]->[/COLOR]add[COLOR= #007700]([/COLOR][COLOR= #DD0000]Foutief geslacht[/COLOR][COLOR= #007700]);
}[/COLOR]
?>
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@david: Nog steeds
@Wouter: Kijk boven je.
0
Berichten
449
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
geef de class core is
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Geef de html code van geslacht eens
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
@David: Sorry dat kan ik niet posten.
@Milan:

<select name="geslacht">
                                <option value="1" [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/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] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]geslacht[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]selected="selected"[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700]);[/COLOR] ?>>Man</option>
                                <option value="2" [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/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] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]geslacht[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]2[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]selected="selected"[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700]);[/COLOR] ?>>Vrouw</option>
                            </select>
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
if($_POST[geslacht] != 1 || $_POST[geslacht] != 2)
{
$core->fouten->add(Foutief geslacht);
}
?>

En dit? (getallen tussen )
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Nog steeds. clown
0
Berichten
8.602
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
if($_POST[geslacht] != 1 && $_POST[geslacht] != 2)
{
$core->fouten->add(Foutief geslacht);
}
?>

Zo dan?
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Yes het werkt, thanx!
0
Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Milan schreef:
if($_POST[geslacht] != 1 && $_POST[geslacht] != 2)
{
$core->fouten->add(Foutief geslacht);
}
?>

Zo dan?
Zal toch niet werken?
Nu verwacht het script dat het geslacht 1 en 2 is. Maw zal het nooit kloppen omdat je maar 1 geslacht kan invoeren (ofwel 1 ofwel 2)
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Het werkt wel, heb gechecked met Firebug. emo
0
Berichten
449
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Wouter schreef:
Eerdere citaten tonen
Milan schreef:
if($_POST[geslacht] != 1 && $_POST[geslacht] != 2)
{
$core->fouten->add(Foutief geslacht);
}
?>

Zo dan?

Zal toch niet werken?
Nu verwacht het script dat het geslacht 1 en 2 is. Maw zal het nooit kloppen omdat je maar 1 geslacht kan invoeren (ofwel 1 ofwel 2)
Weet je wel wat != betekent?
!= betekent is niet gelijk aan
== betekent is gelijk aan

if($_POST[geslacht] != 1 && $_POST[geslacht] != 2) betekent eigenlijk:

als(geslacht niet gelijk is aan 1 en geslacht niet gelijk is aan 2)
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Even nog een andere vraag. Het is simpel maar ik kom er niet uit.
Ik heb dit, maar dan kies ik bijvoorbeeld man en als ik dan op verzenden klik dan springt hij op vrouw.

Weten jullie waardoor dat komt?

<select name="geslacht">
                                    <option value="1" [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]info[COLOR= #007700][[/COLOR][COLOR= #DD0000]mijn[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]geslacht[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]geslacht[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]selected="selected"[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700]);[/COLOR] ?>>Man</option>
                                    <option value="2" [COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$core[/COLOR][COLOR= #007700]->[/COLOR]leden[COLOR= #007700]->[/COLOR]info[COLOR= #007700][[/COLOR][COLOR= #DD0000]mijn[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #DD0000]geslacht[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]2[/COLOR] [COLOR= #007700]||[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]geslacht[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]2[/COLOR] [COLOR= #007700]?[/COLOR] [COLOR= #DD0000]selected="selected"[/COLOR] [COLOR= #007700]:[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700]);[/COLOR] ?>>Vrouw</option>
                                </select>
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