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
<?php
include('../includes/cms.config.php');
require_once('login.php');
## Get MySql DB Settings
session_start();
$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>";
include("product.php");
exit();
}
/*
//check to see if the file is an image
if(!ereg("image",$_FILES['pictureFile']['type'])){
echo "<b>File is not a picture. Please try another
file.</b><br>";
include("product.php");
exit();
}
else */
{
[B]//$destination = './images'."/".$_FILES['pictureFile']['name'];
$destination = "./images/".$_FILES['pictureFile']['name'];
$temp_file = $_FILES['pictureFile']['tmp_name'];
@move_uploaded_file($temp_file,$destination);[/B]
//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')";