[PHP] Input blijft onjuist

Gestart doorDesire15 reacties77 weergaven

16 berichten · pagina 2 van 2

Berichten
14.025
Reputatie
1
Punten
0,01
Lid sinds
Laatst gezien
Nog een kleine tip:

[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/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]$result[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM codes WHERE code = "[/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]id[/COLOR][COLOR= #007700]]) .[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/trim"]trim[/URL][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]Je hebt geen code ingevoerd, je mag alleen code`s invoeren![/COLOR][COLOR= #007700];
            }[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #DD0000]1[/COLOR][COLOR= #007700]) {[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]code is juist[/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]code is onjuist[/COLOR][COLOR= #007700];
            }
    }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
        [URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
    }[/COLOR]
    
    [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]
        <form method="post">
            <input type="tekst" name="code" />
            <input type="submit" name="Submit" value="submit!" />
        </form>
    [/COLOR][COLOR= #007700];[/COLOR]
?>


Minder resources of zo. (ik weet niet zeker)
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