Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Apr 2004
    Posts
    684
    Thanks
    24
    Thanked 1 Time in 1 Post

    Having problems with include..

    It writes to the files fine & creates them etc.. but including the file spouts errors even tho the file "does" exist.

    PHP Code:
    <?php

    $file
    ="num.txt";

    $content file_get_contents($file);

    $content++;

    $resourceid fopen($file"w");

    fputs($resourceid$content);

    fclose($resourceid);

    $sn $content;

    $snf $sn "file.txt";


    $fd fopen("files/$snf""w");

    fputs($fd"\$fileid = $sn;");

    fclose($fd);


    include(
    'files/$snf');

    ?>
    Any clue?
    Last edited by cyphix; 05-14-2004 at 11:25 PM.

  • #2
    Regular Coder
    Join Date
    Apr 2004
    Posts
    684
    Thanks
    24
    Thanked 1 Time in 1 Post
    Forgot... the errors are:

    Warning: main(files/$snf): failed to open stream: No such file or directory in xxxxxxxxxxxxxx/test.php on line 28

    Warning: main(): Failed opening 'files/$snf' for inclusion (include_path='.:/usr/local/lib/php') in xxxxxxxxxxxxxxxxxxxx/test.php on line 28

  • #3
    Regular Coder
    Join Date
    Apr 2004
    Posts
    684
    Thanks
    24
    Thanked 1 Time in 1 Post
    nm.. got it figured out. Should of used double quotes instead.


  •  

    Posting Permissions

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