Title: PHP search script and iFrame
Last modified: August 20, 2016

---

# PHP search script and iFrame

 *  Resolved [specto](https://wordpress.org/support/users/specto/)
 * (@specto)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-search-script-and-iframe/)
 * Hi.
    I´m trying to install a PHP search script for properties on [http://www.spectoestates.com](http://www.spectoestates.com)
 * So far, I´ve added the PHP code snippet into a PHP code widget, visible on all
   pages. When someone does a search, it launches [this page](http://spectoestates.com/buy-property-in-spain-with-specto-estates/properties-for-sale-on-the-costa-del-sol/)
   where the results should be shown.
 * Only problem is that I don´t know how to implement the PHP codes and iFrame I
   ´ve been handed to get the search results showing.
 * **Here´s the info from the developer who handed it to me**
    The .txt file contains
   some PHP code which should be included in your new search results page to set
   the source of the <iframe>.
 * **This is the content of the .txt file**
 *     ```
       <?php
   
       $IframeSrc = "http://weblink.resales-online.com/weblink/inc/start.asp?P1=BuscaresResales" ;
   
       $QS = trim($_REQUEST["QS"]) ;
       $VL = trim($_REQUEST["VL"]) ;
   
       if ( ( $QS != "" ) || ( $VL != "" ) )
       {
             $IframeSrc = "http://weblink.resales-online.com/weblink/inc/SearchAgent.asp" ;
             $IframeSrc .= "?P1=" . trim($_REQUEST["P1"]) ;
             $IframeSrc .= "&P2=" . trim($_REQUEST["P2"]) ;
             $IframeSrc .= "&QS=" . $QS ;
             $IframeSrc .= "&VL=" . $VL ;
             $IframeSrc .= "&P_Country=" . trim($_REQUEST["Country"]) ;
             $IframeSrc .= "&P_Area=" . trim($_REQUEST["Area"]) ;
             $IframeSrc .= "&P_Location=" . trim($_REQUEST["Location"]) ;
             $IframeSrc .= "&P_Type=" . trim($_REQUEST["Type"]) ;
             $IframeSrc .= "&P_Beds=" . trim($_REQUEST["Beds"]) ;
             $IframeSrc .= "&P_Min=" . trim($_REQUEST["PriceMin"]) ;
             $IframeSrc .= "&P_Max=" . trim($_REQUEST["PriceMax"]) ;
             $IframeSrc .= "&P_Ref=" . trim($_REQUEST["RefNum"]) ;
             $IframeSrc .= "&RentalType=" . trim($_REQUEST["RentalType"]) ;
             $IframeSrc .= "&RentalDate=" . trim($_REQUEST["RentalDate"]) ;
             $IframeSrc .= "&RentalDateFrom=" . trim($_REQUEST["RentalDateFrom"]) ;
             $IframeSrc .= "&RentalDateTo=" . trim($_REQUEST["RentalDateTo"]) ;
             $IframeSrc .= "&CustomArea=" . trim($_REQUEST["CustomArea"]) ;
             $IframeSrc .= "&OwnerId=" . trim($_REQUEST["OwnerId"]) ;
             $IframeSrc .= "&Lang=" . trim($_REQUEST["Language"]) ;
       }
       ?>
   
       <iframe name="ROL_iframe" marginwidth="0" marginheight="0"
       src="<?php echo $IframeSrc ?>"
       frameborder="NO" noresize width="615" height="2300" align="center" scrolling="no" onload="window.scroll(0,0)"></iframe>
       ```
   
 * **So….**
    It seems to me I have to implement the PHP code somewhere else and 
   leave the iFrame codes on the search result page…but, I don´t know where.
 * I would appreciate any answer taking my slightly closer to a solution.
 * Thomas

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-search-script-and-iframe/#post-3534238)
 * No need to separate out the different elements. It can all be inserted on the
   template used for whichever page the iframe is supposed to appear on. Or you 
   could create a new page template and base your page on this new template.
 *  Thread Starter [specto](https://wordpress.org/support/users/specto/)
 * (@specto)
 * [13 years, 3 months ago](https://wordpress.org/support/topic/php-search-script-and-iframe/#post-3534280)
 * Thanks a lot bcworkz – worked like a charm.
    Created a new page template based
   on the page.php and implemented the code.
 * Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP search script and iFrame’ is closed to new replies.

## Tags

 * [iframe](https://wordpress.org/support/topic-tag/iframe/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 2 replies
 * 2 participants
 * Last reply from: [specto](https://wordpress.org/support/users/specto/)
 * Last activity: [13 years, 3 months ago](https://wordpress.org/support/topic/php-search-script-and-iframe/#post-3534280)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
