Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old April 7th, 2004, 12:30 PM
Amadeus Amadeus is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Ottawa, Canada
Posts: 9 Amadeus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Amadeus Send a message via AIM to Amadeus Send a message via Yahoo to Amadeus
CSS Validation

I have the following line of code one one of my pages.

php Code:
Original - php Code
  1.  
  2. $amount = isset($HTTP_GET_VARS["amount"]) ? $HTTP_GET_VARS["amount"] : '';


However, when I try to pass that page through a css validator, it gives me the follwoing error

'Please, validate your XML document first!
Line 31
Column 97
The reference to entity "amount" must end with the ';' delimiter.
'

I'm trying a few variations. Oddly enough, if I remove the semi colon, the page will validate, but, of course, then there's a parse error, and the code won't execute. Any sugestions?

Amadeus

Reply With Quote
  #2  
Old April 7th, 2004, 02:33 PM
honcho's Avatar
honcho honcho is offline
Contributing User
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Cape Cod
Posts: 1,347 honcho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 h 52 m 2 sec
Reputation Power: 3
RE: CSS Validation

You should be validating the output of the script, the the script itself.

Reply With Quote
  #3  
Old April 7th, 2004, 04:10 PM
brut brut is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 367 brut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 30 sec
Reputation Power: 2
RE: CSS Validation

Wherever you're eching $amount, try:
php Code:
Original - php Code
  1.  
  2. echo $amount.";";

If you don't follow, post some further code, specifically where the css is built.

Reply With Quote
  #4  
Old April 7th, 2004, 05:08 PM
Amadeus Amadeus is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Ottawa, Canada
Posts: 9 Amadeus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Amadeus Send a message via AIM to Amadeus Send a message via Yahoo to Amadeus
RE: CSS Validation

That's the problem. I'm never actually echoing $amount. Below is th full code for the page (as it stands now, I've pared it back quite a bit to locate the problem.

php Code:
Original - php Code
  1.  
  2. <?
  3. $dbh=mysql_connect ("localhost", "amadeus_", "") or die ('I cannot connect to the database because: ' . mysql_error());
  4. mysql_select_db ("amadeus_cslewis");
  5. if($HTTP_GET_VARS['amount'] == 'all')
  6. {
  7.    $strSQL = "SELECT * FROM blog ORDER BY pk_ID desc";
  8. }
  9. else
  10. {
  11.   $strSQL = "SELECT * FROM blog ORDER BY pk_ID desc limit 5";
  12. }
  13. //echo $strSQL;
  14. $result = mysql_query($strSQL) or die("Failed query: ".mysql_error());
  15. ?>
  16. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  17. <tr><td align="center"><table width="60%" border="0" cellspacing="0" cellpadding="0">
  18.    <tr><td>&nbsp;</td></tr>
  19.    <tr><td align="center"><b>Blog Entries - What a Read!</b> <a href="index.php?page=blog&amount=all" style="text-decoration:none">[ALL]</a></td></tr>
  20.    <tr><td>&nbsp;</td></tr>
  21. <?
  22. while($row = mysql_fetch_array($result))
  23. {
  24.    echo "<tr><td align='center' width='20%'>Entry Date - ".$row['blog_date']."</td></tr>";
  25.    echo "<tr><td>&nbsp;</td></tr>";
  26.    echo "<tr><td align='center' width='20%'>".$row['blog_text']."</td></tr>";
  27.    echo "<tr><td>&nbsp;</td></tr>";
  28.    echo "<tr><td><hr width='100%'/></td></tr>";
  29. }
  30. ?>
  31. </table></td></tr>
  32. </table>

I'm at a bit of a loss to see why this won't pass a CSS validator. The error posted in my first post continues to be generated by this line.
php Code:
Original - php Code
  1.  
  2. if($HTTP_GET_VARS['amount'] == 'all')

Any suggestions would be appreciated.

Reply With Quote
  #5  
Old April 7th, 2004, 05:22 PM
Amadeus Amadeus is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Ottawa, Canada
Posts: 9 Amadeus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Amadeus Send a message via AIM to Amadeus Send a message via Yahoo to Amadeus
RE: CSS Validation

hmmm... perhaps it's not that line of code. It may have something to do with the <a href) tag specifying the quersytring parameters...

Reply With Quote
  #6  
Old April 7th, 2004, 05:44 PM
brut brut is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 367 brut User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 3 m 30 sec
Reputation Power: 2
RE: CSS Validation

I'm confused now. Please post a link to this page, or if you can't then view source on the output and post that.

Reply With Quote
  #7  
Old April 7th, 2004, 05:45 PM
Ashkhan Ashkhan is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 372 Ashkhan User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 24 m 57 sec
Reputation Power: 2
RE: CSS Validation

If you want to find CSS error you must look at the output of your php script. The validator also takes result and not the php code if you validate an URL.


Reply With Quote
  #8  
Old April 7th, 2004, 09:53 PM
Nicky's Avatar
Nicky Nicky is offline
Contributing User
Codewalkers Novice (500 - 999 posts)
 
Join Date: Apr 2007
Location: Neverland
Posts: 606 Nicky User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 3 m 26 sec
Reputation Power: 2
RE: CSS Validation

No clue = but try this:

$amount = (isset($HTTP_GET_VARS["amount"])?$HTTP_GET_VARS["amount"]:"");

Reply With Quote
  #9  
Old April 9th, 2004, 01:17 PM
Amadeus Amadeus is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Ottawa, Canada
Posts: 9 Amadeus User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Send a message via ICQ to Amadeus Send a message via AIM to Amadeus Send a message via Yahoo to Amadeus
RE: CSS Validation

Well, after trying a few things, I managed to narrow it down to a link that was on the page, the code being the following:

<a href="index.php?page=blog&amount=all" style="text-decoration:none">[ALL]</a>

Apparently, the css validator did not like the use of the actual ampersand (&), it had to be switched to the %26; characyer code. LOL, live and learn.

Thnaks to all for your help, it's been much appreciated.

Reply With Quote
  #10  
Old April 12th, 2004, 01:11 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: CSS Validation

more precisely, you should use change & into &

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > CSS Validation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support |