I have a created a page to upload images. Can someone please help me. When when I click on browse I would like the picture to go on the server and not change the image name. just to upload the image as it is. please help




## Get MySql DB Settings
$dbconn = mysql_connect($server,$user,$password) or die('Cannot connect');
mysql_select_db($db) or die('Cannot select db');

if ((isset($_GET['cat']) or isset($_POST['cat']))){
if (($_GET['cat']=="Add Product")or($_POST['cat']=="Add Product")){
if (isset($_POST['product'])){

$pname = $_POST['product'];
$pcode = $_POST['productcode'];
//$pimage = $_POST['image'];
$pcat = $_POST['category'];
$pdesc = $_POST['fulldesc'];
$prank = $_POST['rank'];
$pprice = $_POST['price'];
$today = date("Y/m/d");

        if($_FILES['pictureFile']['tmp_name'] == "none"){
            echo "<b>File did not successfully upload. Check the
            file size. File must be less than 500K.<br>";
        //check to see if the file is an image
            echo "<b>File is not a picture. Please try another
        else */
                        [B]//$destination = './images'."/".$_FILES['pictureFile']['name'];
                       $destination = "./images/".$_FILES['pictureFile']['name'];
          $temp_file = $_FILES['pictureFile']['tmp_name'];

            //get the values
            $pimage = $_FILES['pictureFile']['name'];

            $query = "INSERT INTO tblproduct (`ProductCode`,`Date`,`ProductName`, `Image`, `Category`, `ProductDescription`, `Rank`, `Price`) VALUES ('$pcode','$today','$pname','$pimage','$pcat','$pdesc','$prank','$pprice')";

What is the error ?
$pimage is null ! If you want the image name to be inserted to the table, you should insert $_FILES.

All i need is help to to just move the pic to the webserver. For some reason the image doesnt want to be moved:icon_cry:

Umm.. Do you have enctype in the form ? Are you sure image is getting posted ? Check for permissions of the destination directory. Remove @ before move_uploaded_file, as @ supress any error message.

Edit: Btw, many of your if and else { are not closed. Have you disabled error reporting ?