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 6 of 6

Thread: fopen problem

  1. #1
    Regular Coder Ranger56's Avatar
    Join Date
    Mar 2005
    Location
    Kent, WA.
    Posts
    783
    Thanks
    0
    Thanked 0 Times in 0 Posts

    fopen problem

    url:http://spiderseatbabies.com/test/

    code:
    PHP Code:
    <?php

    $test 
    fopen("/home/.andre/knightrider/spiderseatbabies.com/test/m.txt""r");
    echo 
    $test;
     
     
    ?>
    In the text file it just says "Test" but when I load the page it says "Resource id #1".

  • #2
    Regular Coder
    Join Date
    Aug 2006
    Location
    UK, London, Dartford
    Posts
    221
    Thanks
    3
    Thanked 14 Times in 14 Posts
    Thats correct you have opened it but not read the content so you would do:

    PHP Code:
    $file "main.php";
    $file_open fopen($file'r');
    $theData fread($file_openfilesize($file));
    echo 
    $theData
    Hope that helps

  • #3
    Regular Coder Ranger56's Avatar
    Join Date
    Mar 2005
    Location
    Kent, WA.
    Posts
    783
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks!

  • #4
    Regular Coder
    Join Date
    Aug 2006
    Location
    UK, London, Dartford
    Posts
    221
    Thanks
    3
    Thanked 14 Times in 14 Posts
    No problem let me no if it works, that off the top of my head.

  • #5
    Regular Coder Ranger56's Avatar
    Join Date
    Mar 2005
    Location
    Kent, WA.
    Posts
    783
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Lee Stevens
    No problem let me no if it works, that off the top of my head.
    It works

  • #6
    Regular Coder
    Join Date
    Aug 2006
    Location
    UK, London, Dartford
    Posts
    221
    Thanks
    3
    Thanked 14 Times in 14 Posts
    Chears Hope i can help again soon.


  •  

    Posting Permissions

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