PHP Image not uploaded to website
<p>On my website I have 2 separate places for users to upload an image.  The first works perfectly.  The second doesn't.  As far as I can see, they are exactly the same.  To test, I used the same image on both, with it working on the first, but not the second.  Here is the code from the non-working one:</p>

<pre><code>&lt;?php
include('cn.php');

$name = $_FILES['image']['name'];
$type = $_FILES['image']['type'];
$size = $_FILES['image']['size'];
$temp = $_FILES['image']['tmp_name'];
$error = $_FILES['image']['error'];

echo $name; //Doesnt echo anything

$rand_num = rand(1, 1000000000);

$name = $rand_num . "_" . $name;

echo $name; //Echos just the random number followed by _

if ($error &gt; 0) { 
    die("Error uploading file! Go back to the &lt;a href='gallery.php'&gt;gallery&lt;/a&gt; page and try again.");
} else {
    $sql = "INSERT INTO gallery (image) VALUES ('".$name."')"; //Inserts the random number to the database
    $query = mysql_query($sql) or die(mysql_error());
    echo $sql; 

    move_uploaded_file($temp, "gallery_pics/$name"); //Doesn't move the file.  gallery_pics exists, if that matters
    echo "Upload complete! Go back to the &lt;a href='gallery.php'&gt;album&lt;/a&gt;.";
}

?&gt;
</code></pre>

<p>If someone could please help me out here.  I am sure it is something simple, but I have yet to find anything that helped.  Thanks!</p>

<p>EDIT: There are two lines above the code that won't show up properly.  One starts the php and the other opens the database.</p>
