View Single Post
Old 04-14-2007, 10:24 PM   #28 (permalink)
Arenlor
Contributing Member
 
Join Date: 01-02-07
Location: PA, USA
Posts: 194
iTrader: 0 / 0%
Latest Blog:
None

Arenlor is liked by somebodyArenlor is liked by somebodyArenlor is liked by somebodyArenlor is liked by somebody
Send a message via ICQ to Arenlor Send a message via AIM to Arenlor Send a message via MSN to Arenlor Send a message via Yahoo to Arenlor
Still wondering what accept is meant for, but this is my new coding and it works.
PHP Code:
$loc "images/".basename($_FILES['upimg']['name']);
if(!
ereg("^image/(bmp|gif|jpeg|tiff|png)$",$_FILES['upimg']['type'])){
    echo 
"<p>You may only upload bitmap, gif, jpeg, tiff, and png file formats, if you want a different file allowed send an email to <a href=\"mailto:***@arenblogs.com\">***@arenblogs.com</a></p>";
}
else if(
move_uploaded_file($_FILES['upimg']['tmp_name'], $loc)) {
    echo 
"<p>The image ".basename$_FILES['upimg']['name'])." has been uploaded!</p>";
}
else{
    echo 
"<p>There was an error uploading the file, please try again.</p>";

Any simpler ways? Ereg seemed the most correct for what I was doing.
Arenlor is offline   Reply With Quote