im having problem saving a FILE, i doesn't save the extension name of the file and doesn't save also the images in my folder..? can you kindly look , what is my problem with my FILE code?

only in FILE SAVE, i dont have errors in my other fields.

<?php 
			include("connect.php");
			if(isset($_POST['submit']))
			{
			
	$f=$_FILES['pic']['name'];/*<----------------- here's my code*/
			
		mysql_query("insert into teacher(staffid,password,lastname,firstname,middlename,contactno,religion,birthdate,address,handle,datehired,status,pic)VALUES('$_POST[staffid]',
'$_POST[pass]',
'$_POST[lname]',
'$_POST[fname]',
'$_POST[mname]',
'$_POST[contactno]',
'$_POST[religion]',
'$_POST[birthdate]',
'$_POST[address]',
'$_POST[handle]',
'$_POST[dhired]',
'$_POST[status],$f");/*<-----------------here's my code*/
				move_uploaded_file($_FILES['pic']['tmp_name'], "files/".$f);  /*<----------------- here's my code*/ 
				$msg="New Record Added!";	
				}
		?>

Hi,

try "chmod o+rw" your files dir :)


Best regards,
zagal

Member Avatar for diafol

show your form - does it have an enctype attribute?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.