PHP Developers Network

A community of PHP developers offering assistance, advice, discussion, and friendship.
 
Loading
It is currently Mon Nov 24, 2014 5:30 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Thu Oct 13, 2005 8:37 am 
Offline
Forum Newbie

Joined: Sun Sep 25, 2005 6:09 pm
Posts: 11
Can someone please help with this code ,I can't figure what's wrong?


Syntax: [ Download ] [ Hide ]
//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)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 8:38 am 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
it'd be nice to know what problem you are experiencing.... :roll:


Moved to Graphics.


Top
 Profile  
 
 Post subject: image upload
PostPosted: Thu Oct 13, 2005 8:50 am 
Offline
Forum Newbie

Joined: Sun Sep 25, 2005 6:09 pm
Posts: 11
Sorry,

PHP Fatal error: Call to undefined function: parse_file_name() in /home/radio057/public_html/admin/unos_vijesti.php on line 340


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 9:05 am 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
there's no such function in php.. so I'm unsure what you are wanting... :?


Top
 Profile  
 
 Post subject: reply
PostPosted: Thu Oct 13, 2005 9:16 am 
Offline
Forum Newbie

Joined: Sun Sep 25, 2005 6:09 pm
Posts: 11
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Oct 13, 2005 9:19 am 
Offline
Neighborhood Spidermoddy
User avatar

Joined: Mon Mar 29, 2004 4:24 pm
Posts: 31559
Location: Bothell, Washington, USA
it would appear you already are with your calls to resize_image(), which also aren't apart of php...


Top
 Profile  
 
 Post subject: reply
PostPosted: Thu Oct 13, 2005 9:22 am 
Offline
Forum Newbie

Joined: Sun Sep 25, 2005 6:09 pm
Posts: 11
I there any other way that i can do that


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 17, 2005 5:31 pm 
Offline
Forum Commoner

Joined: Sat Oct 08, 2005 9:16 pm
Posts: 67
Location: USA
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 :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group