Re: please help
| From: | Lerp | Date: | Mon, 28 Jan 2002 13:23:02 +0000 |
| Subject: | Re: please help | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16245@lists.php.net to get a copy of this message | ||
Hi there, here's an upload form that might be what u are looking for:
Hope his helps you out :)
Joe
php page 1
<form action='upload.php' method='post'
enctype='multipart/form-data'>
<input type='hidden' name='MAX_FILE_SIZE' value='102400'>
<P><font color='#ffffff' face='verdana' size=1>Upload
Photo:</font><input
type='file' name='userfile'><input type='submit'
value='Upload!!!'></form>
php page 2 -- receiving/upload processing page
<?php
# $userfile is the file being uploaded --- could rename the file if you
wanted or add a timestamp to prevent multiple instances of same filename
print $userfile . "<BR>";
print $userfile_name . "<BR>";
// copy the file being posted
if(copy($userfile, "/ez/codesnipits/temprotatingimages/". $userfile_name)){
print "Your photo has been uploaded and renamed successfully.<br>" ;
}
else
{
print "No luck with the upload dude.<br>";
}
# create a path for storing into database
$patharola = "temprotatingimages/". $userfile_name;
print $patharola;
// insert path into database here
// connect to db
$connectionToDBid = odbc_connect("cts", "jqwwode", "dfgh5");
# query statement
$sqlr = "INSERT INTO IMAGES (employee_id, imagepath) VALUES ($employeeid ,
'$patharola' )";
# execute the sql statement (query) on the connection made
$resultset = odbc_do($connectionToDBid, $sqlr);
?>
"Duky Yuen" <duky@cable.a2000.nl> wrote in message
news:3C51AACF.F394BAC9@cable.a2000.nl...
> I want to make something like when you are attaching something to an
> email in hotmail. I want to make something that searches your own
> computer for files on your harddisk that you want to upload to the
> server.
>
> But I don't know if this is possible. If this is possible.Can somebody
> tell me which function I should use? Or if someone have an example...
> please...
>
> Duky
>