Cable Forum

Cable Forum (https://www.cableforum.uk/board/index.php)
-   Internet Discussion (https://www.cableforum.uk/board/forumdisplay.php?f=25)
-   -   An php gurus about (markup validation) (https://www.cableforum.uk/board/showthread.php?t=51009)

handyman 08-08-2006 22:49

Any html gurus about (markup validation)
 
I have successfully removed 36 of 39 errors from my web site but have the following 3 errors still remaining in the source included at the bottom.
  1. <LI class=msg_err>Error Line 24, column 55: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag .
    <input type="text" value="" name="s" id="s" size="21" />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>").


    <LI class=msg_err>Error Line 25, column 55: document type does not allow element "input" here; missing one of "p", "h1", "h2", "h3", "h4", "h5", "h6", "div", "pre", "address", "fieldset", "ins", "del" start-tag . <input type="submit" id="searchsubmit" value="search" />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>").

  2. Error Line 36, column 19: document type does not allow element "li" here; missing one of "ul", "ol" start-tag . <li class="pagenav"> <ul><li class="page_item"><a href="http://pinkforgirls.co.uThe 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>").
Quote:

<div class="side">
<br/>
<form method="get" id="searchform" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input type="text" value="<?php echo wp_specialchars($s, 1); ?>" name="s" id="s" size="21" />
<input type="submit" id="searchsubmit" value="search" />
</form>
<br/>
any help / pointers would be welcome

Strzelecki 08-08-2006 23:21

Re: An php gurus about (markup validation)
 
Why PHP markup, you've tried to put it through the XHTML validator. It's not complaining about the PHP. Any chance of seeing the whole document that you're trying to validate, can sometimes pick things that are causing these errors further on. What doctype are you using? For staters it appears that you specified a list (li) without saying what kind (Unordered UL or ordered OL).

Flobajob 08-08-2006 23:52

Re: An php gurus about (markup validation)
 
Quote:

Originally Posted by Strzelecki
Why PHP markup, you've tried to put it through the XHTML validator. It's not complaining about the PHP. Any chance of seeing the whole document that you're trying to validate, can sometimes pick things that are causing these errors further on. What doctype are you using? For staters it appears that you specified a list (li) without saying what kind (Unordered UL or ordered OL).

Try this: http://validator.w3.org/check?uri=ww...forgirls.co.uk

---------- Post added at 22:52 ---------- Previous post was at 22:43 ----------

To fix the form validation errors, just put <fieldset></fieldset> around your input tags

handyman 08-08-2006 23:53

Re: An php gurus about (markup validation)
 
Quote:

Originally Posted by Strzelecki
Why PHP markup, you've tried to put it through the XHTML validator. It's not complaining about the PHP. Any chance of seeing the whole document that you're trying to validate, can sometimes pick things that are causing these errors further on. What doctype are you using? For staters it appears that you specified a list (li) without saying what kind (Unordered UL or ordered OL).

re php I get a little confused with web stuff, your right its the html its not liking..

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

ful document is http://pinkforgirls.co.uk/wp-content...-101/index.php

Paul 08-08-2006 23:53

Re: An php gurus about (markup validation)
 
Sorry but I can't see what this has to do with php, and I know very little about html, which is what this appears to be.

Edit: NM, you replied at the same time. :)

handyman 08-08-2006 23:58

Re: An php gurus about (markup validation)
 
Quote:

Originally Posted by Flobajob
Try this: http://validator.w3.org/check?uri=ww...forgirls.co.uk

---------- Post added at 22:52 ---------- Previous post was at 22:43 ----------

To fix the form validation errors, just put <fieldset></fieldset> around your input tags

Fantastic 1 error remaining :D

Flobajob 08-08-2006 23:58

Re: An php gurus about (markup validation)
 
And to fix the <li> validation just remove the opening and closing LI tag on line 55/56 as you don't need them, the document will then validate as XHTML strict (I've tried it)

so it should just read: <ul><li class="page_item"><a href="http://pinkforgirls.co.uk/?page_id=2" title="Why Pinkforgirls?">Why Pinkforgirls?</a></li></ul>

handyman 09-08-2006 00:10

Re: An php gurus about (markup validation)
 
Cheers for the help.

That bit of html is the output from these php lines.

Code:

<div class="sideheading">pages</div>
<?php wp_list_pages('title_li= '); ?>

However what I cannot find is where I can modify wp_list_pages

Strzelecki 09-08-2006 00:23

Re: An php gurus about (markup validation)
 
Looks like a call to a function to me, you'll have to search through your php files for the
PHP Code:

function wp_list_pages() 

function. The clue will be in any includes that are in the page you are looking at.

---------- Post added at 23:23 ---------- Previous post was at 23:19 ----------

Code:

<li class="pagenav"> <ul><li class="page_item"><a href="http://pinkforgirls.co.u
Try wrapping that in a DIV instead, you're defining a li then defining it's type, then the list again. Try:
Code:

<div class="pagenav"> <ul><li class="page_item"><a href="http://pinkforgirls.co.u
Why are you using so many classes? Do these repaet themselves over the document?

handyman 09-08-2006 00:27

Re: An php gurus about (markup validation)
 
Found the function , its a wordpress blog so it's pretty much as it came with a template over it.

edit almost found it, doh trying again

right this is the fella

PHP Code:

