temp_me Posted October 8, 2007 Share Posted October 8, 2007 I am not a hacker, but i found http://www.sr-ultimate.com/2005/02/14/ip-showing-signature-hit-counter/ and thought of trying it out, this didn't work, so i came here. :-\ this is what i got: http://www.zendurl.com/x/xlrstore/in.php and here is the source of my index.php please tell me what has gone wrong? < ?php $TextFile = "counter.txt"; $Count = trim(file_get_contents($TextFile)); $FP = fopen($TextFile, "r"); $Count=fgets($FP, 4096); fclose ($FP); settype($Count, "integer"); $Count++; if ($FP = fopen ($TextFile, "w")){ fwrite ($FP, $Count); fclose ($FP); } $image = "counterpic.png"; $im = imagecreatefrompng($image); $red = ImageColorAllocate ($im, 255, 0, 0); $blue = ImageColorAllocate ($im, 0, 0, 255); $hit = "$Count"; $ip = $_SERVER["REMOTE_ADDR"]; ImageString($im, 2, 18, 1, "www.sr-ultimate.com", $blue); ImageString($im, 2, 1, 19, " Your ip: $ip", $red); ImageString($im, 2, 1, 30, " Page visited $hit times ", $red); header("Content-Type: image/png"); Imagepng($im,'',100); ImageDestroy ($im); ?> thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/72281-why-isnt-this-code-worrking/ Share on other sites More sharing options...
d.shankar Posted October 8, 2007 Share Posted October 8, 2007 Your Host doesn't support PHP Quote Link to comment https://forums.phpfreaks.com/topic/72281-why-isnt-this-code-worrking/#findComment-364496 Share on other sites More sharing options...
MadTechie Posted October 8, 2007 Share Posted October 8, 2007 Your Host doesn't support PHP Yes, it does! otherwise the code would be displayed!... OK problems #1 you can not have anything else at the start of the page, you have this <p align="center"> <script type="text/javascript"><!-- google_ad_client = "pub-4820636587049265"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text_image"; //2007-09-15: userpages_top google_ad_channel = "1427674372"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </p> #2.at the end of the page you have this <p align="center"><font size="1"><a href="http://www.tomorrowhosting.com">Get High Quality Hosting Starting For Only One Cent At Tomorrow Hosting</a></font></p> <p align="center"><font size="1">These ZendURL Ads <b>Are Not </b>Forced. Click <a href="http://www.zendurl.com/noads.html" target="_blank">Here</a> To Disable Them Permanently!</font></p> <!-- Start of StatCounter Code --> <script type="text/javascript" language="javascript"> var sc_project=1144755; var sc_invisible=1; var sc_partition=10; var sc_security="d3d7ec5e"; </script> <script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img src="http://c11.statcounter.com/counter.php?sc_project=1144755&java=0&security=d3d7ec5e&invisible=1" alt="hit tracker" border="0"></a> </noscript> <!-- End of StatCounter Code --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-835715-1"; urchinTracker(); </script> #3. < ?php should be <?php #4. line 26 Imagepng($im,'',100);" should be Imagepng($im); save the file as is (with corrections) then add it into some HTML as you would any image ie <img src="balr.php"> EDIT: the file above should be its own file (think of it as an image) Quote Link to comment https://forums.phpfreaks.com/topic/72281-why-isnt-this-code-worrking/#findComment-364503 Share on other sites More sharing options...
temp_me Posted October 8, 2007 Author Share Posted October 8, 2007 Yu mean like this?? <p align="center"> <script type="text/javascript"><!-- google_ad_client = "pub-4820636587049265"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text_image"; //2007-09-15: userpages_top google_ad_channel = "1427674372"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </p> <? $TextFile = "counter.txt"; $Count = trim(file_get_contents($TextFile)); $FP = fopen($TextFile, "r"); $Count=fgets($FP, 4096); fclose ($FP); settype($Count, "integer"); $Count++; if ($FP = fopen ($TextFile, "w")){ fwrite ($FP, $Count); fclose ($FP); } $image = "pic.gif"; $im = imagecreatefrompng($image); $red = ImageColorAllocate ($im, 255, 0, 0); $blue = ImageColorAllocate ($im, 0, 0, 255); $hit = "$Count"; $ip = $_SERVER["REMOTE_ADDR"]; ImageString($im, 2, 18, 1, "random.php", $blue); ImageString($im, 2, 1, 19, " Your ip: $ip", $red); ImageString($im, 2, 1, 30, " Signature viewed $hit times ", $red); header("Content-Type: image/png"); Imagepng($im); ImageDestroy ($im); ?> <p align="center"><font size="1"><a href="http://www.tomorrowhosting.com">Get High Quality Hosting Starting For Only One Cent At Tomorrow Hosting</a></font></p> <p align="center"><font size="1">These ZendURL Ads <b>Are Not </b>Forced. Click <a href="http://www.zendurl.com/noads.html" target="_blank">Here</a> To Disable Them Permanently!</font></p> <!-- Start of StatCounter Code --> <script type="text/javascript" language="javascript"> var sc_project=1144755; var sc_invisible=1; var sc_partition=10; var sc_security="d3d7ec5e"; </script> <script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img src="http://c11.statcounter.com/counter.php?sc_project=1144755&java=0&security=d3d7ec5e&invisible=1" alt="hit tracker" border="0"></a> </noscript> <!-- End of StatCounter Code --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-835715-1"; urchinTracker(); </script> and my host supports php: http://xlrblog.zendurl.com//shoutpro/shoutbox.php Quote Link to comment https://forums.phpfreaks.com/topic/72281-why-isnt-this-code-worrking/#findComment-364515 Share on other sites More sharing options...
MadTechie Posted October 8, 2007 Share Posted October 8, 2007 no you need 2 files first create a file called ip.php use ONLY the code below file 1 <?php $TextFile = "counter.txt"; $Count = trim(file_get_contents($TextFile)); $FP = fopen($TextFile, "r"); $Count=fgets($FP, 4096); fclose ($FP); settype($Count, "integer"); $Count++; if ($FP = fopen ($TextFile, "w")){ fwrite ($FP, $Count); fclose ($FP); } $image = "pic.gif"; $im = imagecreatefrompng($image); $red = ImageColorAllocate ($im, 255, 0, 0); $blue = ImageColorAllocate ($im, 0, 0, 255); $hit = "$Count"; $ip = $_SERVER["REMOTE_ADDR"]; ImageString($im, 2, 18, 1, "random.php", $blue);//will only display "random.php" ImageString($im, 2, 1, 19, " Your ip: $ip", $red); ImageString($im, 2, 1, 30, " Signature viewed $hit times ", $red); header("Content-Type: image/png"); Imagepng($im); ImageDestroy ($im); ?> please note thats you have code for reading from a text file then the second file, your use the above file as an image, see <img src="ip.php"> in the below file, file 2 <p align="center"> <script type="text/javascript"><!-- google_ad_client = "pub-4820636587049265"; google_ad_width = 728; google_ad_height = 90; google_ad_format = "728x90_as"; google_ad_type = "text_image"; //2007-09-15: userpages_top google_ad_channel = "1427674372"; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script> </p> <img src="ip.php"> <p align="center"><font size="1"><a href="http://www.tomorrowhosting.com">Get High Quality Hosting Starting For Only One Cent At Tomorrow Hosting</a></font></p> <p align="center"><font size="1">These ZendURL Ads <b>Are Not </b>Forced. Click <a href="http://www.zendurl.com/noads.html" target="_blank">Here</a> To Disable Them Permanently!</font></p> <!-- Start of StatCounter Code --> <script type="text/javascript" language="javascript"> var sc_project=1144755; var sc_invisible=1; var sc_partition=10; var sc_security="d3d7ec5e"; </script> <script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js"></script><noscript><a href="http://www.statcounter.com/" target="_blank"><img src="http://c11.statcounter.com/counter.php?sc_project=1144755&java=0&security=d3d7ec5e&invisible=1" alt="hit tracker" border="0"></a> </noscript> <!-- End of StatCounter Code --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-835715-1"; urchinTracker(); </script> Quote Link to comment https://forums.phpfreaks.com/topic/72281-why-isnt-this-code-worrking/#findComment-364521 Share on other sites More sharing options...
temp_me Posted October 8, 2007 Author Share Posted October 8, 2007 It doesn't work, i am going to bed, see you 2morow, here is the most recent problems: http://www.zendurl.com/x/xlrstore/sig.gif/ folder with the php file http://www.zendurl.com/x/xlrstore/sig.gif/ip.php actual php file Bye Quote Link to comment https://forums.phpfreaks.com/topic/72281-why-isnt-this-code-worrking/#findComment-364541 Share on other sites More sharing options...
MadTechie Posted October 9, 2007 Share Posted October 9, 2007 your code is calling pic.gif as a PNG file. thats need correcting and you still have the javascript attached (see my first post) its probably being added by the host, how are you uploading the file ? you should use FTP Quote Link to comment https://forums.phpfreaks.com/topic/72281-why-isnt-this-code-worrking/#findComment-365305 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.