Dropdownmenu Keuze Layout

Gestart doorWouter5 reacties34 weergaven

6 berichten · pagina 1 van 1

Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Hier kun je de layout van je dealergame veranderen.</p>
          <form name="form1" id="form1" method="post" action="">
            <input name="layout" type="text" id="layout" value="Nummer Layout" />
            <input type="submit" name="Submit" value="Toepassen &gt;&gt;" />
          </form>
          <p><strong>[COLOR= #0000BB]<?[/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/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE `dealer` SET layout=$_POST[layout] WHERE `naam` = $user"[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000]"De layout is succesvol veranderd!"[/COLOR][COLOR= #007700];
    }[/COLOR]
    ?></strong>


Dit is de code, hoe kan ik er nu voor zorgen dat gebruikers een uitschuifkeuzemenu (dropdownmenu) hebben met layout 1 en layout 2. en dat hij layout 1 als 1 opslaat en layout 2 als 2 opslaat?

mvg
Wouter
Als het niet duidelijk is zeg je het maar even
0
Berichten
1.160
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Doe eerst maar php beveiliggen:

[COLOR= #0000BB]<?php[/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/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE dealer SET layout="[/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]layout[COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" WHERE naam = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$user[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De layout is succesvol veranderd!"[/COLOR][COLOR= #007700];
}[/COLOR]
?>
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Ordian schreef:
Doe eerst maar php beveiliggen:
[COLOR= #0000BB]<?php[/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/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE dealer SET layout="[/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]layout[COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" WHERE naam = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$user[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De layout is succesvol veranderd!"[/COLOR][COLOR= #007700];
}[/COLOR]
?>


Ahja anders kan er een SQL injection zijn zeker ?
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Moet het dan niet dit:

[COLOR= #0000BB]<?php[/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/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"UPDATE dealer SET layout="[/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]layout[/COLOR][COLOR= #007700]]) .[/COLOR] [COLOR= #DD0000]" WHERE naam = "[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #0000BB]$user[/COLOR] [COLOR= #007700].[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De layout is succesvol veranderd!"[/COLOR][COLOR= #007700];
}[/COLOR]
?>


zijn?
0
Berichten
1.160
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Oops.
Ja moet binnen helemaal vergeten.
0
Wouter

Lid · Topicstarter

Berichten
3.540
Reputatie
0
Punten
0,01
Lid sinds
Laatst gezien
Oke ga dan straks heel mijn systeem beveiligen.
iemand nu ideee hoe dat te maken met dropdown menu?
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