Does anyone know what goes wrong in the process with this php code?
This code seems to be causing it:
<?PHP
}
else
{
echo " <div class='back-title'><a href='/directory.php' ><h3>Back to Map</h3></a></div>";
}
?>
</div>
What happens is that the footer css jumps in front of the search results. Other than that the pages renders fine. Only when you make a search and results appear, the css gets screwed up.
Code: [Select]<div id="dir-search-bar"> <form id="form1" name="form1" method="post" action="directory.php">
<div id="dir-search-box"><div class="search-title">Search Company or Browse by Map</div>
<div id="search-box-container">
<div class="search-left"><img src="images/search-left.png" /></div>
<div class="search-center">
<select name="searchwhat" >
<option value="company_name">Company Name</option>
<option value="phone_number">Phone Number</option>
<option value="mobile_number">Mobile Number</option>
<option value="email">Email</option>
<option value="person_firstname">First Name</option>
<option value="person_lastname">Last Name</option>
</select>
<input name="searchterm" type="text" class="search-input" size="30" />
<input type="submit" name="button" id="button" value="Search" />
<input name="action" type="hidden" id="action" value="search" />
<?PHP
if ($action != "search")
{
?>
</div>
<!--<end of #search-center >-->
<div class="search-right"><img src="images/search-right.png" /></div>
</div><!--<end of #search-box-container >-->
</div> <!--<end of #dir-search-box >-->
<div class="map-title">Click on Continent to Browse by Map</div>
<div align="center"><img src="images/worldmap.gif" alt="Map of the World" width=450 height=254 border="0" usemap="#worldmap" />
<map name="worldmap" id="worldmap">
<area shape="poly" coords="45,78,75,92,116,92,115,115,90,123,54,113" href="usmap.php" alt="North America" />
<area shape="poly" coords="106,146" href="#" />
<area shape="poly" coords="106,141,105,144,156,179,118,248,108,225,96,163" href="map.php?continent=southamerica&action=list" alt="South America" />
<area shape="poly" coords="129,173" href="#" />
<area shape="poly" coords="246,44,294,39,288,84,272,104,253,107,234,106,199,106,204,73" href="map.php?continent=europe&action=list" alt="Europe" />
<area shape="poly" coords="299,37,438,47,405,118,402,175,360,177,318,152,317,115,284,96" href="map.php?continent=asia&action=list" alt="Asia" />
<area shape="poly" coords="261,108,284,101,302,109,312,121,274,146" href="map.php?continent=middleeast&action=list" alt="Middle East" />
<area shape="poly" coords="195,117,225,110,253,118,273,149,276,160,276,206,242,220,194,149" href="map.php?continent=africa&action=list" alt="Africa" />
<area shape="poly" coords="380,188,416,170,444,197,441,243,375,236,361,202" href="map.php?continent=australia&action=list" alt="Australia and Pacific Ocean" />
<area shape="poly" coords="42,30,149,47,127,89,81,90,45,78" href="map.php?country=CA&action=list" alt="Canada" />
<area shape="poly" coords="56,119,96,149,103,133,78,121" href="map.php?country=MX&action=list" alt="Mexico" />
</map>
<?PHP
}
else
{
echo " <div class='back-title'><a href='/directory.php' ><h3>Back to Map</h3></a></div>";
}
?>
</div>
</form>
<div id="search-results"> <?php
if ($action == "search")
{
$searchterm = trim($searchterm);
$searchwhat = trim($searchwhat);
echo "<BR><BR>";
if (empty($mem->mem_type_id))
{
echo "<a href=payment.php >To view company detail, please upgrade your membership by clicking here</a>
<BR>";
}
echo "<b> You searched for '".$searchterm."':";
echo "<BR><BR>";
if ($searchwhat == "company_name")
{
$searchwhat = "co_name";
}
if ($searchwhat == "phone_number")
{
$searchwhat = "phone_office";
}
if ($searchwhat =="mobile_number")
{
$searchwhat = "phone_mobile";
}
if ($searchwhat == "email")
{
$searchwhat = "email_address";
}
if ($searchwhat == "person_firstname")
{
$searchwhat = "first_name";
}
if ($searchwhat == "person_lastname")
{
$searchwhat = "last_name";
}
$sql2 = "SELECT DISTINCT co_name, id FROM user WHERE $searchwhat LIKE '%$searchterm%' AND approved != 'No' AND deleted != 'Yes' ORDER BY co_name ASC";
// echo "<BR><BR>sql2: ".$sql2 ."<BR><BR>";
@$companies = $db->get_results($sql2);
if (!empty($searchwhat) AND !empty($searchterm) AND !empty($companies))
{
foreach ( $companies as $company )
{
@$co_id = $db->get_row("SELECT id,date_update,co_name_url FROM user WHERE co_name = '$company->co_name' AND id = '$company->id' LIMIT 1");
if (!empty($mem->mem_type_id))
{
if ($admin == "yes")
{
echo "- <a href=http://".$co_id->co_name_url.".wassociation.com/ rel=nofollow>$company->co_name</a> Updated: $co_id->date_update
<a href="trade/admin_delete_user.php?deleteid=$co_id->id" >Delete</a>
<a href="trade/admin_edit_user.php?editid=$co_id->id" >Edit</a>
<BR>";
}
else
{
echo "- <a href=http://".$co_id->co_name_url.".wassociation.com/ rel=nofollow >$company->co_name</a>
<BR>";
}
}
else
{
echo "- $company->co_name
<BR>";
}
}
}
else
{
echo "No results.";
}
/*
$result_map = mysql_query($sql_map);
echo "<BR><BR>";
echo "<b> You searched for '".$mapState."':";
echo "<BR><BR>";
while ($row_map = mysql_fetch_array($result_map))
{
$mapCoTradeName = $row_map["CoTradeName"];
$mapUID = $row_map["uid"];
echo "- <a href=mem.companyinfo.php?mapCompany=$mapUID>$mapCoTradeName</a>
<BR>";
}
*/
}
?>
</div><!-- END of #Search-Results -->
</div><!--<end of #dir-search-bar >-->
[color=red]
<div id="footer"><?php include "inc.footer.php"; ?></div>[/color]
Parse error: parse error in C:wampwwwlogspagesmembers.php on line 16
I dont see the problem with this, I always get Parse error: parse error in C:\wamp\www\logs\pages\members.php on line 16, what did I do wrong?? <?php $sql = "SELECT *
Turning Data into URLs?
This may seem very basic to you, but I'm having a hard time figuring out how to do this since I don't even know what the proper term for it is:Background info:Animals Table - animalid, name, photo,
Mail from PHP form not always ending up in my inbox?
Hi guys,I'm a real newbie to PHP and have managed to put together a simple mail form that sends me an email when someone fills it in on my site.The problem I am having, is that sometimes when I test
Whats wrong with my query?
I am trying to get this query to show the appropriate ticked vehicle roof height, unless no boxs are ticked then I want it to display all vehicle roof heights. However it doesn't work correctly, for
Rss feed question
HiMy blog and my website are different. Am i able to take my rss feed from my blog and place it on the index page of my site using php and how to I do it (do I need soap)?
Effort Estimation Template for Steady State Support
Hi Everyone,
I need some help with the IF command...
I have a large number of images in one section of my website with the .jpg format. I'm adding a bunch of new images thanks to a new camera, but in using Picasa to bulk export smaller images sizes,
Quick Question about echo value
Hey guys, I'm trying to get something to show differently in one of my scripts. I'm trying to make it so that people that are a certain rank in my game will have their names show up bold in the users
Multiple forms on the same page (safari)
Hello everyone,I have 3 forms on the same page, that opens in a new window and submits to a php file, this works great in IE8 but I can not get it to work in safari, I can click on the first submit
EXplanation help
Hey all,I am still fairly new to PHP programming and I am trying to put together a page where you select search terms from a drop down menu and it keeps the menu at your search choice in the menu