Jump to content

TheElemethian

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

TheElemethian's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Really? REALLY? You're kidding me. It works now. Gahh. Hahahah. Thank you so much, Mark!
  2. Or is there some other way to embed a script (or image) into an HTML message, and record the IP that loads it? I don't care about the login, or anything. I just want the IP Address.
  3. Warning: fread() [function.fread]: Length parameter must be greater than 0 in /home2/onethrt5/public_html/theelemethian/tracker/admin.php on line 18 when I attempted to manually define the $myFile string. Edited admin.php lines 14-20: <? $id = $_GET['id'] ; $myFile = "og/log.htm"; $fh = fopen("log/log.htm[", 'r'); $theData = fread($fh, filesize("log/log.htm")); fclose($fh); echo $theData; ?>
  4. :/ Alright, well. I created the necessary folders, and allowed writing to them. But it returns the same message. Line 17 in admin.php: $fh = fopen($myFile, 'r'); While the lines just before that are attempting to define $myfile Should I just try to manually define a file for this to log the information I want?
  5. Well, I'll look into allowing access. Which I will find the answer to elsewhere, unless someone knows off the top of their head. But what all folders are supposed to exist?
  6. So, I'm new at this stuff, obviously, and I'm attempting to use this script that, when all is said and done, will log the computers IP address that loads the image. I start with a folder on my FTP called "tracker" Inside of tracker is another folder called "log" Files inside of tracker: moo.gif track.php login.htm admin.php track.php includes: <? $image = "moo.gif" ; $id = $_GET['id'] ; $logfile= "log/$id.htm"; $IP = $_SERVER['REMOTE_ADDR']; $logdetails= date("F j, Y, g:i a") . ': ' . '<a href=http://dnsstuff.com/tools/city.ch?ip='.$_SERVER['REMOTE_ADDR'].'>'.$_SERVER['REMOTE_ADDR'].'</a>'; $imagedir = "" ; if (isset($image) { $imagepath = $imagedir.$image ; $imageinfo = getimagesize( $imagepath ); header( "Content-type: image/jpg" ); @readfile( $imagepath ); if(isset ($_COOKIE['identifier'])){ $visitorid = $_COOKIE['identifier']; $visitornumber = " Visitor ID: $visitorid"; } else{ $r1 = rand (0, 9); $r2 = rand (0, 9); $r3 = rand (0, 9); $r4 = rand (0, 9); $r5 = rand (0, 9); $r6 = rand (0, 9); $r7 = rand (0, 9); $r8 = rand (0, 9); $r9 = rand (0, 9); $rnumber = $r1.$r2.$r3.$r4.$r5.$r6.$r7.$r8.$r9; setcookie("identifier", $rnumber, time()+155520000); $visitornumber = " Visitor ID: $rnumber"; } $fp = fopen($logfile, "a"); fwrite($fp, $logdetails.$visitornumber ); fwrite($fp, "<br>"); fclose($fp); } else { header( "HTTP/1.0 404 Not Found" ); exit ; } ?> Login.htm: <html> <head> <title>Tracker Login</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <form action="admin.php" method="get"><table width="575" border="0" align="center" cellpadding="5" cellspacing="5"> <!--DWLayoutTable--> <tr> <td height="31" colspan="6" valign="top"><div align="center"><strong><font face="Verdana, Arial, Helvetica, sans-serif">Login Below </font></strong></div></td> </tr> <tr> <td width="33" height="25"></td> <td width="118"></td> <td width="80"></td> <td width="85"></td> <td width="114"></td> <td width="50"></td> </tr> <tr> <td height="32"> </td> <td colspan="2" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif">Enter your ID number</font></td> <td colspan="2" valign="top"> <input size="35" name="id" type="text"> </td> <td></td> </tr> <tr> <td height="17"></td> <td></td> <td></td> <td></td> <td></td> <td></td> </tr> <tr> <td height="34"></td> <td></td> <td colspan="2" align="center" valign="middle"><input type="submit" name="Submit" value="Submit" action="get"></td> <td> </td> <td> </td> </tr> <tr> <td height="58"></td> <td></td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> </form> </body> </html> admin.php: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Visitor Detail</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body> <table align="center" width="855" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td align="center" width="855" height="245"> <? $id = $_GET['id'] ; $myFile = "log/$id.htm"; $fh = fopen($myFile, 'r'); $theData = fread($fh, filesize($myFile)); fclose($fh); echo $theData; ?> </td> </tr> </table> </body> </html> Here is the site that I got the code from: http://www.soggycowdesigns.com/tests/myspacetracker.htm And www.theelemethian.com/tracker/info.php is my host info. I use Bluehost. Here is what I get when I try to login: Warning: fopen(log/13.htm) [function.fopen]: failed to open stream: No such file or directory in /home2/onethrt5/public_html/theelemethian/tracker/admin.php on line 17 Warning: filesize() [function.filesize]: stat failed for log/13.htm in /home2/onethrt5/public_html/theelemethian/tracker/admin.php on line 18 Warning: fread(): supplied argument is not a valid stream resource in /home2/onethrt5/public_html/theelemethian/tracker/admin.php on line 18 Warning: fclose(): supplied argument is not a valid stream resource in /home2/onethrt5/public_html/theelemethian/tracker/admin.php on line 19 I hope this is just a simple fix, but if it is, I'll feel dumber than I do. I really appreciate any help that you guys can give. Thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.