help with code not wrking

From: Date: Wed, 24 Oct 2007 19:27:28 +0000
Subject: help with code not wrking
Groups: php.general 
Request: Send a blank email to php-general+get-263600@lists.php.net to get a copy of this message
Hi all, I have inherited a problem script from a client, and it's a simple upload function. The problem is that while the image is being uploaded and saved as the same name it was uploaded as, it's not writing to the table the file name for display reference so it's like there is no picture. I appreciate any help you can provide. Thanks! Joey include ("sesion_admin.php"); include("../contentdb.php"); $res_state=mysql_query("select * from states where 1 order by state"); $id = $_GET["id"]; echo "ID: " . $id . "IDL: " . $local_id . " Photo: " . $userfile . " [B4 Upload]<br>"; $p_proceso = $_POST["p_proceso"]; if($p_proceso=="borrar"){ $query_editar ="update Basic_Info set photo='' where Id=$id "; mysql_query($query_editar); } if($p_proceso=="upload"){ $UPLOAD = fopen($userfile, "r" ); $contents = fread($UPLOAD,$userfile_size); fclose($UPLOAD); $SAVEFILE = fopen("../photos/".$userfile, "wb" ); fwrite( $SAVEFILE, $contents,$userfile_size); fclose( $SAVEFILE ); #$query_editar ="update Basic_Info set photo='$userfile' where Id=$id "; mysql_query($query_editar); }

« previous php.general (#263600) next »