PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
if(isset($userfile)) {
if (!eregi('(.gif|.jpeg|.jpg)', $userfile)) {
$invalidPic = "Sorry, only GIF or JPG files (with a .gif, .jpeg, or .jpg extention) can be accepted.";
exit;
}
if (ereg('.gif', $userfile)) {
$ext = '.gif';
}
elseif (ereg('.jpg', $userfile)) {
$ext = '.jpg';
}
elseif (ereg('.jpeg', $userfile)) {
$ext = '.jpeg';
}
$userfile_name = $newFileName . $ext;
if (copy ($userfile, "your/path/$userfile_name")) {
$message='hi';
}
}
else {
$message='no';
}
this script will only allow jpg gif and jpeg images to be uploaded. it will place them in your directory. If you need more help email me at chris12295@aol.com. Tell me if i helped
Warning: fopen("/www/aoe2/!scripts/filesubmission/pages/.php", "w") - Permission denied in /home/www/aoe2/!scripts/filesubmission/submit_go.php on line 31
Warning: Supplied argument is not a valid File-Handle resource in /home/www/aoe2/!scripts/filesubmission/submit_go.php on line 32
Possible <span style='color:blue' title='I'm naughty, are you naughty?'>smurf</span>. Filename:
i would guess you haven't set the file permissions on the directory. chmod the directory to 777