Fout op pagina op een regel+
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
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
<?php
//html, body
echo '<html><title>Admin Add staff Page</title></html>';
echo '<body bgcolor="#262626">';
$id=$_GET[id];
$mysql_id = mysql_connect("localhost", "XXXXXX", "XXXXXXXX");
mysql_select_db("XXXXXXX",$mysql_id);
$sql="SELECT * FROM staff WHERE id='$id'";
$res = mysql_query("$sql", $mysql_id);
$row=mysql_fetch_row($res);
$res = mysql_query ($sql) or die (mysql_error ());
if (mysql_num_rows ($res) >= 1)
{
while ($row = mysql_fetch_array ($res))
{
echo "
<form method='POST' action='editstaffp3.php?"; echo $row['id']; echo"'>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Name</font></u></b>
<br>
<input type='text' name='name' size='60' value='"; echo $row['name']; echo"'>
<br>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Country</font></u></b>
<br>
<select name='flag' size='1'><option value='au'>Australia</option><option value='at'>Austria</option><option value='be'>Belgium</option><option value='ca'>Canada</option><option value='ee'>Estonia</option><option value='fi'>Finland</option><option value='fr'>France</option><option value='de'>Germany</option><option value='gr'>Greece</option><option value='ie'>Ireland</option><option value='it'>Italy</option><option value='lv'>Latvia</option><option value='lu'>Luxembourg</option><option value='nl'>Netherlands</option><option value='no'>Norway</option><option value='pl'>Poland</option><option value='es'>Spain</option><option value='se'>Sweden</option><option value='ch'>Switzerland</option><option value='tr'>Turkey</option><option value='uk'>United Kingdom</option><option value='us'>USA</option></select>
<br>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Alt</font></u></b>
<br>
<input type='text' name='alt' size='70'>
<br>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Age</font></u></b>
<br>
<input type='text' name='age' size='70' value='"; echo $row['age']; echo"'>
<br>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Real Name</font></u></b>
<br>
<input type='text' name='rname' size='70' value='"; echo $row['rname']; echo"'>
<br>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Sex</font></u></b>
<br>
<input type='text' name='sex' size='70' value='"; echo $row['sex']; echo"'>
<br>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Email</font></u></b>
<br>
<input type='text' name='email' size='70' value='"; echo $row['email']; echo"'>
<br>
<input type='submit' name='submit' value='Edit staff' size='20'>";
echo '<br><a href="indexr.php" style="text-decoration: none"><font face="Verdana" size="2" color="#FFFFFF">Back to index</font></a></body></html>';
?>
//html, body
echo '<html><title>Admin Add staff Page</title></html>';
echo '<body bgcolor="#262626">';
$id=$_GET[id];
$mysql_id = mysql_connect("localhost", "XXXXXX", "XXXXXXXX");
mysql_select_db("XXXXXXX",$mysql_id);
$sql="SELECT * FROM staff WHERE id='$id'";
$res = mysql_query("$sql", $mysql_id);
$row=mysql_fetch_row($res);
$res = mysql_query ($sql) or die (mysql_error ());
if (mysql_num_rows ($res) >= 1)
{
while ($row = mysql_fetch_array ($res))
{
echo "
<form method='POST' action='editstaffp3.php?"; echo $row['id']; echo"'>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Name</font></u></b>
<br>
<input type='text' name='name' size='60' value='"; echo $row['name']; echo"'>
<br>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Country</font></u></b>
<br>
<select name='flag' size='1'><option value='au'>Australia</option><option value='at'>Austria</option><option value='be'>Belgium</option><option value='ca'>Canada</option><option value='ee'>Estonia</option><option value='fi'>Finland</option><option value='fr'>France</option><option value='de'>Germany</option><option value='gr'>Greece</option><option value='ie'>Ireland</option><option value='it'>Italy</option><option value='lv'>Latvia</option><option value='lu'>Luxembourg</option><option value='nl'>Netherlands</option><option value='no'>Norway</option><option value='pl'>Poland</option><option value='es'>Spain</option><option value='se'>Sweden</option><option value='ch'>Switzerland</option><option value='tr'>Turkey</option><option value='uk'>United Kingdom</option><option value='us'>USA</option></select>
<br>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Alt</font></u></b>
<br>
<input type='text' name='alt' size='70'>
<br>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Age</font></u></b>
<br>
<input type='text' name='age' size='70' value='"; echo $row['age']; echo"'>
<br>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Real Name</font></u></b>
<br>
<input type='text' name='rname' size='70' value='"; echo $row['rname']; echo"'>
<br>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Sex</font></u></b>
<br>
<input type='text' name='sex' size='70' value='"; echo $row['sex']; echo"'>
<br>
<b><u><font face='Verdana' size='1' color='#FFFFFF'>Email</font></u></b>
<br>
<input type='text' name='email' size='70' value='"; echo $row['email']; echo"'>
<br>
<input type='submit' name='submit' value='Edit staff' size='20'>";
echo '<br><a href="indexr.php" style="text-decoration: none"><font face="Verdana" size="2" color="#FFFFFF">Back to index</font></a></body></html>';
?>
en hij geeft dit als error:
Warning: Unknown(/usr/home/fh2028/domains/tdkclan.com/public_html/sites/Project1/admin/editstaffp2.php): failed to open stream: Permission denied in Unknown on line 0
Warning: Unknown(/usr/home/fh2028/domains/tdkclan.com/public_html/sites/Project1/admin/editstaffp2.php): failed to open stream: Permission denied in Unknown on line 0
Warning: Unknown(/usr/home/fh2028/domains/tdkclan.com/public_html/sites/Project1/admin/editstaffp2.php): failed to open stream: Permission denied in Unknown on line 0
Warning: (null)(): Failed opening '/usr/home/fh2028/domains/tdkclan.com/public_html/sites/Project1/admin/editstaffp2.php' for inclusion (include_path='.:/usr/local/lib/php') in Unknown on line 0
WTF???!!
hoe kan dat?
wat moet ik doen?
answer asap please
jens
Gewijzigd op 01/01/1970 01:00:00 door Jens V
Parse error: parse error, unexpected $ in /usr/home/fh2028/domains/tdkclan.com/public_html/sites/Project1/admin/editstaffp2.php on line 56
De parse error houdt in dat je ergens een echo niet hebt afgesloten met een ; of iets dergelijks.
edit:
oftewel: je hebt een while bijvoorbeeld niet afgesloten met een accolade } ;)
Gewijzigd op 01/01/1970 01:00:00 door Winston Smith
geen rechten
parse error, unexpected $
typefout, waarschijnlijk } of { oid vergeten
greetz
Inderdaad Lissy!
ik ondervind er geen hinder van dat ie er niet tussen staat...
lissy:
Tenzij id een integer is, dan hoeft het weer niet. Met quotes wordt het namelijk een string.
Bedankt Kasper dit was weer effies weggezakt....
Kasper:
Tenzij id een integer is, dan hoeft het weer niet. Met quotes wordt het namelijk een string.
lissy:
[..]
Tenzij id een integer is, dan hoeft het weer niet. Met quotes wordt het namelijk een string.
Dat is voor mij ook nieuw, ookal denk ik niet dat je er standaard van uit mag gaan dat het een integer is.
Maar een id is over het algemeen wel een integer.