function wp_list_pages($args '') {
 
parse_str($args$r);
 if ( !isset(
$r['depth']) )
  
$r['depth'] = 0;
 if ( !isset(
$r['show_date']) )
  
$r['show_date'] = '';
 if ( !isset(
$r['child_of']) )
  
$r['child_of'] = 0;
 if ( !isset(
$r['title_li']) )
  
$r['title_li'] = __('Pages');
 if ( !isset(
$r['echo']) )
  
$r['echo'] = 1;
 
$output '';
 
// Query pages.
 
$pages = & get_pages($args);
 if ( 
$pages ) {
  if ( 
$r['title_li'] )
   
$output .= '<li class="pagenav">' $r['title_li'] . '<ul>';
  
// Now loop over all pages that were selected
  
$page_tree = Array();
  foreach ( 
$pages as $page ) {
   
// set the title for the current page
   
$page_tree[$page->ID]['title'] = $page->post_title;
   
$page_tree[$page->ID]['name'] = $page->post_name;
   
// set the selected date for the current page
   // depending on the query arguments this is either
   // the createtion date or the modification date
   // as a unix timestamp. It will also always be in the
   // ts field.
   
if ( !empty($r['show_date']) ) {
    if ( 
'modified' == $r['show_date'] )
     
$page_tree[$page->ID]['ts'] = $page->post_modified;
    else
     
$page_tree[$page->ID]['ts'] = $page->post_date;
   }
   
// The tricky bit!!
   // Using the parent ID of the current page as the
   // array index we set the curent page as a child of that page.
   // We can now start looping over the $page_tree array
   // with any ID which will output the page links from that ID downwards.
   
if ( $page->post_parent != $page->ID)
    
$page_tree[$page->post_parent]['children'][] = $page->ID;
  }
  
// Output of the pages starting with child_of as the root ID.
  // child_of defaults to 0 if not supplied in the query.
  
$output .= _page_level_out($r['child_of'],$page_tree$r0false);
  if ( 
$r['title_li'] )
   
$output .= '</ul></li>';
 }
 
$output apply_filters('wp_list_pages'$output);
 if ( 
$r['echo'] )
  echo 
$output;
 else
  return 
$output;



Strzelecki 09-08-2006 00:35

Re: An php gurus about (markup validation)
 
Try altering it to
PHP Code:

 function wp_list_pages($args '') {
  
parse_str($args$r);
  if ( !isset(
$r['depth']) )
   
$r['depth'] = 0;
  if ( !isset(
$r['show_date']) )
   
$r['show_date'] = '';
  if ( !isset(
$r['child_of']) )
   
$r['child_of'] = 0;
  if ( !isset(
$r['title_li']) )
   
$r['title_li'] = __('Pages');
  if ( !isset(
$r['echo']) )
   
$r['echo'] = 1;
  
$output '';
  
// Query pages.
  
$pages = & get_pages($args);
  if ( 
$pages ) {
   if ( 
$r['title_li'] )
    
$output .= '<ul><li class="pagenav">' $r['title_li'];
   
// Now loop over all pages that were selected
   
$page_tree = Array();
   foreach ( 
$pages as $page ) {
    
// set the title for the current page
    
$page_tree[$page->ID]['title'] = $page->post_title;
    
$page_tree[$page->ID]['name'] = $page->post_name;
    
// set the selected date for the current page
    // depending on the query arguments this is either
    // the createtion date or the modification date
    // as a unix timestamp. It will also always be in the
    // ts field.
    
if ( !empty($r['show_date']) ) {
     if ( 
'modified' == $r['show_date'] )
      
$page_tree[$page->ID]['ts'] = $page->post_modified;
     else
      
$page_tree[$page->ID]['ts'] = $page->post_date;
    }
    
// The tricky bit!!
    // Using the parent ID of the current page as the
    // array index we set the curent page as a child of that page.
    // We can now start looping over the $page_tree array
    // with any ID which will output the page links from that ID downwards.
    
if ( $page->post_parent != $page->ID)
     
$page_tree[$page->post_parent]['children'][] = $page->ID;
   }
   
// Output of the pages starting with child_of as the root ID.
   // child_of defaults to 0 if not supplied in the query.
   
$output .= _page_level_out($r['child_of'],$page_tree$r0false);
   if ( 
$r['title_li'] )
    
$output .= '</li></ul>';
  }
  
$output apply_filters('wp_list_pages'$output);
  if ( 
$r['echo'] )
   echo 
$output;
  else
   return 
$output;
 } 


handyman 09-08-2006 00:37

Re: An php gurus about (markup validation)
 
I looked at many options for the site from writing it from scratch to using a cms system. trialled wordpress and found it was great because it auto updates blog list and drives traffic to the site. Plus it's easy to add new posts to it.

As and when My php skills mature I will look at creating similar sites frm scratch and measuring the raffic against the blog site.

Graham M 09-08-2006 00:41

Re: An php gurus about (markup validation)
 
meh i never validate my sites and they work fine :p:

Strzelecki 09-08-2006 01:03

Re: An php gurus about (markup validation)
 
It's good that you're trying to validate your site, especially to strict, that can be challenging. In theory doing so should mean that your site is viewed the same way in most modern browsers. Unfortunately though there are browsers such a Internet Explorer that just don't comply and get thrown into 'quirks' mode when they see anything they don't understand. This means now and then you ay have to use 'hacks', especially in CSS to mak sure the site is viewable how you want it across browsers. Standards are good, but not when browser makers choose not to implement them fully.

handyman 09-08-2006 01:05

Re: An php gurus about (markup validation)
 
Quote:

Originally Posted by Strzelecki
Try altering it to
PHP Code:

 snip 


Nope still showing same error. Worst comes to worst I'll simply remove the call for that function and pop in the code myself without the extra ul tags, that will mean if I add any more static pages I'll simply have to add them manually to the sidebar.

Can I also just add thanks for the help so far. I really must get my **** on a new media course or something.


All times are GMT +1. The time now is 13:46.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
All Posts and Content are © Cable Forum