Hi,
I am getting a problem on uploading a file to database and in the website folder,
it is working fine on local even connecting with remote data base but when it checked on remote website but it show error (move_uploaded_file) not going within it.
Here is the code pls check and if you find any solution then pls send me the solution.
It always going to else part of move_uploaded_file.
Thanks in Advance
<?php
session_start();
$job_title='';
$first_name='';
$last_name='';
$email='';
$current_company='';
$mobile='';
if(isset($_POST["Submit"]))
{
$job_title=$_POST['job_title'];
$first_name=$_POST['first_name'];
$last_name=$_POST['last_name'];
$email=$_POST['email'];
$current_company=$_POST['current_company'];
$mobile=$_POST['mobile'];
if($_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code']) )
{
$date=date("Y-m-d"." "."h:i:s");
$date1=date("Ymdhis");
$docc=($_FILES['doc']['name']);
$doc =$date1.str_replace(' ','',$docc);
$target = "http://www.mywebsite.in/resumes/";
$target = $target.basename($doc);
$conn mysql_connect($db_host,$username, $password) or die(mysql_error()) ;
mysql_select_db($database) or die(mysql_error()) ;
if(move_uploaded_file($_FILES['doc']['tmp_name'],$target))
{
echo "<script>"."alert('Your Resume has been uploaded Successfully')"."</script>";
$sql="INSERT INTO career(job_title,first_name,last_name,email,current_company_name,contact_number,resumes,date) VALUES('$job_title','$first_name','$last_name','$email','$current_company','$mobile','$doc','$date');";
mysql_query($sql,$conn) or die("Error in Query: " . mysql_error());
$job_title='';
$first_name='';
$last_name='';
$email='';
$current_company='';
$mobile='';
}
else {
echo "<script>"."alert('Sorry, There was a problem uploading your file.')"."</script>";
}
}
else{
echo "<script>"."alert('Sorry no data upload.')"."</script>";
}
}
?>