php - XAMPP why is my else bug? -
evertime load page get
parse error: syntax error, unexpected ')' in c:\xampp\htdocs\zerowebsite\uploadtest.php on line 19
<html> <head> <title></title> </head> <body> <form action="uploadtest.php" method="post" enctype="multipart/form-data"> <input type="file" name="image"> <input type="submit" value="upload"> </form> <?php mysql_connect("localhost","root","") or die(mysql_error()); mysql_select_db("dataimage") or die (mysql_error()); $file = $_files['image']['tmp_name']); if (!isset($file)) echo "select image"; else // line 19 { $image = addslashes(file_get_contents($_files['image']['tmp_name'])); $image_name = addslashes($_files['image']['name']); $image_size = getimagesize($_files['image']['tmp_name']); if ($image_size==false) echo "not image."; else { if (!$insert = mysql_query("insert myimage values ('','@image_name','$image')")) echo "problem uploading image."; else { $lastid = mysql_insert_id(); echo "image uploaded.<p /> image:<p />img src=uploadtest2.php?id=lastid>"; } } }?> </body> </html>
i fund guide on youtube wanna make work plzz show me
$file = $_files['image']['tmp_name']);
must
$file = $_files['image']['tmp_name'];
Comments
Post a Comment