Member
From: west yorkshire
Registered: 2007-10-09
Posts: 166
I've been thanked 8 times.
Offline
I have recently started using phpmyvisits for my stats .
w3c does not validate the code and i wondered if anyone could suggest a fix
website www.daisydiva.co.uk
the code that is put on each page is
Code: html
<!-- phpmyvisites -->
<a href="http://www.phpmyvisites.net/" title="Free web analytics, website statistics"
onclick="window.open(this.href);return(false);"><script type="text/javascript">
<!--
var a_vars = Array();
var pagename='';
var phpmyvisitesSite = 1;
var phpmyvisitesURL = "http://www.daisydiva.co.uk/phpmv2/phpmyvisites.php";
//-->
</script>
<script language="javascript" src="http://www.daisydiva.co.uk/phpmv2/phpmyvisites.js" type="text/javascript"></script>
<object><noscript><p>Free web analytics, website statistics
<img src="http://www.daisydiva.co.uk/phpmv2/phpmyvisites.php" alt="Statistics" style="border:0" />
</p></noscript></object></a>
<!-- /phpmyvisites -->
errors are
Line 141, Column 47: document type does not allow element "a" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag.
onclick="window.open(this.href);return(false);"><script type="text/javascript">✉
The mentioned element is not allowed to appear in the context in which you've placed it; the other mentioned elements are the only ones that are both allowed there and can contain the element mentioned. This might mean that you need a containing element, or possibly that you've forgotten to close a previous element.
One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
Line 150, Column 17: there is no attribute "language".
<script language="javascript" src="http://www.daisydiva.co.uk/phpmv2/phpmyvisite✉
Any help would be much appreciated
Member
From: South Africa, Port Elizabeth
Registered: 2006-08-23
Posts: 1914
I've been thanked 34 times.
Offline
Where in your page is this script placed? i use some java on my site and i keep the actual script in the header and call it from within the body. And my pages validate (if i dont use content pulled from mysql database). Can you give us an example?
My up and coming... soon to be real website... www.thewebguy.co.za (one day i will finish it
)Member
From: west yorkshire
Registered: 2007-10-09
Posts: 166
I've been thanked 8 times.
Offline
the script is placed after the footer just before the close body tag
Code: html
<div id="footer" style="height: 15px">
<p class="style8a">© 2008 Daisy Diva Natural Products</p>
<p>
<a href="./index.htm" title="Back to Homepage">Home</a> ·
<a href="products/moisturisers.htm" title="products">Products</a> ·
<a href="shopping/offers.htm" title="special offers">Special Offers</a> ·
<a href="info/links.htm" title="Links">Links</a> ·
<a href="info/site_map.htm" title="Site Map">Site Map</a> ·
<a href="info/tc.htm" title="terms">Terms and Conditions</a> ·
<a href="info/contact.htm" title="Contact">Contact Us</a><br />
</p>
</div>
</div>
<!-- phpmyvisites -->
<a href="http://www.phpmyvisites.net/" title="Free web analytics, website statistics"
onclick="window.open(this.href);return(false);"><script type="text/javascript">
<!--
var a_vars = Array();
var pagename='';
var phpmyvisitesSite = 1;
var phpmyvisitesURL = "http://www.daisydiva.co.uk/phpmv2/phpmyvisites.php";
//-->
</script>
<script language="javascript" src="http://www.daisydiva.co.uk/phpmv2/phpmyvisites.js" type="text/javascript"></script>
<object><noscript><p>Free web analytics, website statistics
<img src="http://www.daisydiva.co.uk/phpmv2/phpmyvisites.php" alt="Statistics" style="border:0" />
</p></noscript></object></a>
<!-- /phpmyvisites -->
</body>
<!-- #EndTemplate -->
</html>
instalation instructions
javascript code that can be copied and pasted on all the pages that are to be monitored, somewhere between the <body> and </body> tags on the pages in your site (preferrably just before the </body> tag). It is important to not change any line of this code.
hope that helps
Member
From: South Africa, Port Elizabeth
Registered: 2006-08-23
Posts: 1914
I've been thanked 34 times.
Offline
Wow... okay, this has thrown me off a bit. The problem comes in between the two phpmyvisits tags?
<a href="http://www.phpmyvisites.net/" title="Free web analytics, website statistics" onclick="window.open(this.href);return(false);">
<script type="text/javascript">
<!--
var a_vars = Array();
var pagename='';
var phpmyvisitesSite = 1;
var phpmyvisitesURL = "http://www.daisydiva.co.uk/phpmv2/phpmyvisites.php";
//-->
</script>
<script language="javascript" src="http://www.daisydiva.co.uk/phpmv2/phpmyvisites.js" type="text/javascript"></script>
<object><noscript><p>Free web analytics, website statistics
<img src="http://www.daisydiva.co.uk/phpmv2/phpmyvisites.php" alt="Statistics" style="border:0" />
</p></noscript></object></a>
Mkay, from what i can tell, that entire error message is there simply because you have tried to fit the green stuff between the red stuff. Basically you can not put all the scripts and object between "a" tags. Chances are pretty good it will work.. i just wont validate.
what they said wrote:
One possible cause for this message is that you have attempted to put a block-level element (such as "<p>" or "<table>") inside an inline element (such as "<a>", "<span>", or "<font>").
Hope that clarifies that 
My up and coming... soon to be real website... www.thewebguy.co.za (one day i will finish it
)Member
From: west yorkshire
Registered: 2007-10-09
Posts: 166
I've been thanked 8 times.
Offline
thanks will take a look
Administrator
From: Colorado, USA
Registered: 2006-02-15
Posts: 2230
I've been thanked 95 times.
Offline
Simple fixes to get this to validate.
language="javascript" is deprecated and no longer used. This needs to be replaced by type="text/javascript"
In the code snippet above all you need to do is delete language="javascript" modifys the code but does not affect the way it works for your stat reports.
Next issue is to simply place all the the html inside a paragraph or a div.
Code: html
<!-- phpmyvisites -->
<p><a href="http://www.phpmyvisites.net/" title="Free web analytics, website statistics"
onclick="window.open(this.href);return(false);">
<script type="text/javascript">
<!--
var a_vars = Array();
var pagename='';
var phpmyvisitesSite = 1;
var phpmyvisitesURL = "http://www.daisydiva.co.uk/phpmv2/phpmyvisites.php";
//-->
</script>
<script src="http://www.daisydiva.co.uk/phpmv2/phpmyvisites.js" type="text/javascript"></script>
<object><noscript><p>Free web analytics, website statistics
<img src="http://www.daisydiva.co.uk/phpmv2/phpmyvisites.php" alt="Statistics" style="border:0" />
</p></noscript></object></a></p>
<!-- /phpmyvisites -->
Attention designers and webmasters - "The Beauty of CSS"
Valid Web Designs tutorials on HTML, XHTML and CSS
Home Security Systems
Member
From: west yorkshire
Registered: 2007-10-09
Posts: 166
I've been thanked 8 times.
Offline
ColoEagle
Thanks mate worked a treat
Do you mind if I post this on the phpmyvisites forum so that others can benefit - attribited to yourself of course
Thanks again all 
Administrator
From: Colorado, USA
Registered: 2006-02-15
Posts: 2230
I've been thanked 95 times.
Offline
Your welcome.
allenion wrote:
Do you mind if I post this on the phpmyvisites forum so that others can benefit
By all means go ahead. 
Attention designers and webmasters - "The Beauty of CSS"
Valid Web Designs tutorials on HTML, XHTML and CSS
Home Security Systems
| Never |


