Announcement

Collapse
No announcement yet.

saving a file on directory down with php

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

  • merk
    replied
    Originally posted by Duke of Lions
    Well i fixed it like this $filename = "content/" . $filenamen;

    That's it.

    And yep it was a constant but this is the easiest way to fix it,
    @ least I think so after a few bears and a long night on the town...
    so you defined "constant" in a define() function?

    Leave a comment:


  • Duke of Lions
    replied
    Originally posted by merk
    IS "content" a constant? (if it is, this doesnt apply)

    You need to surround it with "".

    Same with the /.
    Well i fixed it like this $filename = "content/" . $filenamen;

    That's it.

    And yep it was a constant but this is the easiest way to fix it,
    @ least I think so after a few bears and a long night on the town...

    Leave a comment:


  • merk
    replied
    IS "content" a constant? (if it is, this doesnt apply)

    You need to surround it with "".

    Same with the /.

    Leave a comment:


  • Duke of Lions
    replied
    That's up for me not down....

    Originally posted by Game Wizards
    Let's say the script is located in /home/username/public_html/script/ - You can use ../$filename and it'll be in the directory below where the script is located, in this case /home/username/public_html/.
    For me that's one directory up, not down but when I do content/$filename it says division by zero not possible....

    Leave a comment:


  • Game Wizards
    replied
    Let's say the script is located in /home/username/public_html/script/ - You can use ../$filename and it'll be in the directory below where the script is located, in this case /home/username/public_html/.

    Leave a comment:


  • Duke of Lions
    started a topic saving a file on directory down with php

    saving a file on directory down with php

    Hi you guys....

    I want to save a file one directory down the actual script, how do I do this?
    I am using these lines...

    PHP Code:
    if (is_writable(content/$filename)) {
      if (
    $handle fopen($DOCUMENT_ROOT/content/$filename"w")) {
       
    fwrite($handle$escapedcontent);
       
    fclose($handle); 
    Thanks!
widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
Working...
X