Can any one tell me whats wrong with my code:
<?php
include ("connect.php");
$_SESSION['user_name']
$user_name = $_SESSION['user_name'];
if ($_POST['submit'])
{
//get file attributes
$_name = $_FILES['myfile']['name'];
$tmp_name = $_FILES['myfile']['tmp_name'];
if ($name)
}
//start upload process
$location = "public_html/avatars/.$name"
move_uploaded_file ($tmp_name, $location");
$query = mysql_query ("UPDATE users SET imagelocation='$location' WHERE user_name='$user_name'");
die("Your profile image has been uploaded. <a href='view.php'>Home</a>");"
}
else
die("Please select a file");
}
echo "Welcome, " .$user_name."!<p>";
echo "Upload your image"
<form action='upload.php' method='POST' enctype='multipart/form-data'>
File <input type='file' name='myfile'> <input type='submit' name='submit' value='Upload'>
</form>
?>
<?php
include ("connect.php");
$_SESSION['user_name']
$user_name = $_SESSION['user_name'];
if ($_POST['submit'])
{
//get file attributes
$_name = $_FILES['myfile']['name'];
$tmp_name = $_FILES['myfile']['tmp_name'];
if ($name)
}
//start upload process
$location = "public_html/avatars/.$name"
move_uploaded_file ($tmp_name, $location");
$query = mysql_query ("UPDATE users SET imagelocation='$location' WHERE user_name='$user_name'");
die("Your profile image has been uploaded. <a href='view.php'>Home</a>");"
}
else
die("Please select a file");
}
echo "Welcome, " .$user_name."!<p>";
echo "Upload your image"
<form action='upload.php' method='POST' enctype='multipart/form-data'>
File <input type='file' name='myfile'> <input type='submit' name='submit' value='Upload'>
</form>
?>