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
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 ( ).

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:

<title>Portfolio Entry </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<body bgcolor="#FFEBEB">
if ($submit) {

  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)
  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],

 copy($_FILES['picname1']['$first . temp'],
  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: $first<br>\n";
    echo "Last: $last<br>\n";
    echo "Age: $age<br>\n";
    echo "Email: $email<br>\n";
    echo "Location: $location<br>\n";
 echo "Eye color: $eye<br>\n";
 echo "Hair color: $hair<br>\n";
 echo "Experience: $experience<br>\n";
 echo "Aspirations: $aspirations<br>\n";
 echo "Media Type: $mtype<br>\n";
 echo "Photo 1: $picname1<br>\n";
 echo "<img src=c:/sammiwww/pic/$picname1><br>\n";
 echo "Photo 2: $picname2<br>\n";
 echo "<img src=c:/sammiwww/pic/$picname2><br>\n";
    echo "Photo 3: $picname3<br>\n";
 echo "<img src=c:/sammiwww/pic/$picname3><br>\n";
    echo "Photo 4: $picname4<br>\n";
 echo "<img src=c:/sammiwww/pic/$picname4><br>\n";
    echo "Photo 5: $picname5<br>\n";
 echo "<img src=c:/sammiwww/pic/$picname5><br>\n";
 echo "Photo 6: $picname6<br>\n";
 echo "<img src=c:/sammiwww/pic/$picname6><br>\n";
 echo "Photo 7: $picname7<br>\n";
 echo "<img src=c:/sammiwww/pic/$picname7><br>\n";
 echo "Photo 8: $picname8<br>\n";
    echo "<img src=c:/sammiwww/pic/$picname8><br>\n";
  echo  "<b><center>Thank you for registering,&nbsp; $first
<a href=""; target="_self">Return to Sammies
<? }
   // display form
else {
<font face="Georgia, Times New Roman, Times, serif"><strong>Submit Your
<form enctype="multipart/form-data" name="entry" method="POST" action="<?php
echo $PHP_SELF?>">
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<td width="14%"><strong>First Name:</strong></td>
<td width="43%"><input name="first" type="text" size="30"
<td width="43%"><font size="2" face="Arial, Helvetica,
<td><strong>Last Name: </strong></td>
<td><input name="last" type="text" size="30" maxlength="45"></td>
<td><font size="2" face="Arial, Helvetica, sans-serif"><strong>*Last name
not be used on the website, but</strong></font></td>
<td><input name="age" type="text" size="30" maxlength="3"></td>
<td><font size="2" face="Arial, Helvetica, sans-serif"><strong>for internal
<td><input name="email" type="text"  size="30" maxlength="45"></td>
<td><font size="2" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
<td><input name="location" type="text" id="location" size="30"
<td><font size="2" face="Arial, Helvetica, sans-serif"><strong>*Location-
do not be specific, but only</strong></font></td>
<td><strong>Eye Color</strong></td>
<td><input name="eye" type="text" id="eye" size="30" maxlength="45"></td>
<td><font size="2" face="Arial, Helvetica, sans-serif"><strong>state or
<td><strong>Hair Color:</strong></td>
<td><input name="hair" type="text" id="hair" size="30" maxlength="45"></td>
<td><font size="2" face="Arial, Helvetica, sans-serif">&nbsp;</font></td>
<td valign="top"><strong>Experience:</strong></td>
<td><textarea name="experience" cols="60" rows="10"
<td valign="top"><font size="2" face="Arial, Helvetica,
Any experience pertaining to your talent aspirations- school plays,
<td valign="top"><strong>Aspirations:</strong></td>
<td><textarea name="aspirations" cols="60" rows="10"
<td valign="top"><font size="2" face="Arial, Helvetica,
<td valign="top"><strong>Media Type:</strong></td>
<td><textarea name="mtype" cols="60" rows="10" id="mtype"></textarea></td>
<td valign="top"><font size="2" face="Arial, Helvetica,
type includes specific types of jobs/ offers you are interested in.
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<td width="24%"><div align="right">Upload Picture 1:</div></td>
<td width="33%"><div align="right">
<input type="file" name="picname1" value="Upload">
<td width="43%" rowspan="9">&nbsp;</td>
<td><div align="right">Upload Picture 2:</div></td>
<td><div align="right">
<input type="file" name="picname2" value="Upload">
<td><div align="right">Upload Picture 3:</div></td>
<td><div align="right">
<input type="file" name="picname3" value="Upload">
<td><div align="right">Upload Picture 4:</div></td>
<td><div align="right">
<input type="file" name="picname4" value="Upload">
<td><div align="right">Upload Picture 5:</div></td>
<td><div align="right">
<input type="file" name="picname5" value="Upload">
<td><div align="right">Upload Picture 6:</div></td>
<td><div align="right">
<input type="file" name="picname6" value="Upload">
<td><div align="right">Upload Picture 7:</div></td>
<td><div align="right">
<input type="file" name="picname7" value="Upload">
<td><div align="right">Upload Picture 8:</div></td>
<td><div align="right">
<input type="file" name="picname8" value="Upload">

<p align="left">
<input name="submit" type="submit" value="Submit">




Sorry for the newbie question and the long-winded accompanying info here but
I cannot pinpoint my error.  I hope there is an easily spotted culprit
above.  Thanks again!  -John

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.467 / Virus Database: 266 - Release Date: 4/1/2003

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to