joshg678 Posted December 11, 2006 Share Posted December 11, 2006 Not the best, but a little something i made for you all First create your a text file named "count.txt" and put the number 0 in it, then save it. Upload it and chmod is at 0666 Next open a text editor, and create a file called count.php and put the following code in: <?php // Copyright (c) Josh Gould $COUNT_FILE = "count.txt"; // File DB that holds ur amount of hits if (file_exists($COUNT_FILE)) { ? $fp = fopen("$COUNT_FILE", "r+"); ? flock($fp, 1); ? ? $count = fgets($fp, 4096); ? ? $count += 1; ?// Adds one count to file for hits ? fseek($fp,0); ? ? fputs($fp, $count); ? ? flock($fp, 3); ? ? fclose($fp); ? ? echo "Hits: <b>"; ? include "$COUNT_FILE"; ? echo "</b><!-- hit counter by Josh Gould at http://scripts.joshrcc.com -->"; } else { ? echo "Can't find file, check '\$file'<BR>"; // Error message } ?> Then when ever you want to count people's hits, just use this code: <?php include 'count.php'; ?> Quote Link to comment Share on other sites More sharing options...
Capman Posted December 12, 2006 Share Posted December 12, 2006 Soooooooooo, Josh. You know about web programming I guess. I need help. I want to embed a html page within a html page. How do I do it? Quote Link to comment Share on other sites More sharing options...
joshg678 Posted December 14, 2006 Author Share Posted December 14, 2006 its very simple, however you will have to use php files instead of html files. Example on how to include files using php <?php include "files.html"; ?> When you go to include the files, it can be any type of file, but where you put the script above has to be in a php file for it to work. Quote Link to comment Share on other sites More sharing options...
Capman Posted December 17, 2006 Share Posted December 17, 2006 Went over my head josh, I guess I am a stupid moronic id***. It gives me something to play with though, I'll try and figure it out. Quote Link to comment Share on other sites More sharing options...
joshg678 Posted December 18, 2006 Author Share Posted December 18, 2006 haha, well you would not be the first one :happybday: Quote Link to comment Share on other sites More sharing options...
Ma TriX 0978 Posted January 1, 2007 Share Posted January 1, 2007 IM probably late on answering this but you would need to use frames. I wouldnt recommend this, but google it and see what you come up with. Quote Link to comment Share on other sites More sharing options...
Capman Posted January 1, 2007 Share Posted January 1, 2007 Been there and done that with frames, back in 2004. Never again! Quote Link to comment Share on other sites More sharing options...
Ma TriX 0978 Posted January 1, 2007 Share Posted January 1, 2007 Lol then the other way would be to use PHP includes like josh stated. I would be glad to help if needed Quote Link to comment 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.