PHP Coder Needed

Discussion in 'Programming' started by Tropica, Nov 17, 2007.

  1. #1
    I need an upload script that will allow me to upload a .jpg .jpeg .gif .png .bmp file

    Then rename it to photo.jpg and resize it with a width of 136px and save in a folder called upload

    $10 if anyone can do that for me

    Cheers
     
    Tropica, Nov 17, 2007 IP
  2. ACiD394

    ACiD394 Peon

    Messages:
    435
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #2
    having it rename to photo.jpg would be very stupid, as it would overwrite the file evey time, unless you meant like photo1.jpg photo2.jpg etc.?
     
    ACiD394, Nov 17, 2007 IP
  3. kmap

    kmap Well-Known Member

    Messages:
    2,215
    Likes Received:
    29
    Best Answers:
    2
    Trophy Points:
    135
    As Seller:
    100% - 0
    As Buyer:
    100% - 1
    #3
    hi
    I can do this in 3 hours
    50% advance
    Regards

    Alex
     
    kmap, Nov 17, 2007 IP
  4. Tropica

    Tropica Notable Member

    Messages:
    2,431
    Likes Received:
    128
    Best Answers:
    0
    Trophy Points:
    230
    As Seller:
    100% - 2
    As Buyer:
    100% - 0
    #4
    thats the idea man :)

    I only will ever need one image in that directory, and it will need to be overwritten!

    kmap: any examples of previous work?
     
    Tropica, Nov 17, 2007 IP
  5. schoash

    schoash Active Member

    Messages:
    291
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    55
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #5
    3 hrs?
    more like 30 minutes max i would say
     
    schoash, Nov 17, 2007 IP
  6. scriptmachine

    scriptmachine Banned

    Messages:
    473
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #6
    I'm interested pm sent
     
    scriptmachine, Nov 17, 2007 IP
  7. Marko

    Marko Peon

    Messages:
    248
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #7
    I am interested to!

    Please check PM!
     
    Marko, Nov 17, 2007 IP
  8. Tropica

    Tropica Notable Member

    Messages:
    2,431
    Likes Received:
    128
    Best Answers:
    0
    Trophy Points:
    230
    As Seller:
    100% - 2
    As Buyer:
    100% - 0
    #8
    anyone?

    I need an upload script that will allow me to upload a .jpg .jpeg .gif .png .bmp file then convert it to a .jpg

    Then rename it to photo.jpg and resize it with a width of 136px and save in a folder called upload

    Please only pm if you can do it, not if you think you can

    $15 if a coder can do this :)
     
    Tropica, Nov 17, 2007 IP
  9. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #9
    Wow, 3 hours? 10 minutes, at the very very most, and 50% up front? It's ten bucks dude!
     
    projectshifter, Nov 17, 2007 IP
  10. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #10
    Okay, so I was bored, and had a couple minutes to kill so I decided to go ahead and write it for you. Would have had it sooner but my ftp program crashed while editing the file so had to restart. It's really like 3 lines of code, 2 echo statements and a 4 jpeg commands, wasn't much work, so enjoy.
    <?php
    
    if ($_FILES){
    	move_uploaded_file($_FILES['upload']['tmp_name'], 'upload/tmp.jpg');
    	resizeImage('upload/tmp.jpg', 'upload/photo.jpg');
    	unlink('upload/tmp.jpg');
    	echo '<a href="upload/photo.jpg">photo.jpg</a><br /><br />';
    }
    
    echo '<b>Upload a File</b><br /><form method="post" action="'.$_SERVER['PHP_SELF'].'" enctype="multipart/form-data"><input type="file" name="upload" /> <input type="submit" value="Upload!" /></form>';
    
    function resizeImage($in, $out){
    	$size = getimagesize($in);
    	$width = 136;
    	$height = intval($size[1] * (136/$size[0]));
    
    	$new = imagecreatetruecolor($width, $height);
    	$old = imagecreatefromjpeg($in);
    	imagecopyresized($new, $old, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);
    
    	imagejpeg($new, $out);
    }
    
    ?>
    
    PHP:
    Also to mention, you need to create a folder called upload, and chmod it to 777, otherwise it just creates tmp.jpg, resizes, saves it as photo.jpg and deletes tmp.jpg. Quick and easy, and it also keeps the aspect ratio in resizing the height so you don't get some crazy distorted image. Enjoy.
     
    projectshifter, Nov 17, 2007 IP
    Tropica likes this.
  11. hogan_h

    hogan_h Peon

    Messages:
    199
    Likes Received:
    30
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #11
    projectshifter, you need to take care of other file types, not only jpg.

    So you will need few minutes more to code functions for accepting gif's, bmp's, etc... ;)
     
    hogan_h, Nov 17, 2007 IP
  12. Marko

    Marko Peon

    Messages:
    248
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #12
    The job is done very fast :)
    I received the money (10$) ...extremely fast :)

    I don’t know does Tropica like my work ?
     
    Marko, Nov 17, 2007 IP
  13. phptechie

    phptechie Well-Known Member

    Messages:
    885
    Likes Received:
    10
    Best Answers:
    2
    Trophy Points:
    165
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #13
    Hi,

    If the job is still open , I'm interested to work on it.

    Checkout my online portfolio linking from my signature.

    Feel free to contact me for further details.

    Thanks.
     
    phptechie, Nov 18, 2007 IP
  14. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #14
    lol he PMed me two minutes later and took 2 minutes to add the other ones :p Not really sure why anyone did it afterwards but he had the copy he needed at like 4 lol. Oh well, back to work not :( A coders job is never done
     
    projectshifter, Nov 18, 2007 IP
  15. Tropica

    Tropica Notable Member

    Messages:
    2,431
    Likes Received:
    128
    Best Answers:
    0
    Trophy Points:
    230
    As Seller:
    100% - 2
    As Buyer:
    100% - 0
    #15
    its was about 30 seconds! lol
     
    Tropica, Nov 18, 2007 IP
  16. projectshifter

    projectshifter Peon

    Messages:
    394
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    0
    As Seller:
    100% - 0
    As Buyer:
    100% - 0
    #16
    Next time bring me something more challenging :p
     
    projectshifter, Nov 18, 2007 IP