SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    911
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Arrow No such file or directory ?

    hi

    what's wrong with these codes below?

    Code:
    if ($image1 != '') {
    	rename("/upload/$pic1", "/upload/$body1");
    }
    
    if ($image2 != '') {
    	rename("/upload/$pic2", "/upload/$body2");
    }
    the error is
    Code:
    Warning: rename(/upload/ako.jpg,/upload/iridion@gmail.com1ako.jpg) [function.rename]: No such file or directory in /home/nursecar/public_html/mailerauth.php on line 120
    
    Warning: rename(/upload/eyeball.jpg,/upload/iridion@gmail.com2eyeball.jpg) [function.rename]: No such file or directory in /home/nursecar/public_html/mailerauth.php on line 124
    the line 120 and 124 are those codes above.

    Can you give advice or answer to this problem please.

    Thank you in advance.

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you specify a filesystem path that starts with a leading slash, it means you're saying the path starts at the root of the drive. To help illustrate, if this was windows, it would be saying C:/upload/ako.jpg

  3. #3
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    911
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    thanks for the hint.

    problem solved.

  4. #4
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    what's wrong with these codes below?
    There is no error checking, its too optimistic.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •