Could someone please run over these codes and let me know where the error is and how I could correct it.
[Upload Form]
<div align=center width=98%><FORM ACTION="upload.php" METHOD="POST" ENCTYPE="multipart/form-data">
<CENTER>
<TABLE WIDTH=450 BORDER=0 CELLPADDING=0 CELLSPACING=0 id=news>
<tr >
<td width=113>
<p align=right><b>photo to be sent: </b>
</td>
<td width=289>
<p><input type=file name="$file" size=30></p>
</td>
</tr>
<tr><td><b>Description : </b>
</td>
<td ><input type="text" name="$desc" size="40" maxlength="80" >
</td>
</tr>
</TABLE>
</CENTER>
<DIV ALIGN=CENTER>
<P STYLE="margin-bottom: 0in"><INPUT TYPE=SUBMIT NAME="submit" VALUE="Upload File"></P>
</DIV>
</FORM>
[Upload Script]
<?
{
copy("$file", "$file_name");
}
$File = "programs.txt";
$Page = "index.php";
$filename = "programs.txt";
$fd = fopen( $filename, "r" );
$current = fread( $fd, filesize( $filename ) );
fclose( $fd );
$upload = "<br><font size='1' color='#000000' class='s3' face='Verdana'><a href="'$file_name'>$file_name</a> : $desc</font>";
$UFile = fopen("$page","w+");
fputs($UFile,$upload);
fclose($UFile);
?>
If you can help it would be much appreciated...
Thanks
~PeeKay Team
Upload Script Code
Moderator: General Moderators
-
bionicdonkey
- Forum Contributor
- Posts: 132
- Joined: Fri Jan 31, 2003 2:28 am
- Location: Sydney, Australia
- Contact:
because otherwise the answer is just http://www.php.net/manual/en/features.file-upload.php 
another quick answer
Code: Select all
<input type=file name="$file" size=30>phpScott
-
knightmayor
- Forum Newbie
- Posts: 2
- Joined: Mon Apr 14, 2003 2:58 pm
I get an error on this linebionicdonkey wrote:maybe if you told us what the problem is we could narrow it down at bit
"$upload = "<br><font size='1' color='#000000' class='s3' face='Verdana'><a href="'$file_name'>$file_name</a> : $desc</font>"; "
I got rid of the $'s like you said to in the form and I still get the error..
Espcape your quotes.
Code: Select all
$upload = "
<br><font size=''1'' color=''#000000'' class=''s3'' face=''Verdana''>
<a href=''$file_name''>$file_name</a> : $desc</font>
";- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK