Building website and need help please :)

6 posts / 0 new
Last post
SAmarantine
Building website and need help please :)

Ok I'm helping my friend build his website and my brain is bleeding lol..

I want to put a HTML  hit counter on the page. I found one for the date. Found here www.webdevelopersnotes.com/tips/html/formatting_time_using_javascript.php3

 

Also, I want to use the code  to make scrolling pictures. I looked at the source code, but I'm not sure where the code ends and begins exactly. The code I'm talking about can be found here www.dragonnorth.com/htmltricks/scrollpix.html

 

Can anyone help??

   

   

snakeeater251
Re: Building website and need help please :)

I doubt you'll be able to add a hit counter with just HTML and Javascript. Most likely you'll need to use a server-side programming language in addition to HTML in order to do this.

Does your server support anything like Perl, PHP or ASP?

SAmarantine
Re: Building website and need help please :)

Hey, Thanks for the info... I believe they support PHP.

 

 

" Mekka Lekka Hi-Mekka Hiney Ho"

 

Stevie
Re: Building website and need help please :)

If all you want is a simple black and white HTML hit counter with the number centered, use this code below and replace "SAmarantine12345678" with something no one has ever thought of.  Change the name and it resets back to 1.

 

<div align="center"><center>

<table border="0" cellpadding="0" cellspacing="0" width="10" height="2" bgcolor="#C0C0C0">
  <tr>
    <td width="34" height="2">
    <img src="http://www.mit.edu/cgi/counter/SAmarantine12345678" alt="several"></td>
  </tr>
</table>
</center></div>

 

Pembo210
Re: Building website and need help please :)

You can make an easy one using PHP.

You'll have to change your files to "name.php" instead of "name.html" and you'll need to have the two following files in the same directory (folder) as the webpage that you want the counter on. So if your website page that it will be on is "www.website.com/index.html" you'll need to change "index.html" to "index.php"

Open notepad and put:

<?php
$count_my_page
= ("hitcounter.txt");
$hits = file($count_my_page);
$hits[] ++;
$fp = fopen($count_my_page , "w");
fputs($fp , "$hits[]");
fclose($fp);
echo
$hits[];
?>

Then Save As "counter.php"

Then open notepad again and put "1" and Save As "hitcounter.txt"

Then take these two files and put them on your web server in the directory that the page that will have the counter is in.

Where ever you want the hit counter to appear put:

<?php
include ("counter.php");
?>

This is PHP code that will tell it to find the "counter.php" file and show the current number that is on the "hitcounter.txt" file. Each time the page is loaded the "counter.php" file will load the number from "hitcounter.txt" and add one to it and save the changes.

Pembo210
Re: Building website and need help please :)

for scrolling images check out Dynamic Drive

Add new comment