here is my code it is supposed to be an iplogger.

<script language="php"><%
$log_file = "ip.txt";
$ip = getenv('REMOTE_ADDR');
$fp = fopen("$log_file", "n");
fputs($fp, "$iprn");
flock($fp, 3);
fclose($fp);
PRINT("Your Ip was logged.....$ip");
%>
</script>
I am using frontpage 2000. On a local server, win98.
Here is the link.
http//storiesfrommissouri.com/test.php

Ok i took out th <% and %> and now i get

Warning: fopen(ip.txt) [function.fopen]: failed to create stream: No error in C:\sfm\~phpi_attlp.php on line 109

Warning: fputs(): supplied argument is not a valid stream resource in C:\sfm\~phpi_attlp.php on line 110

Warning: flock(): supplied argument is not a valid stream resource in C:\sfm\~phpi_attlp.php on line 111

Warning: fclose(): supplied argument is not a valid stream resource in C:\sfm\~phpi_attlp.php on line 112
Your Ip was logged.....

I know your supposed to chmod775 but i have no idea what that is on a local server? I also have no idea how to implement php i just download scripts and use the ones i like. :rolleyes:

    Thanks for the help.

    But now I get

    Warning: fopen(ip.txt) [function.fopen]: failed to create stream: No error in C:\sfm\~phpi_mgjsc.php on line 109

    Warning: fputs(): supplied argument is not a valid stream resource in C:\sfm\~phpi_mgjsc.php on line 110

    Warning: flock(): supplied argument is not a valid stream resource in C:\sfm\~phpi_mgjsc.php on line 111

    Warning: fclose(): supplied argument is not a valid stream resource in C:\sfm\~phpi_mgjsc.php on line 112
    Your Ip was logged.....

      try the thing I said, but use [man]fwrite[/man] instead of [man]fputs[/man]

        I have it running on a test page but my nav on the left isnt working. Please compare here
        Home Page
        PHP TEST
        Any easy solutions, although i know there isn't an easy ones.

        Oh yeah the way I got it to work was reset my comp. but I already did that 3 times?????? Wierd stuff. Also maybe I needed to reset after changing my "php.ini" file. man all of the thing i could or should I say want to do now that I found out what php can do for me. I just hope I have enough coffee and creamer around.

          Originally posted by delawarerocket
          here is my code it is supposed to be an iplogger.


          $fp = fopen("$log_file", "n");



          try using "a" instead of "n"

            I just put a link to the php page. i did both "a" and "n" Its a shared border in frontpage if that means anything .
            Well this works for me i dont wanna spend all of my time on 1 problem when i have a fairly good solution for it, but thanks for the input.

            time to find another script that im gonna have trouble with. Man I knew I should have went to school for web apps.

              Write a Reply...