I have a code for submitting an article which in this form there is a title input and file input for the article file.
but problem is if in the title i write for ex : this is hi's article
this article would not submit and will fail. the code for replacing spaces in title is :
//pereventing spaces for article title
$pdf_file=str_replace(" ", "_", $_FILES['msfile']['name']);
/* define the path to the upload folder */
$destination='../pdf/';
move_uploaded_file($_FILES['msfile']['tmp_name'], $destination.$pdf_file);
//inserting info into articles
mysql_connect($host,$username,$password)or die("cannot connect");
$selected=mysql_select_db($db_name)or die("cannot select DB");
$sql1=mysql_query(" INSERT INTO `{$tbl_name}` (`uname`,`title`,`fname`,`lname`,`email`,`mstitle`,`msfile`,`date`,`status`)
VALUES ('{$log_row["uname"]}' , '{$log_row["title"]}' , '{$log_row["fname"]}' , '{$log_row["lname"]}' , '{$log_row["email"]}' , '{$_REQUEST['mstitle']}','{$pdf_file}','{$mydate}','Awaiting Processing' )");
$result1=mysql_query($sql1);
any suggestion ?