im having a problem with my code in uploading and displaying images.. well I am planning to redirect the page after the upload process is done so I used a header function but gave warning and errors and unfortunately failed the upload.. how can I remove it? here's the code..
<?php 
//connect to the database//
$con = mysql_connect("localhost","root", "");
if(!$con)
{
 die('Could not connect to the database:' . mysql_error());
 echo "ERROR IN CONNECTION";
}
 $sel = mysql_select_db("imagedatabase");
if(!$sel)
{
die('Could not connect to the database:' . mysql_error());
echo "ERROR IN CONNECTION";
}
//file properties//
$file = $_FILES['image']['tmp_name']; 
echo '<br />';
 /*if(!isset($file))
    echo "Please select your images";
else
{
 */for($count = 0; $count < count($_FILES['image']); $count++)
{
//$image = file_get_contents($_FILES['image']['tmp_name']);
$image_desc[$count] = addslashes($_POST['imageDescription'][$count]);
$image_name[$count] = addslashes($_FILES['image]']['name'][$count]); echo '<br \>';
$image_size[$count] = @getimagesize($_FILES['image']['tmp_name'][$count]);
$error[$count] = $_FILES['image']['error'][$count];
if($image_size[$count] === FALSE  || ($image_size[$count]) == 0)
    echo "That's not an image";
else
{
// Temporary file name stored on the server
 $tmpName[$count]  = $_FILES['image']['tmp_name'][$count];
  // Read the file
   $fp[$count]   = fopen($tmpName[$count], 'r');
   $data[$count] = fread($fp[$count], filesize($tmpName[$count]));
   $data[$count] = addslashes($data[$count]);
   fclose($fp[$count]);
 // Create the query and insert
 // into our database.
 $results = mysql_query("INSERT INTO images( description, image) VALUES                 ('$image_desc[$count]','$data[$count]')", $con);
    if(!$results)
    echo "Problem uploding the image. Please check your database";  
   //else 
   //{
      echo "";
    //$last_id = mysql_insert_id();
    //echo "Image Uploaded. <p /> <p /><img src=display.php?    id=$last_id>";
    //header('Lcation: display2.php?id=$last_id');
        }
     //}
}
mysql_close($con);
header('Location: fGallery.php');
?>
the header function supposedly directs me to another page that would make a gallery.. here is the code..
<?php
//connect to the database//
    mysql_connect("localhost","root", "") or die(mysql_error());
    mysql_select_db("imagedatabase") or die(mysql_error());
    //requesting image id
    $image = mysql_query("SELECT * FROM images ORDER BY id DESC");
    while($row = mysql_fetch_assoc($image))
    {
         foreach ($row as $img) echo '<img src="img.php?id='.$img["id"].'">';
    }
    mysql_close();
?>
I have also a problem with my gallery .. some help will be GREAT! THANKS! :D
 
     
     
    