• Disclaimer: I know almost nothing about PHP, but my boss doesn’t want to pay an actual web developer, so I get to try to kludge things together. ??

    For our company website, we need clients to be able to search an industry-specific database of products. It’s a simple matter to create a “Search Entire Product Database” page with an iframe. But naturally we want something more complex. We want to have a search form in the header of every page that feeds the keyword into this database, rather than searching the content of our actual site. So they type “widgets” in the search box at the top of the homepage, and they end up on the search page viewing an iframe of https://www.productdatabase.com/startSearch?keywords=widgets.

    Now, we had this on our old static site. This was in menuBar.php:

    <form action="cart.php">
        <tr>
        <td><input type="text" name="keyword" size="30" /></td>
        <td><input name="" type="image" src="images/seach.gif" /></td>
        </tr>
    </form>

    And this was in cart.php:

    <?
    if(strlen($_GET[keyword]) > 0) $url = "https://www.promoplace.com/ws/ws.dll/StartSrch?DistID=2775&Srching=1&keywords=$_GET[keyword]";
    else if($_GET[Rec] != "") $url = "https://www.promoplace.com/ws/ws.dll/PrDtl?DistID=$_GET[DistID]&RecNum=$_GET[RecNum]&Rec=$_GET[Rec]";
    else $url = "https://www.promoplace.com/ws/ws.dll/Search?DistID=2775";
    ?>
    
    <iframe width="825" height="650" frameborder="0" src="<?= $url ?>" scrolling="auto"></iframe>

    Any guidance on how to replicate this in WordPress?

  • The topic ‘Creating a search form that searches something other than my site’ is closed to new replies.