You need to give the user permission to write in the destination directory,
you can do this by using:
chmod 666 directoryname
John [EMAIL PROTECTED] escribió en el mensaje
news:[EMAIL PROTECTED]
Thanking in advance,
Hi all- very new to php, and at the risk of being spoon fed here, I beg
for your patience in advance. I am trying to have an entry page for user
input/ pic upload into MySQL/win2k (www.sammiesmodels.com/entry.php ).
I get this error during test of the above page: Warning: Unable to open ''
for reading: Permission denied in C:\SammiWWW\entry.php on line 27 Couldn't
copy the file!
The upload folder, Temp sits in the root www dir, and the user has all
permissions granted (or do i?) in the DB. Below is the syntax to the
Entry page:
***
html
head
titlePortfolio Entry /title
meta http-equiv=Content-Type content=text/html; charset=iso-8859-1
/head
body bgcolor=#FFEBEB
?php
if ($submit) {
$db=mysql_connect(66.220.69.20,admin,snoddy);
mysql_select_db(sammies models,$db);
$sql=INSERT INTO models (first, last, age, email, location, eye, hair,
experience, aspirations, mtype, picname1, picname2, picname3, picname4,
picname5, picname6, picname7, picname8)
VALUES
('$first','$last','$age','$email','$location','$eye','$hair','$experience','
$aspirations','$mtype','$picname1','$picname2','$picname3','$picname4','$pic
name5','$picname6','$picname7','$picname8');
mysql_query($sql) or die(mysql_error());
// if $_FILES['img1'] isn't empty, try to copy the file
if ($_FILES['picname1'] != ) {
// copy the file to a directory or
file://die and print an error message
// NOTE! if you're on a Windows machine,
// use Windows pathnames, like so:
// copy($_FILES[picname1][$first],
C:\\sammiwww\\directory\\path\\.$_POST[img1_name]);
copy($_FILES['picname1']['$first . temp'],
C:\\sammiwww\\upload\\.$_FILES['picname1']['$first'])
or die(Couldn't copy the file!);
} else {
// if $_FILES['picname1'] was empty, die and let us know why
die(No input file specified);
}
?
echo First: $firstbr\n;
echo Last: $lastbr\n;
echo Age: $agebr\n;
echo Email: $emailbr\n;
echo Location: $locationbr\n;
echo Eye color: $eyebr\n;
echo Hair color: $hairbr\n;
echo Experience: $experiencebr\n;
echo Aspirations: $aspirationsbr\n;
echo Media Type: $mtypebr\n;
echo Photo 1: $picname1br\n;
echo img src=c:/sammiwww/pic/$picname1br\n;
echo Photo 2: $picname2br\n;
echo img src=c:/sammiwww/pic/$picname2br\n;
echo Photo 3: $picname3br\n;
echo img src=c:/sammiwww/pic/$picname3br\n;
echo Photo 4: $picname4br\n;
echo img src=c:/sammiwww/pic/$picname4br\n;
echo Photo 5: $picname5br\n;
echo img src=c:/sammiwww/pic/$picname5br\n;
echo Photo 6: $picname6br\n;
echo img src=c:/sammiwww/pic/$picname6br\n;
echo Photo 7: $picname7br\n;
echo img src=c:/sammiwww/pic/$picname7br\n;
echo Photo 8: $picname8br\n;
echo img src=c:/sammiwww/pic/$picname8br\n;
echo bcenterThank you for registering,nbsp; $first
/b/centerp;
?
pcenter/p
center
a href=http://www.sammiesmodels.com; target=_selfReturn to Sammies
Models
Home/a
? }
// display form
else {
?
/center
center
font face=Georgia, Times New Roman, Times, serifstrongSubmit Your
Portfolio
Here:/strong/font
/center
form enctype=multipart/form-data name=entry method=POST action=?php
echo $PHP_SELF?
nbsp;
table width=95% border=0 cellspacing=0 cellpadding=0
tr
td width=14%strongFirst Name:/strong/td
td width=43%input name=first type=text size=30
maxlength=45/td
td width=43%font size=2 face=Arial, Helvetica,
sans-serifnbsp;/font/td
/tr
tr
tdstrongLast Name: /strong/td
tdinput name=last type=text size=30 maxlength=45/td
tdfont size=2 face=Arial, Helvetica, sans-serifstrong*Last name
shall
not be used on the website, but/strong/font/td
/tr
tr
tdstrongAge:/strong/td
tdinput name=age type=text size=30 maxlength=3/td
tdfont size=2 face=Arial, Helvetica, sans-serifstrongfor internal
use
only./strong/font/td
/tr
tr
tdstrongEmail:/strong/td
tdinput name=email type=text size=30 maxlength=45/td
tdfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td
/tr
tr
tdstrongLocation:/strong/td
tdinput name=location type=text id=location size=30
maxlength=60/td
tdfont size=2 face=Arial, Helvetica, sans-serifstrong*Location-
please
do not be specific, but only/strong/font/td
/tr
tr
tdstrongEye Color/strong/td
tdinput name=eye type=text id=eye size=30 maxlength=45/td
tdfont size=2 face=Arial, Helvetica, sans-serifstrongstate or
region./strong/font/td
/tr
tr
tdstrongHair Color:/strong/td
tdinput name=hair type=text id=hair size=30 maxlength=45/td
tdfont size=2 face=Arial, Helvetica, sans-serifnbsp;/font/td
/tr
tr
td valign=topstrongExperience:/strong/td
tdtextarea name=experience cols=60 rows=10
id=experience/textarea/td
td valign=topfont size=2 face=Arial, Helvetica,
sans-serifstrong*
Any experience pertaining to your talent aspirations- school plays,
photoshoots,
etc../strong/font/td
/tr
tr
td