Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML/IFRAME/PHP/MYSQL Question:

Status
Not open for further replies.

robman

Programmer
Aug 12, 1999
7
0
0
US
HTML/IFRAME/PHP/MYSQL Question:<br>
<br>
I want to load an IFRAME element with an SQL query but how do I write the SRC attribute? What I've done is point the SRC to foo.php3 file which in turn runs the SQL statement and echoes back the result. I'm fairly new to PHP and MySQL so I suspect there is a more elegant way to do this.<br>
<br>
Someone please enlighten me,<br>
<br>
Robert Bell
 
Not sure exactly what you want to do, but my guess is you want to have a form in the parent window where users can enter their search requests, and then you want the results to load in the IRAME window. I haven't done this before, but it should be quite simple: you need to create a PHP page that accepts parameters as it loads, and then executes a query based on those parameters. The easiest way to pass along parameters is in the URL itself. <br>
Your main page could be &quot;search.php3&quot; with a form that simply submits a redirect to hyperlink to &quot;results.php3&quot; pointing to the IFRAME. In the URL of the link that the Submit button points to, you will use something like &quot;results.php3?term1=1st_variable&?term2=2nd_varable&quot; For an example of a site that uses this approach, go to <A HREF=" TARGET="_new"> when your mouse hovers over the Quick Ref button, it brings up a layer that lets you enter a search for terms; when you submit your search, it goes to a URL like &quot;<A HREF=" TARGET="_new"><br>
As you can see, it is passing along two variables to the search.php3 page so that the page can do a query on them.<br>
<br>
I hope this helps; I'm sure there are more ways to do this. Anyone?
 
Got it worked out and then the design changed so I didn't need the iframe solution. Definitely put it in the bag of tricks though.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top