Image upload and resizing

Need help with Photoshop, the GIMP, Illustrator, or others? Want to show off your work? Looking for advice on your newest Flash stuff?

Moderator: General Moderators

Post Reply
stipe
Forum Newbie
Posts: 11
Joined: Sun Sep 25, 2005 6:09 pm

Image upload and resizing

Post by stipe »

Can someone please help with this code ,I can't figure what's wrong?

Code: Select all

//Upload default slike//

if (!($HTTP_POST_FILES['slikad']["type"]== "image/gif"
                                       ||
$HTTP_POST_FILES['slikad']["type"] == "image/jpg"
                                       ||
$HTTP_POST_FILES['slikad']["type"] == "image/jpeg"
                                       ||
$HTTP_POST_FILES['slikad']["type"] == "image/pjpeg"
                                       ))




//image out of the form
$uploaddir = '/home/radio057/public_html/images/vijesti/default/';
$image =$HTTP_POST_FILES['slikad'];
$image["slikad"] =parse_file_name($image["slikad"]);

$image_name =substr($image["slikad"],0,strpos($image["slikad"],"."));
$image_ext =substr($image["slikad"],strpos($image["slikad"],"."));

$fi = "";

while(file_exists($uploaddir.$image_name.$fi.$image_ext)) $fi++;

$image_name =$image_name.$fi.$image_ext;
$image_path =$uploaddir.$image_name;
$thumb_path =$uploaddir."thumbs/".$image_name;

move_uploaded_file($image["tmp_name"],$image_path);
copy($image_path, $thumb_path);

resize_image($thumb_path, '100','100');
resize_image($image_path, '300','300');

                               if (file_exists($image_path)){
                                       $images[] = $image_name;
                               }
                       }//END if(!$ERROR)
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it'd be nice to know what problem you are experiencing.... :roll:


Moved to Graphics.
stipe
Forum Newbie
Posts: 11
Joined: Sun Sep 25, 2005 6:09 pm

image upload

Post by stipe »

Sorry,

PHP Fatal error: Call to undefined function: parse_file_name() in /home/radio057/public_html/admin/unos_vijesti.php on line 340
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

there's no such function in php.. so I'm unsure what you are wanting... :?
stipe
Forum Newbie
Posts: 11
Joined: Sun Sep 25, 2005 6:09 pm

reply

Post by stipe »

I want to upload picture on server and in the same time resize that picture, because i don't want that the users upload big pictures on my site,
i don't know how to set max width of the pic.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

it would appear you already are with your calls to resize_image(), which also aren't apart of php...
stipe
Forum Newbie
Posts: 11
Joined: Sun Sep 25, 2005 6:09 pm

reply

Post by stipe »

I there any other way that i can do that
Dm7
Forum Commoner
Posts: 67
Joined: Sat Oct 08, 2005 9:16 pm
Location: USA

Post by Dm7 »

You'd have to have those functions for that (customed ones).. or do actual codes for resizing.. view my gallery script (rounded corner image error post in this grpahic section) to get an idea.. my resizing code works there :)
Post Reply