Page 1 of 1
Java script php web counter
Posted: Wed Jun 08, 2011 4:23 pm
by hutia
Teh code is:
Code: Select all
<script language="Javascript" src="http://www.newtonmedical.co.uk/forum/counter.php?page=ourteam"><!--//--></script>
I have a folder with logs for each website, and the syntax is correct, so why doesn't it work? Any suggestions?
Re: Java script php web counter
Posted: Thu Jun 09, 2011 4:57 pm
by Klemen
Works fine when I test it, the count is updated. You can check that by opening the counter directly:
http://www.newtonmedical.co.uk/forum/co ... ge=ourteam
For 100% valid code you should break the code in several lines or anything after // will be considered as a comment by Javascript. Try
Code: Select all
<script language="Javascript" src="http://www.newtonmedical.co.uk/forum/counter.php?page=ourteam"><!--
//-->
</script>
Re: Java script php web counter
Posted: Fri Jun 10, 2011 5:59 pm
by hutia
I put the counter scripts on "ourteam" and "links" pages, but it seems to work only when I actually click on the links to the counter.
Besides the script itself shouldn't be visible on the page, how to hide it?
I also tried your code break but it doesn't seem to make any difference.
Re: Java script php web counter
Posted: Sat Jun 11, 2011 7:22 am
by Henrie
The output in the page is :
Code: Select all
<p class='vspace'><script language="Javascript" src="<a class='urllink' href='http://www.newtonmedical.co.uk/forum/counter.php?page=ourteam' rel='nofollow'>http://www.newtonmedical.co.uk/forum/counter.php?page=ourteam</a>"><!--
//-->
</p>
<p class='vspace'></script>
</p>
My guess is you have edited the page with a wysiwyg page editor.
To insert the code please use the option to input html code directly so that no paragraphs are added and that < and > are not converted to < and >
Re: Java script php web counter
Posted: Sun Jun 12, 2011 8:12 am
by Klemen
Henrie is right, you need to paste the Javascript code as HTML source, not like normal text if you use a "wysiwyg" html editor.
You can also try this simple trick:
http://www.phpjunkyard.com/tutorials/cut-paste-code.php
Re: Java script php web counter
Posted: Sun Jun 12, 2011 6:02 pm
by hutia
How do I do exactly the third step?:
then open the HTML file in a plain text editor, like Notepad
Do I do it by right clicking "view source"? There isn't any option to edit it from there.
Re: Java script php web counter
Posted: Mon Jun 13, 2011 12:34 am
by Henrie
Opening in notepad is only possible if you have access to the files on the server (for example through ftp).
What software do you use to edit your webpage. Do you use a software installed on your local computer, or are you using a webbased editor?
Re: Java script php web counter
Posted: Mon Jun 13, 2011 8:43 am
by hutia
I edit it on my computer, for example to edit a page with links I click:
http://www.newtonmedical.co.uk/index.php?n=Main.Links and I don't know what editor it is.
I also have an access to the server and all the files there, and I sometimes use ftp as well.
So should I edit a particular page on the server or via ftp?
Re: Java script php web counter
Posted: Mon Jun 13, 2011 9:25 am
by Henrie
I meant the program you are running in which you click that link? You can see it in the title-bar of the program window. Is it a webbrowser like Internet Explorer or Firefox, or maybe a local editor like Dreamweaver.
But if you use FTP as well, than copy the page in which you want to add the code to your computer using FTP. Than open the file with notepad and paste the code as described in the tutorial that Klemen linked. Than save the file and upload it to the server again.