Jump to content

php include problem?


damian0612

Recommended Posts

Can someone please explain how I can fix a problem I have.  I have a page where I have a php include which is for a search menu at the top of a page under a header.  The code works perfectly when viewed on firefox but it displays totally wrong on IE and I'm stumped as to why.  I'm not sure if it is a problem with my php include, html or css.  Here is the page:

 

www.mo-ait.com/testpage.php

 

Here is the html:

 

<div id="container">
<div id="header">
<a href="/" id="logo"><img src="/images/header2.jpg" height="100px" width="900px" border="0"/></a>
</div>
<div id="search_container">
<?php
require_once ("mysearch.php");
?>
</div>

 

here is the php include file:

 

<div id="search_left">

<?php

$quer2=mysql_query("SELECT DISTINCT category,cat_id  

                    FROM cardlist

                    ORDER by category"); 



$cat=$_GET['cat'];  

//This line is added to take care if your global variable is off 

if(strlen($cat) > 0 and !is_numeric($cat)){ 

//check if $cat is numeric data or not. 

echo "Data Error"; 

exit; 

} 

if(isset($cat) and strlen($cat) > 0){ 

$quer=mysql_query("SELECT DISTINCT subcategory  

                FROM cardlist where cat_id=$cat  

                ORDER by subcategory"); 

}else{$quer=mysql_query("SELECT DISTINCT subcategory  

                         FROM cardlist  

                         ORDER by subcategory"); } 

echo "<table><tr><td>";

echo "What's it for? </td><td>";

echo "<form method=post name=f1 action=''>"; 

/// Add your form processing page address to  

//action in above line. Example action=dd-check.php//// 

////////// Starting of first drop downlist ///////// 

echo "<select name='cat' onchange=\"reload(this.form) 

\"><option value=''>Select one</option>"; 

while($noticia2 = mysql_fetch_array($quer2)) { 

if($noticia2['cat_id']==@$cat) 

{echo  

"<option selected value='$noticia2[cat_id]'>$noticia2[category]</option>"."<BR>";} 

else{ 

echo "<option value='$noticia2[cat_id]'>$noticia2[category]</option>";} 

} 

echo "</select>"; 

echo "</td><td>";

////////////////// This will end the first drop down list /////////// 

echo "</td><td>";

echo "Who's it for? </td><td>";

////////// Starting of second drop downlist ///////// 

echo "<select name='subcat'><option value=''>Select one</option>"; 

while($noticia = mysql_fetch_array($quer)) { 

echo "<option value='$noticia[subcategory]'>$noticia[subcategory]</option>"; 

} 

echo "</select>"; 

////////////////// This will end the second drop down list /////////// 

// add your other form fields here ////  

echo "<input type=submit value=Submit>"; 

echo "</form>";  

echo "</td></tr></table>";



			echo "</div>";

			echo "<div id='search_right'>";

			echo "<form name='myform2' action='/search.php' method='GET'>";

echo "<input name='search_all' input type='text' value='search'/>";

echo "<input type='submit' value='Submit'/>";

echo "</form>";

			echo "</div>";

?>

 

and here is the css:

 

div#search_container{background-image:url(/images/header.jpg);
margin-top:-5px;line-height:40px;padding: 0;valign:top;}
div#search_left{float:left;margin:10;color:#FFFFFF;font-weight:bold;valign:top;}
div#search_right{float:right;margin-right:10px;color:#FFFFFF;font-weight:bold;valign:top;}

 

Would appreciate any help at all on this, thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.