English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

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

3 answers

Try changing your field Password to something like pass. Password is a key word in SQL and therefore your update statement will not work. Give it a try and let me know if it works.

Hope this helps

2006-11-14 07:59:23 · answer #1 · answered by Anonymous · 0 0

what is the error message being returned?

2006-11-14 07:16:50 · answer #2 · answered by arus.geo 7 · 0 0

I dont see any either! Sorry!

2006-11-14 07:13:18 · answer #3 · answered by Hunters wife 2 · 0 0

fedest.com, questions and answers