I changed some things.
At the moment he gives thid error.
Parse error: parse error, unexpected T_VARIABLE in /home/virtual/site185/fst/var/www/html/fotoboek.php on line 110
My php code is this:
(wich is accesed through index.php?id=fotoboek)
<?php
if ($lc = "")
{
echo <<< EOHTML
<a href="fotoboek.php?lc=write">Schrijf in het gastenboek</a>
<table align="center" cellspacing="0" cellpadding="0" border="1" width="80%">
<tr>
<td bgcolor="black"><font color="white">Datum</td>
<td bgcolor="black"><font color="white">Naam</td>
<td bgcolor="black"><font color="white">E-mail</td>
<td bgcolor="black"><font color="white">Woonplaats</td>
<td bgcolor="black"><font color="white">Foto</td>
</tr>
EOHTML;
mysql_connect("localhost","ussr","pw");
mysql_select_db('dbname');
$sql="SELECT * FROM fotoboek ORDER BY date";
$res=mysql_query($sql);
while ($ligne = mysql_fetch_object ($res))
{
print "<tr>";
print "<td>$ligne->date</td>";
print "<td>$ligne->name</td>";
print "<td>$ligne->email</td>";
print "<td>$ligne->city</td>";
print "<td><img src=\"$ligne->img\" width=\"200\"></td>";
print "</tr>";
}
mysql_free_result ($res);
echo <<< EOHTML
</table>
<a href="fotoboek.php?lc=write">Schrijf in het gastenboek</a>
EOHTML;
}
else if ($lc = "write")
{
echo <<< EOHTML
<form method="post" action="fotoboek.php?lc=post">
<input type="hidden" name="MAX_FILE_SIZE" value="5000">
<div align="left">
<table border="0" cellspacing="1" width="100">
<tr>
<td>Naam </td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td>E-mail</td>
<td><input type="email" name="email"></td>
</tr>
<tr>
<td>
Woonplaats</td>
<td><input type="text" name="city"></td>
</tr>
<tr>
<td>Foto </td>
<td><input type="file" name="img"></td>
</tr>
<tr>
<td></td>
<td>
<p align="center">
<input type="submit" name=" Stuur in " value="Send">
</td>
</tr>
</table>
</div>
</form>
EOHTML;
}
else if ($lc = "post")
{
$continu = 1;
if ($name == "")
{
print ("We hebben je naam nodig ! <br>");
$continu = 0 ;
}
if ($email == "")
{
print ("We hebben je email nodig ! <br>");
$continu = 0 ;
}
if ($city == "")
{
print ("We hebben je woonplaats nodig ! <br>");
$continu = 0 ;
}
if ($img == "")
{
print ("We hebben een plaatje nodig ! <br>");
$continu = 0 ;
}
if ($continu == 1)
{
$tmpfile = $_FILES["img"]["name"];
if(!file_exists($tmpfile))
{
move_uploaded_file($_FILES['img']['tmp_name'], $tmpfile);
}
else
{
print 'Een plaatje met deze naam is al geupload.<br>Geef het plaatje een andere naam';
}
mysql_connect("localhost","ussr","pw");
mysql_select_db('dbname");
$date=date("Y-m-d");
$fname=$_FILES["img"]["name"];
$sql="INSERT INTO fotoboek (name, email, date, city, img) VALUES ('$name', '$email', '$date', '$city', '$fname')";
mysql_query($sql);
}
?>
In the script structure he first will show me all inserted texts...
But he gives an direct error.