oh okey..this is my code :-)
<?php
include('search.conf.php');
$namefile_name = str_replace(' ', '_', $_FILES['namefile']['name']);
if($namefile == "" && $author == "" && $keyword == "")
{
header ("Location : index.php");
exit ();
}
if($namefile == "")
{
echo("No file is save!");
exit ();
}
if($author == "")
{
echo("Please insert the author name");
exit ();
}
if($keyword == "")
{
echo("Please insert the keyword");
exit ();
}
$query=mysql_query("INSERT INTO tbl_search
(keyword,namefile,date,author) values
('$keyword','$namefile_name',NOW(),'$author')");
/***************************
file upload
***************************/
if (copy($namefile,"files/$namefile_name"));
{
$finish=mysql_query("UPDATE tbl_keyword SET namefile
='$namefile_name' WHERE id='$id' ");
echo ("File save<br>");
unlink($namefile);
}
exit;
?>
I already done this and every time i uploaded a file that had a space,it will be replcing the space with underscore. But could it done by not changing anything ? So the file name could be the same with the original file name..
thanks be 4 guys.. :-)