id wordt niet weergeven

Gestart doorShahiem2 reacties23 weergaven

3 berichten · pagina 1 van 1

Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb een script maar de link moet dan gaan naar:
http://www.lerisranantongo.com/v1/overhoor?act=show&t=id
maar ik krijg dan dit als ik er op klik
http://www.lerisranantongo.com/v1/overhoor?act=show&t=

Hoe los ik dat op?
Code:

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]inc/header.php[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]act[/COLOR][COLOR= #007700]]) ==[/COLOR] [COLOR= #DD0000]show[/COLOR][COLOR= #007700])
    {[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]t[/COLOR][COLOR= #007700]]) && ([/COLOR][URL="http://www.php.net/is_numeric"]is_numeric[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]t[/COLOR][COLOR= #007700]]))) {
    {[/COLOR]
      [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<h1>Leer de woorden</h1><br />[/COLOR][COLOR= #007700];[/COLOR]
     [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Leer de worden goed uit je hoofd, en laat je dan overhoren.<br /><br />[/COLOR][COLOR= #007700];[/COLOR]
                [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]<textarea onfocus="blur()">[/COLOR][COLOR= #007700];[/COLOR]
        [COLOR= #0000BB]$topic_info_query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT woord, antwoord, cat_id FROM woorden WHERE cat_id = "[/COLOR][COLOR= #007700].  (int)[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]t[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]""[/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]
        [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]$topic_info_query[/COLOR][COLOR= #007700]))
        {[/COLOR]
            [URL="http://www.php.net/while"]while[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$topic_info[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$topic_info_query[/COLOR][COLOR= #007700]))
            {[/COLOR]
            [COLOR= #0000BB]$cat_sql[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM woordenlijst WHERE id = "[/COLOR][COLOR= #007700].  (int)[/COLOR] [COLOR= #0000BB]$topic_info[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cat_id[/COLOR][COLOR= #007700]] .[/COLOR][COLOR= #DD0000]""[/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]

            [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]$cat_sql[/COLOR][COLOR= #007700]))
            {[/COLOR]
                [COLOR= #0000BB]$cat[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_fetch_assoc"]mysql_fetch_assoc[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$cat_sql[/COLOR][COLOR= #007700]);[/COLOR]

              [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000][/COLOR][COLOR= #007700].[/COLOR]htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$topic_info[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]woord[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000] - [/COLOR][COLOR= #007700].[/COLOR]htmlspecialchars[COLOR= #007700]([/COLOR][COLOR= #0000BB]$topic_info[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]antwoord[/COLOR][COLOR= #007700]]);

                    }
                }
            }[/COLOR]
       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]</textarea>[/COLOR][COLOR= #007700];[/COLOR]
       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000] <br /><strong><a href="overhoor?act=show&t=[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$topic_info[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]cat_id[/COLOR][COLOR= #007700]].[/COLOR][COLOR= #DD0000]">Overhoren</a></strong<br />[/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]Opgegeven id is niet numeriek![/COLOR][COLOR= #007700];    
         }
    }[/COLOR]
    [URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]inc/footer.php[/COLOR][COLOR= #007700];[/COLOR]
?>
0
Berichten
35.796
Reputatie
1
Punten
0,00
Lid sinds
Laatst gezien
Als je je code goed uitlijnt zie je (volgens mij yummie) dat je $topic_info buiten je loop gebruikt, wat je nooit moet doen, ookal werkt dat in de meeste gevallen wel gewoon. biggrin
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je hebt gelijk, Bedankt Lennaard biggrin
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