Nieuws systeem Vraagje
Maar er zit een probleem in voor html/enter
ik wil namelijk een enter doen blijkt het dat je <br /> moet doen
maar kan hoe kan ik dat oplossen
dis de code:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
echo 'Gelukt';
$sql_query = "
INSERT INTO nieuws
SET
Titel = '".mysql_real_escape_string ($_POST['Titel'])."',
Auteur = '".mysql_real_escape_string ($_POST['Auteur'])."',
Bericht = '".mysql_real_escape_string ($_POST['Bericht'])."'";
if (!$result = mysql_query($sql_query)) {
echo '<pre>';
echo htmlentities (str_replace ("\t", '', $sql_query));
trigger_error (mysql_errno () . ': ' . mysql_error ());
echo '</pre>';
}
}
?>
<form action="" method="post">
<table width=410" border="0" align="center" cellspacing="0" cellpadding="0">
<tr>
<td height="5"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="5" bgcolor="CCCCCC">
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="4"> </td>
<td>Nieuwsysteem V1</td>
<td width="4"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="E7EBEF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4"> </td>
<td width="120" align="left">Titel</td>
<td width="274" align="right"><input type="text" name="Titel" size="30"></td>
<td width="12"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="E7EBEF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4"> </td>
<td width="120" align="left">Auteur</td>
<td width="274" align="right"><input type="text" name="Auteur" size="30"></td>
<td width="12"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="E7EBEF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4"> </td>
<td width="120" align="left">Bericht</td>
<td width="274" align="right">
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p><textarea rows="5" name="Bericht" cols="20"><br></textarea></p>
</form>
Er staat standaar <BR> laat dat staan !</td>
<td width="12"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="5"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="30" align="left" bgcolor="#E7EBEF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4"> </td>
<td width="197" align="left"> </td>
<input type="hidden" value="1" name="afhandeling">
<td width="197" align="right"><input type="submit" value="Voeg toe" name="submit"></td>
<td width="12"> </td>
</tr>
</table>
</td>
</tr>
</form>
</table>
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
echo 'Gelukt';
$sql_query = "
INSERT INTO nieuws
SET
Titel = '".mysql_real_escape_string ($_POST['Titel'])."',
Auteur = '".mysql_real_escape_string ($_POST['Auteur'])."',
Bericht = '".mysql_real_escape_string ($_POST['Bericht'])."'";
if (!$result = mysql_query($sql_query)) {
echo '<pre>';
echo htmlentities (str_replace ("\t", '', $sql_query));
trigger_error (mysql_errno () . ': ' . mysql_error ());
echo '</pre>';
}
}
?>
<form action="" method="post">
<table width=410" border="0" align="center" cellspacing="0" cellpadding="0">
<tr>
<td height="5"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="5" bgcolor="CCCCCC">
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="4"> </td>
<td>Nieuwsysteem V1</td>
<td width="4"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="E7EBEF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4"> </td>
<td width="120" align="left">Titel</td>
<td width="274" align="right"><input type="text" name="Titel" size="30"></td>
<td width="12"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="E7EBEF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4"> </td>
<td width="120" align="left">Auteur</td>
<td width="274" align="right"><input type="text" name="Auteur" size="30"></td>
<td width="12"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left" valign="top" bgcolor="E7EBEF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4"> </td>
<td width="120" align="left">Bericht</td>
<td width="274" align="right">
<form method="POST" action="--WEBBOT-SELF--">
<!--webbot bot="SaveResults" U-File="fpweb:///_private/form_results.csv" S-Format="TEXT/CSV" S-Label-Fields="TRUE" -->
<p><textarea rows="5" name="Bericht" cols="20"><br></textarea></p>
</form>
Er staat standaar <BR> laat dat staan !</td>
<td width="12"> </td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="5"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
<tr>
<td height="30" align="left" bgcolor="#E7EBEF">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="4"> </td>
<td width="197" align="left"> </td>
<input type="hidden" value="1" name="afhandeling">
<td width="197" align="right"><input type="submit" value="Voeg toe" name="submit"></td>
<td width="12"> </td>
</tr>
</table>
</td>
</tr>
</form>
</table>
<br /> plaatsen op de plek waar je die enter wil.
nl2br() zoekt.
De vraagstelling is me niet helemaal duidelijk maar ik denk dat je de functie ja maar we hebben mods die geen html kunnen en die willen gewn een enter kunnen gebruiken
Pepijn --- op 31/05/2012 19:55:35:
ja maar we hebben mods die geen html kunnen en die willen gewn een enter kunnen gebruiken
nl2br() he?
Die maakt van elke ENTER in je textfield een <br />
En dat helemaal automagisch....
Uiteraard alleen bij de output/uitvoer gebruiken.
Evn vor de duidelikheid nl2br die 2 staat vor two ok wel to, nl to br is vertald nl naar br, nl is New Line en br is BReak.