You are here:  » inserting external search into page

Support Forum



inserting external search into page

Submitted by wilkins on Sat, 2010-01-30 13:59 in

Hi David

I am trying to insert the external search into a page given by affiliatefuture for vouchers, the script works OK if i manually but in the Merchant but when I put in <?PHP echo cleandata($merchtarget);?> to get the merchants name nothing happens. I have checked to make sure it pull the correct merchant, is there any way to over come this?

<?PHP
header('Content-Type: text/html; charset=utf-8');
include ('inc/functions.php');
connectdata ();
// Page title override.
 $config['page_title']=cleandata($merchtarget).' '.$config['page_title'];?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?PHP echo $config['page_title'];?></title>
<meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<meta name="robots" content="INDEX,FOLLOW" >
<meta name="revisit-after" content="1 days" >
<link rel="stylesheet" href="<?PHP echo $config['thissite'];?>/inc/global.css" type="text/css" />
<link rel="shortcut icon" href="<?PHP echo $config['thissite'];?>/favicon.ico">
<script tupe="text/javascript" SRC="<?PHP echo $config['thissite'];?>/inc/clip.php"></script>
</head>
<body>
<CENTER>
<DIV class="wrapper">
<?PHP IF($_GET['rewr']) include_once('inc/header.php'); ELSE include_once('inc/header.php'); ?>
<!-- content starts -->
<div class="content">
<div class="main">
<h2><?PHP echo cleandata($merchtarget);?> Voucher Codes</h2>
<?PHP draw_description_merchant($merchtarget);?>
<?PHP draw_vouchers_merchant($merchtarget);?>
</div>
  <?php
  $common_baseHREF = "http://www.domain.com/";
  $common_path = "/home/xxxxxxx/public_html/";
  $_GET["q"] = "merchant:<?PHP echo cleandata($merchtarget);?>";
  require($common_path."searchExternal.php");
?>
<div class="sidebar">
<DIV CLASS="voucher alphalist">
<?php
alphalist();
?></DIV>
<form id="qsearch" action="search.php" method="get" >
<p>
<label for="qsearch">Search:</label>
<input class="tbox" type="text" name="qsearch" value="" title="Start typing and hit ENTER" />
<input class="btn" alt="Search" type="image" name="searchsubmit" title="Search" src="<?PHP echo $config['thissite']; ?>/images/search.gif" />
</p>
</form>
<!-- sidebar ends -->
</div>
<!-- content ends-->
</div>
<P>Copyright 2008. <?PHP IF ($config['showthumbs']) echo '<a href="http://www.thumbshots.net" target="_blank" rel="nofollow" title="Thumbnails by Thumbshots.net">Thumbnails by Thumbshots.net</a>';?></P>
</DIV>
<BR/>
</CENTER>
</body>
</html>

Submitted by support on Sat, 2010-01-30 17:37

Hi,

As the page is already in PHP mode at the point where you have added the code to bring in $merctarget there is no need for the PHP tags; and infact they will be breaking the syntax at that point. To fix this, in place of:

  $_GET["q"] = "merchant:<?PHP echo cleandata($merchtarget);?>";

...have a go with:

  $_GET["q"] = "merchant:".$merchtarget;

Hope this helps!

Cheers,
David.