Forum Moderators: coopster

Message Too Old, No Replies

Please help with php and iframe variable

         

pstar99

9:59 pm on Aug 11, 2009 (gmt 0)

10+ Year Member



Hi, sorry if this is getting a little longer.
I'm trying to make a quick search that is within a div and displayed on every page of my site.
What I'm hoping to accomplish are two things:
  1. the input field of the quick search completes a link (ie, if someone types 1234 into the field and hits search it would complete a link into [mydoamin.com...] and go there)[/li]
  2. regardless of the page in my site where the quick search was used it'll send the the visitor to the result.php page which has an iframe that shows results from an external site. What is shown within the iframe depends on the number that was originally entered into the quick search. So in this example [differentsitedomain.com...] would be shown in the iframe.[/li]

I came up with the code below for the quick search div and the two php pages that are supposed to make this happen.
The good news is I can display the results from the external site in the iframe based on the number I entered into the quick search div.
The bad news is that result.php only shows the css and the iframe, but doesn't show anyhting else (includes, etc) although the code for it is there

What did I do wrong? Am I missing something or is there a better way to get this to work?
Thank you all in advance!

Quick Search DIV on EVERY page within site

<form name="form" method="get" action="jump.php">
<input name="xyz" type="text" />
<input type="submit" name="submit" value="Search" />
</form>

JUMP.PHP code

<?php

if (isset($_GET['xyz']))
{
$search = $_GET['xyz'];

echo "<meta http-equiv=\"Refresh\" content=\"0; url=http://www.mydomain.com/result.php?xyz=" . $search . "\">";
}
else
{
echo "enter a search term";
}

?>

RESULT.PHP code

<!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" xml:lang="en" lang="en">

<!-- #BeginTemplate "temp.dwt" -->

<head>
<!-- #BeginEditable "title" -->
<title>MySite</title>
<!-- #EndEditable -->
<link rel="stylesheet" type="text/css" href="style.css" />
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link rel="icon" type="image/x-icon" href="favicon.ico" />
</head>
<body>
<div id="wrapper">
<!--#include file="1.html" -->
<div id="tab">
<!--#include file="2.html" -->
<div id="center"><h1 class="all">Hello</h1>
<!-- #BeginEditable "body" -->
<div id="ch2">
<iframe class="one" marginwidth="1" marginheight="1" frameborder="0" src="http://www.differentsitedomain.com/index.cfm?fuseaction=showdetails&ln=<?php echo $_GET['xyz']; ?>&query=fuseaction=results&newsearch=yes" title="resultframe">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe>
</div>
<!-- #EndEditable -->
</div>
<!--#include file="4.html" -->
</div>
<!--#include file="5.html" -->
</div>
</body>
<!-- #EndTemplate -->
</html>

coopster

3:00 pm on Aug 15, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Is there a reason you are using a meta refresh in jump.php?