LJackson
05-29-2009, 05:17 PM
Hi All,
Ok Usually i am able to sort out these validation errors but this time is from something i dont really know nothing about so im not sure what is correct and whats not :)
here is the code
<?php
if(isset($_GET['title'])){
$searchterm = htmlentities($_GET['title']);
$inputtext = htmlentities($_GET['title']);
}
elseif(isset($_GET['searchbox'])){
$inputtext = htmlentities($_GET['searchbox']);
}
else {
$inputtext = "Search Here...";
}
?>
<div id='header'>
<div id='logo'>
<h1>
<a href="http://www.kernow-connect.com" target="_self">
<img src="images/thelogo.png"
title="Kernow Connect -
Online Shopping & Price Comparision - For the smarter shopper"
alt="Kernow Connect -
Online Shopping & Price Comparision - For the smarter shopper"
border='0' /></a></h1>
</div>
<div class="slogantext">
<h1>Online Shopping And Price Comparison</h1>
</div>
<div class="searchcontainer">
<div class="searchicon">
<img src="images/searchimg.png" alt="search icon" title="search icon" /></div>
<div class="searchbar">
<form action="price_results.php" method="get">
<input name="searchbox"
type="text"
id="searchbox"
value="<?php print $inputtext;?>"
size="35"/>
<label>
<select name="category" id="category">
<option value="Everything">All Items</option>
<?php
$optgroups=array('Entertainment'=>array('DVD','CD','Video Games', 'Blu-Ray', 'Books'),
'Computing'=>array('Desktop','Notebook','Netbook','Prnter','Scanner','Software','Accessories'),
'Electronics'=>array('LCD TVs','Plasma TVs','Full HD TVs','MP3 and D.A.P','Digital Cameras',' Home Cinema Systems','DVD Players'),
'Clothing'=>array('T-Shirts & Shirts','Sweatshirts & Fleeces','Shorts & Trousers','Hats & Caps','Gloves','Underware'),
'Miscellaneous'=>array('Fragrences','DIY & Tools','Garden & Outdoors','Health & Beauty','
Household Appliances','Toys & Games'));
foreach($optgroups as $key=>$options){
echo "<optgroup label=\"$key\">";
foreach($options as $option){
if(isset($_GET['category']) && $_GET['category']==$option)
echo "<option value=\"{$option}\" selected=\"selected\">{$option}</option>";
else
echo "<option value=\"{$option}\">{$option}</option>";
}
echo "<optgroup>";
}
?>
</select>
</label>
</div>
<div class="searchSubmit">
<input type="image" src="/images/gobutton.png" alt="Submit" />
</div>
</form>
</div>
</div>
<?php }?>
the form optgroup is causing the problems i also think the </label> is in the wrong place as its not yellow like a form element should be?
here is the validation errors
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.kernow-connect.com%2FPrice%2520Comparison%2Fentertainment.php&charset=(detect+automatically)&doctype=Inline&group=0
any ideas how i can get rid of these?
thank you
Luke
Ok Usually i am able to sort out these validation errors but this time is from something i dont really know nothing about so im not sure what is correct and whats not :)
here is the code
<?php
if(isset($_GET['title'])){
$searchterm = htmlentities($_GET['title']);
$inputtext = htmlentities($_GET['title']);
}
elseif(isset($_GET['searchbox'])){
$inputtext = htmlentities($_GET['searchbox']);
}
else {
$inputtext = "Search Here...";
}
?>
<div id='header'>
<div id='logo'>
<h1>
<a href="http://www.kernow-connect.com" target="_self">
<img src="images/thelogo.png"
title="Kernow Connect -
Online Shopping & Price Comparision - For the smarter shopper"
alt="Kernow Connect -
Online Shopping & Price Comparision - For the smarter shopper"
border='0' /></a></h1>
</div>
<div class="slogantext">
<h1>Online Shopping And Price Comparison</h1>
</div>
<div class="searchcontainer">
<div class="searchicon">
<img src="images/searchimg.png" alt="search icon" title="search icon" /></div>
<div class="searchbar">
<form action="price_results.php" method="get">
<input name="searchbox"
type="text"
id="searchbox"
value="<?php print $inputtext;?>"
size="35"/>
<label>
<select name="category" id="category">
<option value="Everything">All Items</option>
<?php
$optgroups=array('Entertainment'=>array('DVD','CD','Video Games', 'Blu-Ray', 'Books'),
'Computing'=>array('Desktop','Notebook','Netbook','Prnter','Scanner','Software','Accessories'),
'Electronics'=>array('LCD TVs','Plasma TVs','Full HD TVs','MP3 and D.A.P','Digital Cameras',' Home Cinema Systems','DVD Players'),
'Clothing'=>array('T-Shirts & Shirts','Sweatshirts & Fleeces','Shorts & Trousers','Hats & Caps','Gloves','Underware'),
'Miscellaneous'=>array('Fragrences','DIY & Tools','Garden & Outdoors','Health & Beauty','
Household Appliances','Toys & Games'));
foreach($optgroups as $key=>$options){
echo "<optgroup label=\"$key\">";
foreach($options as $option){
if(isset($_GET['category']) && $_GET['category']==$option)
echo "<option value=\"{$option}\" selected=\"selected\">{$option}</option>";
else
echo "<option value=\"{$option}\">{$option}</option>";
}
echo "<optgroup>";
}
?>
</select>
</label>
</div>
<div class="searchSubmit">
<input type="image" src="/images/gobutton.png" alt="Submit" />
</div>
</form>
</div>
</div>
<?php }?>
the form optgroup is causing the problems i also think the </label> is in the wrong place as its not yellow like a form element should be?
here is the validation errors
http://validator.w3.org/check?uri=http%3A%2F%2Fwww.kernow-connect.com%2FPrice%2520Comparison%2Fentertainment.php&charset=(detect+automatically)&doctype=Inline&group=0
any ideas how i can get rid of these?
thank you
Luke