Hallo,
ik ben bezig met het updaten en het beveiligen van mijn BETA Code Systeem.
Alleen ik krijg de beveiliging niet goed.. Het formulier, als ik nu bijvoorbeeld intyp in het formulier, dan voegt hij hem alsnog toe in de database, maar dat wil ik niet.. Ik wil dat je alleen tekst erin kan zetten en cijfers. Dus bijvoorbeeld: V1.0.1
Iemand die dit voor mij wilt doen?
Hier is de code:
Alvast bedankt..
beloning: 0.2p
ik ben bezig met het updaten en het beveiligen van mijn BETA Code Systeem.
Alleen ik krijg de beveiliging niet goed.. Het formulier, als ik nu bijvoorbeeld intyp in het formulier, dan voegt hij hem alsnog toe in de database, maar dat wil ik niet.. Ik wil dat je alleen tekst erin kan zetten en cijfers. Dus bijvoorbeeld: V1.0.1
Iemand die dit voor mij wilt doen?
Hier is de code:
[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]
[COLOR= #0000BB]$select[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM beta_code WHERE code = "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$select[/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]$bestaatcode[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$bestaatcode[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #DD0000]"0"[/COLOR][COLOR= #007700]){[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"Deze code bestaat al!<br />
<a href="javascript:history.back(1)">Klik hier om terug te gaan</a>.<br />"[/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 beta_code (id, code) VALUES
(, "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]code[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]");"[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"De code is <b>succesvol</b> toegevoegd.<br />
<a href="index.php">Klik hier om terug te gaan naar de admin</a>."[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user_status[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #0000BB]1[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<h4> Vul hier uw beta code in. </h4>[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]"<form method="post" action=""[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_URI[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]"">
Code:<br />
<input type="text" name="code" size="40" />
<br /><br />
<input type="submit" name="submit" value="Code Toevoegen" />
<input type="reset" name="reset" value="Wis Invoer" />
</form>"[/COLOR][COLOR= #007700];
}[/COLOR]
?> Alvast bedankt..
beloning: 0.2p
?