file put contents no error but dont work :| ?

Discussion in 'PHP' started by NetworkTown.Net, Jun 9, 2008.

  1. #1
    Hey

    im having some trouble with file put contents in php it doesnt display any errors even with php error report all turned on. Basiclly doesnt get the image file and put it into my image directory. The file is chmod to 777 and the images/ folder is also chmod to 777.

    the code i am working on is:

    
    //sql code here that gets a image name from the db defined as $img
    $imgget = file_get_contents("http://mysite.com/images/".rawurlencode($img));
    $rand = rand(00000, 999999848);
    $filename1 = strtolower(basename($img));
    $filename = 'images/'.$rand.''.$filename1.'';
    file_put_contents2($filename, $imgget);
    
    PHP:
    Anyone see a problem?
     
    NetworkTown.Net, Jun 9, 2008 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    Shouldn't this: "file_put_contents2(" be this: "file_put_contents("
     
    jestep, Jun 9, 2008 IP
  3. NetworkTown.Net

    NetworkTown.Net Well-Known Member

    Messages:
    2,022
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    165
    #3
    yeah sorry that was a typo error. its supose to be file_put_contents(.
    It dont work though.
     
    NetworkTown.Net, Jun 9, 2008 IP