Textarea

Gestart doorOne2xs20 reacties66 weergaven

21 berichten · pagina 2 van 2

Berichten
5.897
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Je moet niet bij het invoegen nlbr gebruiken, maar bij het echoën
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Maartenl schreef:
Je moet niet bij het invoegen nlbr gebruiken, maar bij het echoën
Kan jij het script aanpassen hoe het dan moet zijn?
0
Berichten
5.957
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Na die addslashes denk ik.
Ha nvm yummie
0
Berichten
10.421
Reputatie
4
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [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] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verzenden[/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]"
INSERT INTO pb (bericht) VALUES ("[/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]bericht[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]) {[/COLOR]
       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]E-mail verzonden[/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]"Fout: "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
    }
}[/COLOR] [URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
  ?>
<form action=" index.php?p=inbox_toevoegen " method="POST">
<table>
                  <tr>
                    <td width="28%" valign="top"><span><strong>Bericht:</span></strong></td>
                    <td width="72%" height="77" ><textarea rows="4" name="bericht" cols="30"></textarea></td>
                  </tr>
                  <tr>
                    <td width="100%" colspan="2">
                      <p align="center"><input class="submit" type="submit" value="Verzenden" name="verzenden"></td>
                  </tr>
                </table>
</form>                    
[COLOR= #0000BB]<?php[/COLOR]
  [COLOR= #007700]}[/COLOR]
?>


En als je de data uit je database weer toont, dan gebruik je

echo nl2br($data[bericht]); // hoe jij maar je bericht op haalt, in dit voorbeeld $data[bericht]
0
One2xs

Bot · Topicstarter

Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
Aarclay schreef:
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [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] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verzenden[/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]"
INSERT INTO pb (bericht) VALUES ("[/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]bericht[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]")"[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$result[/COLOR][COLOR= #007700]) {[/COLOR]
       [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]E-mail verzonden[/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]"Fout: "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
    }
}[/COLOR] [URL="http://www.php.net/else"]else[/URL][COLOR= #007700]{[/COLOR]
  ?>
<form action=" index.php?p=inbox_toevoegen " method="POST">
<table>
                  <tr>
                    <td width="28%" valign="top"><span><strong>Bericht:</span></strong></td>
                    <td width="72%" height="77" ><textarea rows="4" name="bericht" cols="30"></textarea></td>
                  </tr>
                  <tr>
                    <td width="100%" colspan="2">
                      <p align="center"><input class="submit" type="submit" value="Verzenden" name="verzenden"></td>
                  </tr>
                </table>
</form>                    
[COLOR= #0000BB]<?php[/COLOR]
  [COLOR= #007700]}[/COLOR]
?>
En als je de data uit je database weer toont, dan gebruik je

echo nl2br($data[bericht]); // hoe jij maar je bericht op haalt, in dit voorbeeld $data[bericht]


Oke, bedankt!
0
Thom

Lid

Berichten
10.654
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL] [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] [URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]verzenden[/COLOR][COLOR= #007700]]))
{[/COLOR]
 
    [COLOR= #0000BB]$bericht[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/nl2br"]nl2br[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]bericht[/COLOR][COLOR= #007700]]);[/COLOR] 
    [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO pb (bericht) VALUES ("[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$bericht[/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/echo"]echo[/URL] [COLOR= #DD0000]E-mail verzonden[/COLOR][COLOR= #007700];
    
}[/COLOR] 
[URL="http://www.php.net/else"]else[/URL] 
[COLOR= #007700]{[/COLOR]
  ?>
<form action=" index.php?p=inbox_toevoegen " method="POST">
<table> 
                  <tr> 
                    <td width="28%" valign="top"><span><strong>Bericht:</span></strong></td> 
                    <td width="72%" height="77" ><textarea rows="4" name="bericht" cols="30"></textarea></td> 
                  </tr> 
                  <tr> 
                    <td width="100%" colspan="2"> 
                      <p align="center"><input class="submit" type="submit" value="Verzenden" name="verzenden"></td> 
                  </tr> 
                </table> 
</form>

                           

[COLOR= #0000BB]<?[/COLOR] 
  [COLOR= #007700]}[/COLOR] 
?>


zo?
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