rfloresbE
10-07-2008, 04:07 PM
my search box is not working properly, and I cannot see where my brackets are not closing, but am consistently getting the "unexpected $" error message when performing the search within my site.
All else 'should' be working fine, but can someone take a look at see what they can come up with? I would appreciate the help.
here is the site, middle right is search box: firstprizefranchise.com
here is the code in question, from the source file search.php :
<?php
$search_count = 0;
$search = new WP_Query("s=$s & showposts=-1");
if($search->have_posts()) : while($search->have_posts()) : $search->the_post();
$search_count++;
endwhile; endif;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
<meta name="ROBOTS" content="ALL" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="stylesheet" type="text/css" href="/wp-content/themes/fpf/style.css" />
<link rel="shortcut icon" href="http://www.brandexpansion.com/wp-content/themes/be/images/icon.gif" />
<title>Franchise Opportunity, Businesses for Sale, Business Franchises - First Prize Franchise</title>
<meta name="keywords" content="franchise,franchise opportunity,business,business franchise,business opportunity,franchise for sale,business for sale,franchise blog,blog" />
<?php wp_get_archives('format=link&type=monthly'); ?>
<script language="javascript" type="text/javascript" src="/wp-content/themes/fpf/js/showhide.js"></script>
</head>
<?php include($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'].'/wp-content/themes/fpf/top.php'); ?>
<div id="wrap" class="hybrid">
<div id="inner">
<?php include($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'].'/wp-content/themes/fpf/intro.php'); ?>
<div id="content">
<div id="left" class="content">
<?php if (have_posts()) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h2><?php echo single_cat_title(); ?> News</h2>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h2>Archive for <?php the_time('F jS, Y'); ?></h2>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h2>Archive for <?php the_time('F, Y'); ?></h2>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h2>Archive for <?php the_time('Y'); ?></h2>
<?php /* If this is a search */ } elseif (is_search()) { ?>
<h2>Found <?php echo $search_count; ?> search results for '<?php echo $s; ?>'</h2>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h2>Author Archive</h2>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2>Blog Archives</h2>
<?php } ?>
<?php while (have_posts()) : the_post(); ?>
<div class="archive">
<h4><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h4>
<?php wp_the_excerpt_reloaded('filter_type=content&excerpt_length=60&use_more_link=0'); ?>
<ul id="searchdetails">
<li>Written at <?php the_time() ?> on <?php the_time('F jS, Y') ?></li>
<li>Filed in <?php the_category(', '); ?></li>
<li><a href= "<?php the_permalink(); ?>" title="Link to <?php the_title(); ?>">View the full article</a></li>
</ul>
</div>
<?php endwhile; ?>
<div class="navigation">
<p class="alignleft"><?php next_posts_link('Next Page') ?></p>
<p class="alignright"><?php previous_posts_link('Previous Page') ?></p>
</div>
<?php else { ?>
<h2>Sorry, we couldn't find anything for '<?php echo $s; ?>'</h2>
<p>Please try searching again...</p>
<?php } ?>
<div class="dottedline"></div>
</div><!-- end left -->
<div id="right" class="page">
<h2>Franchise Quick Search</h2>
<form method="get" id="searchform" action="<?php echo $PHP_SELF; ?>">
<input type="text" value="" name="s" id="s" />
<input type="submit" class="submit" value="Search" />
</form>
<?php include($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'].'/wp-content/themes/fpf/nav.php'); ?>
<?php include($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'].'/wp-content/themes/fpf/banner.php'); ?>
<?php include($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'].'/wp-content/themes/fpf/banner2.php'); ?>
<h2>Franchise Industries</h2>
<ul style="margin:0;"><li><a href= "javascript:toggleLayer('categories');">View the Franchise Industries</a></li></ul>
<ul id="categories" style="display:none;">
<?php wswwpx_fold_category_list('sort_column=name&optioncount=0&hide_empty=0&exclude=1,34,36,35,122,127'); ?>
</ul>
</div><!-- end right -->
<div class="wrapper"></div>
</div><!-- end content -->
<div class="wrapper"></div>
<?php include($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'].'/wp-content/themes/fpf/footer.php'); ?>
<p><?php edit_post_link('Edit','',''); ?></p>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1315439-1";
urchinTracker();
</script>
thanks for your assistance.
All else 'should' be working fine, but can someone take a look at see what they can come up with? I would appreciate the help.
here is the site, middle right is search box: firstprizefranchise.com
here is the code in question, from the source file search.php :
<?php
$search_count = 0;
$search = new WP_Query("s=$s & showposts=-1");
if($search->have_posts()) : while($search->have_posts()) : $search->the_post();
$search_count++;
endwhile; endif;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
<meta name="ROBOTS" content="ALL" />
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="stylesheet" type="text/css" href="/wp-content/themes/fpf/style.css" />
<link rel="shortcut icon" href="http://www.brandexpansion.com/wp-content/themes/be/images/icon.gif" />
<title>Franchise Opportunity, Businesses for Sale, Business Franchises - First Prize Franchise</title>
<meta name="keywords" content="franchise,franchise opportunity,business,business franchise,business opportunity,franchise for sale,business for sale,franchise blog,blog" />
<?php wp_get_archives('format=link&type=monthly'); ?>
<script language="javascript" type="text/javascript" src="/wp-content/themes/fpf/js/showhide.js"></script>
</head>
<?php include($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'].'/wp-content/themes/fpf/top.php'); ?>
<div id="wrap" class="hybrid">
<div id="inner">
<?php include($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'].'/wp-content/themes/fpf/intro.php'); ?>
<div id="content">
<div id="left" class="content">
<?php if (have_posts()) : ?>
<?php $post = $posts[0]; // Hack. Set $post so that the_date() works. ?>
<?php /* If this is a category archive */ if (is_category()) { ?>
<h2><?php echo single_cat_title(); ?> News</h2>
<?php /* If this is a daily archive */ } elseif (is_day()) { ?>
<h2>Archive for <?php the_time('F jS, Y'); ?></h2>
<?php /* If this is a monthly archive */ } elseif (is_month()) { ?>
<h2>Archive for <?php the_time('F, Y'); ?></h2>
<?php /* If this is a yearly archive */ } elseif (is_year()) { ?>
<h2>Archive for <?php the_time('Y'); ?></h2>
<?php /* If this is a search */ } elseif (is_search()) { ?>
<h2>Found <?php echo $search_count; ?> search results for '<?php echo $s; ?>'</h2>
<?php /* If this is an author archive */ } elseif (is_author()) { ?>
<h2>Author Archive</h2>
<?php /* If this is a paged archive */ } elseif (isset($_GET['paged']) && !empty($_GET['paged'])) { ?>
<h2>Blog Archives</h2>
<?php } ?>
<?php while (have_posts()) : the_post(); ?>
<div class="archive">
<h4><a href="<?php the_permalink() ?>" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></a></h4>
<?php wp_the_excerpt_reloaded('filter_type=content&excerpt_length=60&use_more_link=0'); ?>
<ul id="searchdetails">
<li>Written at <?php the_time() ?> on <?php the_time('F jS, Y') ?></li>
<li>Filed in <?php the_category(', '); ?></li>
<li><a href= "<?php the_permalink(); ?>" title="Link to <?php the_title(); ?>">View the full article</a></li>
</ul>
</div>
<?php endwhile; ?>
<div class="navigation">
<p class="alignleft"><?php next_posts_link('Next Page') ?></p>
<p class="alignright"><?php previous_posts_link('Previous Page') ?></p>
</div>
<?php else { ?>
<h2>Sorry, we couldn't find anything for '<?php echo $s; ?>'</h2>
<p>Please try searching again...</p>
<?php } ?>
<div class="dottedline"></div>
</div><!-- end left -->
<div id="right" class="page">
<h2>Franchise Quick Search</h2>
<form method="get" id="searchform" action="<?php echo $PHP_SELF; ?>">
<input type="text" value="" name="s" id="s" />
<input type="submit" class="submit" value="Search" />
</form>
<?php include($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'].'/wp-content/themes/fpf/nav.php'); ?>
<?php include($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'].'/wp-content/themes/fpf/banner.php'); ?>
<?php include($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'].'/wp-content/themes/fpf/banner2.php'); ?>
<h2>Franchise Industries</h2>
<ul style="margin:0;"><li><a href= "javascript:toggleLayer('categories');">View the Franchise Industries</a></li></ul>
<ul id="categories" style="display:none;">
<?php wswwpx_fold_category_list('sort_column=name&optioncount=0&hide_empty=0&exclude=1,34,36,35,122,127'); ?>
</ul>
</div><!-- end right -->
<div class="wrapper"></div>
</div><!-- end content -->
<div class="wrapper"></div>
<?php include($_SERVER['SUBDOMAIN_DOCUMENT_ROOT'].'/wp-content/themes/fpf/footer.php'); ?>
<p><?php edit_post_link('Edit','',''); ?></p>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
</script>
<script type="text/javascript">
_uacct = "UA-1315439-1";
urchinTracker();
</script>
thanks for your assistance.