Announcement

Collapse
No announcement yet.

file_exists

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • file_exists

    i have a if statement...
    PHP Code:
    if (file_exists(DIR_FS_DOWNLOAD $downloads_values['orders_products_filename']))
    echo 
    "123";
    else
    echo 
    "abc"
    it is to check whether the file exists for download or not..
    i keep getting abc as result although my file is exists...wat could be wrong? pls help...

  • #2
    $downloads_values['orders_products_filename']

    are u meant to use single quotes? i didnt know it worked with singles

    Comment


    • #3
      Associative arrays work with single quotes, double quotes, and no quotes.

      Comment


      • #4
        looks like oscommerce to me.... right?

        Comment


        • #5
          Originally posted by xCRYINGoutLOUDx
          it should be like this

          PHP Code:
          if (file_exists(DIR_FS_DOWNLOAD $downloads_values['orders_products_filename'])) {
          echo 
          "123";
          } else {
          echo 
          "abc";

          That won't make any difference, it will work without the braces as well.

          Check that your path is actually correct, by echoing it out.

          PHP Code:
          echo DIR_FS_DOWNLOAD $downloads_values['orders_products_filename']; 
          See what it echoes out, and if you're actually checking the path you think you're checking.

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...
          X