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);

}

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to