hello freinds,
i got a problem with uploadinf files to a server.
What i tried to do was, up load a file to a server and get that file name to a data base. file upoading was done. But data base submision was not done.
A message appears saying, an error in line 50.
i have given my codings too. can anyone help me in finding what the problem is?
codes
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
//This is the directory where images will be saved
$target = "images/";
$target = $target . basename( $_FILES['CVFile']['name']);
//This gets all the other information from the form
$IP=$_POST['IP'];
$Username=$_POST['Username'];
$FullName=$_POST['FullName'];
$DateofBirth=$_POST['DateofBirth'];
$Age=$_POST['Age'];
$Gender=$_POST['Gender'];
$MaritalStatus=$_POST['MaritalStatus'];
$LivingAddress=$_POST['LivingAddress'];
$LivingCountry=$_POST['LivingCountry'];
$Nationality=$_POST['Nationality'];
$Religion=$_POST['Religion'];
$ContactTelephone=$_POST['ContactTelephone'];
$PrefferedField=$_POST['PrefferedField'];
$PrefferedFieldOther=$_POST['PrefferedFieldOther'];
$PrefferedPost=$_POST['PrefferedPost'];
$PrefferedBusinessField=$_POST['PrefferedBusinessField'];
$PrefferedBusinessFieldOther=$_POST['PrefferedBusinessFieldOther'];
$LocalorForeignJob=$_POST['LocalorForeignJob'];
$JobType=$_POST['JobType'];
$Qualifications=$_POST['Qualifications'];
$Experience=$_POST['Experience'];
$PresentOccupation=$_POST['PresentOccupation'];
$CV=$_POST['CV'];
$SendEmails=$_POST['SendEmails'];
$CVFile=($_FILES['CVFile']['name']);
// Connects to your Database
mysql_connect("connection", "Username", "password") or die(mysql_error()) ;
mysql_select_db("DBName") or die(mysql_error()) ;
//Writes the information to the database
mysql_query("INSERT INTO `cv` VALUES (1, '$Username', 1, '$IP', '$Aproval', '$SendEmails', '$FullName', '$DateofBirth', '$Age', '$Gender', '$LivingAddress', '$LivingCountry', '$Nationality', '$Religion', '$MaritalStatus', '$ContactTelephone', '$Mobile', '$email', '$PrefferedField', '$PrefferedFieldOther', '$PrefferedPost', '$PrefferedPostOther', '$PrefferedBusinessField', '$PrefferedBusinessFieldOther', '$LocalorForeignJob', '$JobType', '$Qualifications', '$Experience', 'PresentOccupation', '$CV', '$CVFile', 1);")
//Writes the photo to the server
if(move_uploaded_file($_FILES['CVFile']['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";
}
else {
//Gives and error if its not
echo "Sorry, there was a problem uploading your file.";
}
?>
</body>
</html>
anerror message says
"Parse error: parse error, unexpected T_IF in /home/content/b/a/t/battipanchi/html/another/test/add.php on line 50". so i have given the code for line 50 bellow
//Writes the photo to the server
if(move_uploaded_file($_FILES['CVFile']['tmp_name'], $target))
{
please somebody help me
thanks
sisira