Hello!!!

You can do something like this....


$pat = array("#", "@", "*", "&", "%", "@","$","'","`");
        $w= '_';
        $pic_name2 = str_replace ($pat, $w, stripslashes($pic_name));

        

        $query = "INSERT INTO Travel_Design (Tavel_Design, Design_Name,
Season, Date, name, filesize, filetype ) VALUES ( '$Tavel_Design',
'$Design_Name', '$Season', '$Date', '$pic_name2', '$pic_size',
'$pic_type')";
        

        
        exec("cp '$pic' '/images/$pic_name2'");



The First part is for taking out certain characters.....

The Second is for inserting the data...Including the File parameters.

The Third part is the command to cp the TMP file where it needs to
be...with the file name of $pic_name2...

All you're storing is the Pictures Name, Size, and Type....



And you would do something like this for the <img> tag...


...
echo ("<td bgcolor=white valign=middle colspan=2><p align=center><img
src='images/$data->name' width=180 height=249></p></td></tr>\n");
...     

$data->name is the mysql field for the Picture Name......


I use mysql_fetch_object for retrieving my data...I'm sure it would work
for mysql_fetch_array and mysql_fetch_row.....


I run Linux...so I don't know if the exec() will work if your on
windoze....


Good Luck!!!


Dan




-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, February 03, 2002 4:14 PM
To: [EMAIL PROTECTED]
Subject: [PHP-DB] FIle Uploading to database

I don't want the file to be stored in the database, but its location.

What I want to do:

Upload a file, it gets stored on the webserver, but its location on the
server is stored in the database.

Where do I look for something like this?

What data type would I use to store the URL or file location?

Thank you



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



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

Reply via email to