WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] PHP search script and iFrame (3 posts)

  1. specto
    Member
    Posted 1 year ago #

    Hi.
    I´m trying to install a PHP search script for properties on 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 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

  2. bcworkz
    Member
    Posted 1 year ago #

    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.

  3. specto
    Member
    Posted 1 year ago #

    Thanks a lot bcworkz - worked like a charm.
    Created a new page template based on the page.php and implemented the code.

    Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic