Re: [PHP-DB] picture into mysql (file address)

2002-12-19 Thread Terry Romine
One comment is to be sure the destination folder has write privileges 
for world.

My typical usage is:

2)  // datafile is field name for image/file upload browser
	$img_dir = ../photos; // must be 777 access
if($datafile_name != ) {
if ($datafile_name != none) {
$newFileName = $datafile_name;
if (!(copy($datafile, $img_dir/$newFileName))) {
$errmsg = bcopying $newFileName failed/bbr;
} else {
$errmsg = bcopying $newFileName succeeded/bbr;
}
}
}


On Wednesday, December 18, 2002, at 02:20 PM, Seabird wrote:


exec(cp $_POST[picture]
//localhost/seabird.jmtech.ca/OTF.com/images/$_POST[picture_name]);



Re: [PHP-DB] picture into mysql (file address)

2002-12-19 Thread Seabird
since this is a local folder (testing on local server) I have complete
access everywhere. I judge from your sample that register_globals are ON and
mine are turned off (for several reasons.

Do I have a typo somewhere? where does my full path start etc.

the actual folder is in: c:\apache\htdocs\seabird.jmtech.ca\otf.com\images

pls help me.
Jacco
--
http://seabird.jmtech.ca

Attitude is Everything!
But Remember, Attitudes are Contagious!
Is Yours worth Catching
Terry Romine [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 One comment is to be sure the destination folder has write privileges
 for world.

 My typical usage is:

  2)  // datafile is field name for image/file upload browser
  $img_dir = ../photos; // must be 777 access
  if($datafile_name != ) {
  if ($datafile_name != none) {
  $newFileName = $datafile_name;
  if (!(copy($datafile, $img_dir/$newFileName))) {
  $errmsg = bcopying $newFileName failed/bbr;
  } else {
  $errmsg = bcopying $newFileName succeeded/bbr;
  }
  }
  }

 On Wednesday, December 18, 2002, at 02:20 PM, Seabird wrote:

  exec(cp $_POST[picture]
  //localhost/seabird.jmtech.ca/OTF.com/images/$_POST[picture_name]);




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




[PHP-DB] picture into mysql (file address)

2002-12-18 Thread Seabird
Hi everyone, I have been struggeling with this for some time know and don't
know where it goes wrong. I want to upload pictures into a folder AND store
their path into MySQL. I used a joe's auto tutorial but can't get it to
work. All the information is put in correctly but not the picture.

Please help me, here's my code: (ps globals are off)

if ($_POST[submit]) {

$link = mysql_pconnect(localhost,myusername,mypassword);
$db = test;
mysql_select_db($db,$link);

$query = INSERT INTO inventory
(registration,type,total_time,price,description,picture_name)
VALUES
('$_POST[registration]','$_POST[type]','$_POST[total_time]','$_POST[price]',
'$_POST[description]','$_POST[picture]');

exec(cp $_POST[picture]
//localhost/seabird.jmtech.ca/OTF.com/images/$_POST[picture_name]);

mysql_query( $query, $link);
print 'Thank youbrYou have submitted the following information:br';
echo Registration: $_POST[registration]br\n;
echo Type: $_POST[type]br\n;
echo Total Time: $_POST[total_time]br\n;
echo Price: $_POST[price]br\n;
echo Description: $_POST[description]br\n;
echo temp file: $_POST[picture]br\n;
echo file name: $_POST[picture_name]br\n;
echo file size: $_POST[picture_size]br\n;
echo file type: $_POST[picture_type]br\n;
echo br\n;
echo img src=images/$picture_namebr\n;
}
else { ?
form enctype=multipart/form-data method=post
action=?php echo $PHP_SELF ?
  pRegistrationbr
input type=Text name=registration size=25 value=N
br
typebr
input type=Text name=type size=25
br
total timebr
input type=Text name=total_time size=25
br
pricebr
input type=Text name=price size=25
br
Descriptionbr
textarea name=description/textarea
br
picturebr
input type=file name=picture size=25
input type=submit name=submit value=Upload
  /p
/form


--
http://seabird.jmtech.ca

Attitude is Everything!
But Remember, Attitudes are Contagious!
Is Yours worth Catching





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