PHP Search return results within page no refresh

Posted on 2008-11-16
Last Modified: 2013-12-13
I have a search in PHP for a MYSQL database that returns the results to an iframe. The problem is tha I need it to return the results not in an iframe and without refreshing the page. At the moment I am using the following form

<form id="searcher" name="searcher" method="post" action="dosearch.php" target="searchdisplay">
                                  <td width="248">Search Innovente Products</td>
                                  <td width="27">&nbsp;</td>
                                  <td width="120">&nbsp;</td>
                                  <td align="right"><input name="search" type="text" id="search" size="35" />
                                      <input type="submit" name="button" id="search" value="Search" />

With the code in the snippet below to do the search

Can the search be done and eturn the results without using an iframe and without refreshing the page?

Thanks for any help in advance

include 'admin/connect.php';


$res=mysql_query('SELECT id,tdstitle,subheading,supplier,dat,category,imageid FROM technicaldata WHERE MATCH(tdstitle,keywords,subheading) AGAINST("'.$search.'" IN BOOLEAN MODE)',$dbh) or die(mysql_error());


for($run=0; $run<$num; $run++)



echo '<table width="800" border="0" cellspacing="0" cellpadding="0" bgcolor="'.$col.'">


  <td height="40" align="right" valign="middle"><table width="800" height="22" border="0" cellspacing="0" cellpadding="0">


      <td width="263" align="left" class="mainTXT12LEFT"><a href="image.php?a='.$val[6].'"><span class="Formtitles13">'.$val[1].'</span></td>

      <td width="327" align="left" class="mainTXT12LEFT">'.$val[2].'</td>

      <td width="110" height="22" align="left"><span class="mainTXT12LEFT">'.$val[4].'</span></td>

      <td width="41" align="left"><a href="imagedownload.php?a='.$val[6].'"><img src="images/download.gif" alt="Download TDS" width="30" height="22" border="0"></a></td>

      <td width="39" align="center" class="maineleven_BK"><a href="image.php?a='.$val[6].'&TB_iframe=true&height=760&width=730" rel="sexylightbox" onClick="self.parent"><img src="images/tds.gif" alt="View TDS" width="30" height="22" border="0"></a></td>





      <td height="1" align="center" valign="top"><img src="images/greenspacer.gif" width="800" height="1"></td>





Open in new window

Question by:flashjordan
    LVL 6

    Accepted Solution

    you can use Ajax to call your php with out refreshing the page, and use <div> instead of iframe.

    here is a good Ajax tutorial:
    LVL 1

    Author Closing Comment

    Thanks, I will look into the link you sent

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    This is a general how to create your own custom plugin system for your PHP application that you designed (or wish to extend a third party program to have plugin functionality that doesn't have it yet).  This is not how to make plugins for existing s…
    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now