I think theres an error somewhere in this script, but im quite good with PHP and i can't spot any? Bascially this script updates peoples pictures on my server. Ive had update querys work before but this doesnt work.
DO YOU SEE ANY POSSIBLE ERRORS OR WHY THIS MAY NOT BE WORKING? List as many as you can think of please.
if ($PASSWORD == $_POST['MYPASSWORD2'])
{
$file_name = $_FILES['ufile']['name'];
$random_digit=rand(0000,9999);
$new_file_name=$random_digit.$file_name;
$path= "/Uploads/".$new_file_name;
if($ufile !=none)
{
if(copy($_FILES['ufile']['tmp_name'], $path))
{
$_SESSION['op']=$new_file_name;
}
}
$query = "UPDATE table SET SITENAMEIMG1='hi'
WHERE USERNAME=\"" . $_SESSION['USERNAME'] . "\" AND PASSWORD=\"" . $_POST['MYPASSWORD2'] . "\"";
$result = mysql_query($query)
or die("oh no");
header("location:/Main/Picture Updated.php");
exit();
2006-11-14
07:05:20
·
3 answers
·
asked by
peter s
1
in
Computers & Internet
➔ Programming & Design