Teaxtarea

Gestart doorShahiem10 reacties38 weergaven

11 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 alle woorden en antwoorden moet uit de database gaan en dan in een textarea komen.

Maar dan krijg ik dit:
http://www.lerisranantongo.com/v1/woorden?act=show&t=1

Hoe los ik dit 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/ini_set"]ini_set[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]display_errors[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]On[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL[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]<h3>Leer de woorden</h3>[/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 * 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][COLOR= #DD0000]</textarea>[/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
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Shahiem schreef:
Ik heb een script maar alle woorden en antwoorden moet uit de database gaan en dan in een textarea komen.
Maar dan krijg ik dit:
http://www.lerisranantongo.com/v1/woorden?act=show&t=1

Hoe los ik dit 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/ini_set"]ini_set[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]display_errors[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]On[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/error_reporting"]error_reporting[/URL][COLOR= #007700]([/COLOR]E_ALL[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]<h3>Leer de woorden</h3>[/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 * 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/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
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dankje SjoerdsmileMaar hoe kan ik ze onderelkaar zetten zonder dat ik
zie.
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
enter emo?
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Waarom Brs gebruiken?
Je kan beter nl2br() gebruiken bij het oproepen om enters te krijgen!
0
Berichten
3.788
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
ik weet niet hoe jij het in de database zet, maar als dit via een textarea is moet je er GEEN
tussen laten zetten.
Gewoon erin zetten met enters, niet met codes.
Als je het dan oproept met:

nl2br($teskt);

Geeft hij gewoon enters
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
door ."n" erachter te zetten?
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Dat werkt niet. , Die van eleky ook niet.
0
Berichten
13.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
dan denk ik dat je hem op de verkeerde plek zet emo
0
Shahiem

Lid · Topicstarter

Berichten
20.364
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Op welke line moet hij dan staan
0
Berichten
431
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
n is de unix-variant, r is die van apple, windows gebruikt rn

mja, buiten de questie

Stel, je wil een enter in die textarea, dan zet je in de database dit, en exact dit (dus geen br)

Hier onder komt een enter
zie je wel?


In html is het idd
, maar in een textarea mogen geen tags...
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