i have echo the output right up to line 31 as soon as else brackets nothing else get the error message syntax error, unexpected T_ELSE in C:\wamp2\www\project\send.php on line 31
I HAVE INDENTED BUT YAHOO CANCELS SO SORRY IF CODE APPEARS HARD TO READ
<?php
if(isset($_FILES['image_file']))
{
mysql_connect("localhost","root","") or die (mysql_error());
mysql_select_db("databaseimage")or die (mysql_error());
$file = $_FILES['image_file']['tmp_name'];
echo $file;
if (!isset($file))
echo "please select a image ";
else
{
$image = file_get_contents($_FILES['image_file']['tmp_name']);
$image_name = $_FILES['image_file']['name'];
$image_size = getimagesize($_FILES['image_file']['tmp_name']);
echo $image_name;
if ( $image_size == FALSE)
echo " thats not an image";
else
{
if (!$insert = mysql_query("INSERT INTO store VALUES ('','$image_name','$image')"));
echo " prob upload ";
}
THIS IS LINE 31 else
{
SOON AS ENTER THIS ELSE AND THESE CURLER BRACKETS
I GET THE ERROR
}
}
}/*end of if checking seeing if file as been recieved*/
else
{
echo 'Error! No ID was passed.';
}
THE CODE WHICH IS TO GO LINE 31 IS
else
{
$lastid = mysql_insert_id();
echo"image uploaded . <p />your image <p /><img src=get.php?id=$lastid>";
}
LINE 31 IS 16 LINES UP FROM THE BOTTOM HAVE WROTE IN CAPS
THIS IS LINE 31 else
{
SOON AS ENTER THIS ELSE AND THESE CURLER BRACKETS
I GET THE ERROR
}
}
}/*end of if checking seeing if file as been recieved*/
else
{
echo 'Error! No ID was passed.';
}
THE CODE WHICH IS TO GO LINE 31 IS
else
{
$lastid = mysql_insert_id();
echo"image uploaded . <p />your image <p /><img src=get.php?id=$lastid>";
}
I HAVE INDENTED BUT YAHOO CANCELS SO SORRY IF CODE APPEARS HARD TO READ
<?php
if(isset($_FILES['image_file']))
{
mysql_connect("localhost","root","") or die (mysql_error());
mysql_select_db("databaseimage")or die (mysql_error());
$file = $_FILES['image_file']['tmp_name'];
echo $file;
if (!isset($file))
echo "please select a image ";
else
{
$image = file_get_contents($_FILES['image_file']['tmp_name']);
$image_name = $_FILES['image_file']['name'];
$image_size = getimagesize($_FILES['image_file']['tmp_name']);
echo $image_name;
if ( $image_size == FALSE)
echo " thats not an image";
else
{
if (!$insert = mysql_query("INSERT INTO store VALUES ('','$image_name','$image')"));
echo " prob upload ";
}
THIS IS LINE 31 else
{
SOON AS ENTER THIS ELSE AND THESE CURLER BRACKETS
I GET THE ERROR
}
}
}/*end of if checking seeing if file as been recieved*/
else
{
echo 'Error! No ID was passed.';
}
THE CODE WHICH IS TO GO LINE 31 IS
else
{
$lastid = mysql_insert_id();
echo"image uploaded . <p />your image <p /><img src=get.php?id=$lastid>";
}
LINE 31 IS 16 LINES UP FROM THE BOTTOM HAVE WROTE IN CAPS
THIS IS LINE 31 else
{
SOON AS ENTER THIS ELSE AND THESE CURLER BRACKETS
I GET THE ERROR
}
}
}/*end of if checking seeing if file as been recieved*/
else
{
echo 'Error! No ID was passed.';
}
THE CODE WHICH IS TO GO LINE 31 IS
else
{
$lastid = mysql_insert_id();
echo"image uploaded . <p />your image <p /><img src=get.php?id=$lastid>";
}