Weergave na SELECT
wanneer ik volgende pagina uitvoer worden alle velden
mooi terug ingevuld behalve de velden "datum, problem en addi"
Wanneer ik op de variabelen "$datum, $problem en $addi" een echo
doe worden de waarden correct weergegeven...
Zie niet echt het probleem maar zal hoogstwaarschijnlijk iets heel
simpel zijn...
Iemand een idee?
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php include("../connect.php");
$record = $_POST['record'];
echo "Reference: $record<br><BR>";
$sql = "SELECT * FROM fi WHERE record='$record'";
$result = mysql_query($sql);
//echo "SQL: $sql";
$num = mysql_num_rows($result);
$i=0;
while ($i < $num) {
$record = mysql_result($result,$i,"record");
$datum = mysql_result($result,$i,"datum");
$title = mysql_result($result,$i,"title");
$problem = mysql_result($result,$i,"problem1");
$fl1 = mysql_result($result,$i,"fl1");
$fr1 = mysql_result($result,$i,"fr1");
$to1 = mysql_result($result,$i,"to1");
$dl1 = mysql_result($result,$i,"dl1");
$i1 = mysql_result($result,$i,"i1");
$px1 = mysql_result($result,$i,"px1");
$fl2 = mysql_result($result,$i,"fl2");
$fr2 = mysql_result($result,$i,"fr2");
$to2 = mysql_result($result,$i,"to2");
$dl2 = mysql_result($result,$i,"dl2");
$i2 = mysql_result($result,$i,"i2");
$px2 = mysql_result($result,$i,"px2");
$fl3 = mysql_result($result,$i,"fl3");
$fr3 = mysql_result($result,$i,"fr3");
$to3 = mysql_result($result,$i,"to3");
$dl3 = mysql_result($result,$i,"dl3");
$i3 = mysql_result($result,$i,"i3");
$px3 = mysql_result($result,$i,"px3");
$fl4 = mysql_result($result,$i,"fl4");
$fr4 = mysql_result($result,$i,"fr4");
$to4 = mysql_result($result,$i,"to4");
$dl4 = mysql_result($result,$i,"dl4");
$i4 = mysql_result($result,$i,"i4");
$px4 = mysql_result($result,$i,"px4");
$addi = mysql_result($result,$i,"addi");
$auth1 = mysql_result($result,$i,"auth1");
$auth2 = mysql_result($result,$i,"auth2");
echo"$problem";
echo"
<form action=save_fi4.php method=post name=frm_info id=frm_info >
<table width=653 border=1>
<tr>
<td width=173><strong><strong>Date</strong></td>
<td width=464><div align=center value=$datum></div></td>
</tr>
<tr>
<td width=173><strong><strong>Title</strong></td>
<td width=464><div align=left>
<input name=title type=text id=title size=74 value=$title />
</div></td>
</tr>
<tr>
<td width=173><strong>Problem situation</strong></td>
<td width=464> <textarea name=problem id=problem cols=74 rows=8 value=$problem></textarea></td>
</tr>
<tr>
<td><strong>Irregular operation</strong></td>
<td><table width=460 border=0>
<tr>
<td width=86><div align=left><strong>Flight</strong></div></td>
<td width=86><div align=left><strong>From</strong></div></td>
<td width=86><div align=left><strong>To</strong></div></td>
<td width=96><div align=center><strong>ACTION</strong></div></td>
<td width=72> <div align=left><strong>info</strong></div></td>
<td width=72><div align=left><strong>PAX</strong></div></td>
</tr>
<tr>
<td><input name=fl1 type=text id=fl1 size=14 value=$fl1 /></td>
<td><input name=fr1 type=text id=fr1 size=14 value=$fr1/></td>
<td><input name=to1 type=text id=to1 size=14 value=$to1/></td>
<td><select name=dl1 id=dl1>
<option>none</option>
<option value=DLA>delayed</option>
<option value=CNL>cancelled</option>
<option value=DIV>diverted</option>
</select>
</td><td><input name=i1 type=text id=i1 size=12 value=$i1 /></td>
<td><input name=px1 type=text id=px1 size=14 value=$px1 /></td>
</tr>
<tr>
<td><input name=fl2 type=text id=fl2 size=14 value=$fl2 /></td>
<td><input name=fr2 type=text id=fr2 size=14 value=$fr2 /></td>
<td><input name=to2 type=text id=to2 size=14 value=$to2 /></td>
<td><select name=dl2 id=dl2>
<option>none</option>
<option value=DLA>delayed</option>
<option value=CNL>cancelled</option>
<option value=DIV>diverted</option>
</select></td>
<td><input name=i1 type=text id=i1 size=12 value=$i2 /></td>
<td><input name=px2 type=text id=px2 size=14 value=$px2 /></td>
</tr>
<tr>
<td><input name=fl3 type=text id=fl3 size=14 value=$fl3 /></td>
<td><input name=fr3 type=text id=fr3 size=14 value=$fr3/></td>
<td><input name=to3 type=text id=to3 size=14 value=$to3/></td>
<td><select name=dl3 id=dl3>
<option>none</option>
<option value=DLA>delayed</option>
<option value=CNL>cancelled</option>
<option value=DIV>diverted</option>
</select></td>
<td><input name=i3 type=text id=i3 size=12 value=$i3 /></td>
<td><input name=px3 type=text id=px3 size=14 value=$px3 /></td>
</tr>
<tr>
<td><input name=fl4 type=text id=fl4 size=14 value=$fl4 /></td>
<td><input name=fr4 type=text id=fr4 size=14 value=$fr4 /></td>
<td><input name=to4 type=text id=to4 size=14 value=$to4 /></td>
<td><select name=dl4 id=dl4>
<option>none</option>
<option value=DLA>delayed</option>
<option value=CNL>cancelled</option>
<option value=DIV>diverted</option>
</select></td>
<td><input name=i4 type=text id=i4 size=12 value=$i4 /></td>
<td><input name=px4 type=text id=px4 size=14 value=$px4 /></td>
</tr>
</table></td>
</tr>
<tr>
<td><strong>Additional info</strong></td>
<td><textarea name=additional id=additional cols=74 rows=8 value=$addi></textarea></td>
</tr>
<tr>
<td><strong>Authors</strong></td>
<td><input type=text name=auth1 id=auth1 value=$auth1 />
&
<input type=text name=auth2 id=auth2 value=$auth2 /></td>
</tr>
</table>
<p>
<input type=submit name=button id=button value=Submit />
<input type=reset name=button2 id=button2 value=Reset />
</p>
</form>"
?>
$record = $_POST['record'];
echo "Reference: $record<br><BR>";
$sql = "SELECT * FROM fi WHERE record='$record'";
$result = mysql_query($sql);
//echo "SQL: $sql";
$num = mysql_num_rows($result);
$i=0;
while ($i < $num) {
$record = mysql_result($result,$i,"record");
$datum = mysql_result($result,$i,"datum");
$title = mysql_result($result,$i,"title");
$problem = mysql_result($result,$i,"problem1");
$fl1 = mysql_result($result,$i,"fl1");
$fr1 = mysql_result($result,$i,"fr1");
$to1 = mysql_result($result,$i,"to1");
$dl1 = mysql_result($result,$i,"dl1");
$i1 = mysql_result($result,$i,"i1");
$px1 = mysql_result($result,$i,"px1");
$fl2 = mysql_result($result,$i,"fl2");
$fr2 = mysql_result($result,$i,"fr2");
$to2 = mysql_result($result,$i,"to2");
$dl2 = mysql_result($result,$i,"dl2");
$i2 = mysql_result($result,$i,"i2");
$px2 = mysql_result($result,$i,"px2");
$fl3 = mysql_result($result,$i,"fl3");
$fr3 = mysql_result($result,$i,"fr3");
$to3 = mysql_result($result,$i,"to3");
$dl3 = mysql_result($result,$i,"dl3");
$i3 = mysql_result($result,$i,"i3");
$px3 = mysql_result($result,$i,"px3");
$fl4 = mysql_result($result,$i,"fl4");
$fr4 = mysql_result($result,$i,"fr4");
$to4 = mysql_result($result,$i,"to4");
$dl4 = mysql_result($result,$i,"dl4");
$i4 = mysql_result($result,$i,"i4");
$px4 = mysql_result($result,$i,"px4");
$addi = mysql_result($result,$i,"addi");
$auth1 = mysql_result($result,$i,"auth1");
$auth2 = mysql_result($result,$i,"auth2");
echo"$problem";
echo"
<form action=save_fi4.php method=post name=frm_info id=frm_info >
<table width=653 border=1>
<tr>
<td width=173><strong><strong>Date</strong></td>
<td width=464><div align=center value=$datum></div></td>
</tr>
<tr>
<td width=173><strong><strong>Title</strong></td>
<td width=464><div align=left>
<input name=title type=text id=title size=74 value=$title />
</div></td>
</tr>
<tr>
<td width=173><strong>Problem situation</strong></td>
<td width=464> <textarea name=problem id=problem cols=74 rows=8 value=$problem></textarea></td>
</tr>
<tr>
<td><strong>Irregular operation</strong></td>
<td><table width=460 border=0>
<tr>
<td width=86><div align=left><strong>Flight</strong></div></td>
<td width=86><div align=left><strong>From</strong></div></td>
<td width=86><div align=left><strong>To</strong></div></td>
<td width=96><div align=center><strong>ACTION</strong></div></td>
<td width=72> <div align=left><strong>info</strong></div></td>
<td width=72><div align=left><strong>PAX</strong></div></td>
</tr>
<tr>
<td><input name=fl1 type=text id=fl1 size=14 value=$fl1 /></td>
<td><input name=fr1 type=text id=fr1 size=14 value=$fr1/></td>
<td><input name=to1 type=text id=to1 size=14 value=$to1/></td>
<td><select name=dl1 id=dl1>
<option>none</option>
<option value=DLA>delayed</option>
<option value=CNL>cancelled</option>
<option value=DIV>diverted</option>
</select>
</td><td><input name=i1 type=text id=i1 size=12 value=$i1 /></td>
<td><input name=px1 type=text id=px1 size=14 value=$px1 /></td>
</tr>
<tr>
<td><input name=fl2 type=text id=fl2 size=14 value=$fl2 /></td>
<td><input name=fr2 type=text id=fr2 size=14 value=$fr2 /></td>
<td><input name=to2 type=text id=to2 size=14 value=$to2 /></td>
<td><select name=dl2 id=dl2>
<option>none</option>
<option value=DLA>delayed</option>
<option value=CNL>cancelled</option>
<option value=DIV>diverted</option>
</select></td>
<td><input name=i1 type=text id=i1 size=12 value=$i2 /></td>
<td><input name=px2 type=text id=px2 size=14 value=$px2 /></td>
</tr>
<tr>
<td><input name=fl3 type=text id=fl3 size=14 value=$fl3 /></td>
<td><input name=fr3 type=text id=fr3 size=14 value=$fr3/></td>
<td><input name=to3 type=text id=to3 size=14 value=$to3/></td>
<td><select name=dl3 id=dl3>
<option>none</option>
<option value=DLA>delayed</option>
<option value=CNL>cancelled</option>
<option value=DIV>diverted</option>
</select></td>
<td><input name=i3 type=text id=i3 size=12 value=$i3 /></td>
<td><input name=px3 type=text id=px3 size=14 value=$px3 /></td>
</tr>
<tr>
<td><input name=fl4 type=text id=fl4 size=14 value=$fl4 /></td>
<td><input name=fr4 type=text id=fr4 size=14 value=$fr4 /></td>
<td><input name=to4 type=text id=to4 size=14 value=$to4 /></td>
<td><select name=dl4 id=dl4>
<option>none</option>
<option value=DLA>delayed</option>
<option value=CNL>cancelled</option>
<option value=DIV>diverted</option>
</select></td>
<td><input name=i4 type=text id=i4 size=12 value=$i4 /></td>
<td><input name=px4 type=text id=px4 size=14 value=$px4 /></td>
</tr>
</table></td>
</tr>
<tr>
<td><strong>Additional info</strong></td>
<td><textarea name=additional id=additional cols=74 rows=8 value=$addi></textarea></td>
</tr>
<tr>
<td><strong>Authors</strong></td>
<td><input type=text name=auth1 id=auth1 value=$auth1 />
&
<input type=text name=auth2 id=auth2 value=$auth2 /></td>
</tr>
</table>
<p>
<input type=submit name=button id=button value=Submit />
<input type=reset name=button2 id=button2 value=Reset />
</p>
</form>"
?>
Overigens moet je ook je POST waarde nog beveiligen.
Gewijzigd op 01/10/2010 09:36:51 door - Dave -
en hou ook de vars buiten de quotes
- ; geplaatst
- ben even mezelf aan het verdiepen hoe ik POST waarden beveilig
Maar de 2 resterende waarden problem en addi worden nog niet weergegeven
in het formulier...
Edit:
En let hierbij ook goed op wanneer je variable tegenkomt.
En let hierbij ook goed op wanneer je variable tegenkomt.
Gewijzigd op 01/10/2010 11:12:04 door Bas IJzelendoorn
@ The rest:
Ok probleem is opgelost, nu zie ik een probleem dat ik eerder niet
had gemerkt.
Bij dit stuk code:
Code (php)
1
2
3
4
5
6
2
3
4
5
6
<tr>
<td width=173><strong><strong>Title</strong></td>
<td width=464><div align=left>
<input name=title type=text id=title size=74 value=$title />
</div></td>
</tr>
<td width=173><strong><strong>Title</strong></td>
<td width=464><div align=left>
<input name=title type=text id=title size=74 value=$title />
</div></td>
</tr>
geeft hij enkel de eerste 4 tekens weer van $title, terwijl als ik hem echo
de volledige titel wel getoond wordt...
Iemand een idee?
Gewijzigd op 01/10/2010 12:34:22 door Bas IJzelendoorn
wat ik echter niet snap is waarom je in regel 2, 2x <strong> hebt staan? (of niet afsluit)
Edit:
en waarom gebruik je tables en divjes? kies voor het overzicht het ene of het andere anders wordt het een chaos op den duur.
en waarom gebruik je tables en divjes? kies voor het overzicht het ene of het andere anders wordt het een chaos op den duur.
Gewijzigd op 01/10/2010 12:35:47 door Bas IJzelendoorn
dat is ook de bedoeling van zodra ik dit allemaal werkend krijg.
Nee vraag is eigenlijk simpel hoor.
Ik haal de waarde voor title uit men Dbase
bv:
$title ="hallo dit is mijn titel"
Nu als ik deze waarde wil weergeven in het inputveld title:
<input name=title type=text id=title size=74 value=$title />
Dan staat er in het title inputveld: "hall" ipv de hele zin.
Beetje duidelijker?
Code (php)
1
2
3
2
3
<?php
echo '<input name="title" type="text" id="title" size="74" value="'.$title.'" />';
?>
echo '<input name="title" type="text" id="title" size="74" value="'.$title.'" />';
?>
dit zal wel werken. Je hebt precies de fout te pakken. Als je niet gelijk goed begint met de quotes gaat het fout. Zorg dat je HTML klopt, maar ook je PHP. Achteraf kost altijd meer tijd dan hoe je nu te werk gaat. Tevens de kans is groot als je zo te werk gaat je hem niet eens werkend gaat krijgen.
Wat de quotes betreft, zijn deze verplicht want de andere variabelen worden
wel perfect ingelezen zonder quotes te gebruiken...
moet iets? nee, niks moet!
-> wat is handig?
-> wat is het beste?
-> wat is verstandig?
Jij bent ook niet verplicht om voor het rode stoplicht te stoppen, of moet dit. Dat bepaal jij zelf. Dat gaat namelijk ook 4x goed, helaas de vijfde keer kwam de vrachtwagen van verkeersongelukken B.V. voorbij.