hi guys i am a total newbieeeee but ive managed to get my app nearly all working
i have a form which inputs data to my sql db and puts the 'name' into my sql feild but i cant get the actual image to upload to my server ive tried a few scripts but no joy 😕
this is what im using big thx to all who post...:queasy: :o
<?php
include('config.php');
include('opendb.php');
$target = "images/";
$target = $target . basename( $_FILES['photo']['name']);
$pic=($_FILES['photo']['name']);
if(move_uploaded_file($_FILES['photo']['tmp_name'], $target))
{
//Tells you if its all ok
echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded, and your information has been added to the directory";
}
if($post=="edit"){
$name = addslashes($name);
$query = "UPDATE employeez SET name='$name', phone='$phone', email='$email' , photo='$pic' WHERE id='$id'";
$result = mysql_query($query) or die(mysql_error());
Header("Location: edit.php");
}
if($post=="add"){
$name = addslashes($name);
$query = "INSERT INTO employeez SET name='$name', phone='$phone', email='$email', photo='$pic' ";
$result = mysql_query($query) or die(mysql_error());
Header("Location: edit.php");
}
if($type=="del"){
$query = "DELETE FROM employeez WHERE id='$id'";
$result = mysql_query($query) or die(mysql_error());
Header("Location:edit.php");
}
?>