uploaded images display
| From: | Sharmad Naik | Date: | Sun, 22 Apr 2001 07:32:51 +0000 |
| Subject: | uploaded images display | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-8789@lists.php.net to get a copy of this message | ||
I have written a small script having connectivity with postgresql which
can upload an image and display the already uploaded images.
But it doesn't display the uploaded images. I guess the problem lies somewhere
in $file_url.
Pls help me
<HTML>
<HEAD>
<TITLE></TITLE>
</HEAD>
<?
$database=pg_connect("dbname=testdb user=postgres")
?>
<?
if ($submit) {
$result = pg_Exec($database,"INSERT INTO ".
"images (mem_id,mem_image) VALUES(NULL,'$fupload_name')");
$file_dir = "/tmp";
$file_url = "http://sanico.sharmad.org";
if (isset($fupload ))
{
if ($fupload_type == "image/jpg" ||$fupload_type == "image/jpeg")
{
copy ($fupload, "$file_dir/$fupload_name") or die ("Couldn't
copy");
echo("$file_dir/$fupload_name");
}
}
}
$result=pg_Exec($database,"SELECT mem_image from images");
for($i=0;$i<pg_NumRows($result);$i++){
$images=pg_Result($result,$i,0);
copy ("$file_dir/$images",$ftupload);
echo ( $images);
echo ( $ftupload);
echo ("<IMG SCR= $ftupload>");
}
?>
<BODY BGCOLOR="#FFFFFF">
<FORM action="<? print $PHP_SELF?>" method="post"
enctype="multipart/form-data">
<!-- <INPUT TYPE="hidden" name="MAX_FILE_SIZE" VALUE="51200">
-->
<INPUT TYPE="hidden" NAME="$fupload_name" VALUE="<? echo
$fupload_name ?>">
<INPUT TYPE=file name="fupload" VALUE=""><BR>
<INPUT TYPE="submit" NAME="submit" VALUE="Send File to Web
Server">
</FORM>
<A HREF="index.php" CLASS="content">Home page</A>
</BODY>
</HTML>
-thanks
--
The secret of the universe is @*&í!'ñ^#+ NO CARRIER
__ _ _ _ _
|_|_||_||_||\/||_|| \
_|| || || \| || ||_/