PassMark Logo
Home » Forum

Announcement

Collapse
No announcement yet.

Php include not displaying results

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Php include not displaying results

    Using 4.2 build 1012 Licensed Pro version

    Sent you an email but thought someone might have a quick answer for us in these forums.

    We’re making a custom results page using php includes and are not able to view the results using php includes. We’ve looked at the faqs and forums and cannot seem to find a solution. If we go directly to the search page we do get results back if we point the linkbackURL to search.php or just take it out..

    ie searching for “dealer” or “auto”.
    Search works ok.going directly to . http://www.profitconcepts.net/new/search.php
    The Settings file is currently set to $LinkBackURL = "http://www.profitconcepts.net/new/mysearch.php



    We’re calling the search from this file with a header.php http://profitconcepts.net/new/mysearch.php also http://www.profitconcepts.net/new/compliance2.php

    Any suggestions would be helpful to get the php include working

    Thx


    http://profitconcepts.net/new/mysearch.php

    <body>



    <?php include("http://profitconcepts.net/new/header2.php"); ?>
    </p>



    <?php include("http://profitconcepts.net/new/search.php"); ?>

  • #2
    If you want to include server side scripting before or after the search results then you should follow the instructions on this FAQ page.
    http://www.wrensoft.com/zoom/support/faq_ssi.html

    At the moment you appear to have followed just some of the instructions.

    For example, when I look at the output of your mysearch.php script I can see this invalid HTML,

    <html>
    <head>
    ....
    </head>
    <body>
    .....
    <HTML>
    <HEAD>
    ....
    </HEAD>
    <BODY ....>
    ....
    </BODY>
    </HTML>
    ...
    <html>
    <head>
    ....
    </head>
    <body>
    ....
    </body>
    </html>
    </body>
    </html>

    You need to edit the Zoom search_template.html file (as per the instructions) and probably need to edit your own script as well, so that you only have one <head> and one <body> section in your page.

    There might be other problems after this, but fix this one first.

    -------
    David

    Comment


    • #3
      Ok, thx for the heads up on the extra code. we've pulled out the extra head, body etc. added the footer.php and modified the search_template

      http://www.profitconcepts.net/new/mysearch.php

      <?php include("http://profitconcepts.net/new/header2.php"); ?>
      <?php include("http://profitconcepts.net/new/search.php"); ?>
      <?php include("http://profitconcepts.net/new/footer.php"); ?>

      We also unchecked per the instructions ""Disable charset enforcing on search script"

      What's the next step?

      thx

      Comment


      • #4
        We can't know for sure what's happening without seeing your other PHP scripts as well (header2.php, etc.)

        But you might want to try using the virtual() function instead of include() as suggested in the FAQ, and see if that helps.

        Also, check if you have PHP debug messages enabled in your PHP configuration. I suspect there might be PHP error/warning messages that we aren't seeing because they are being suppressed by your server.
        --Ray
        Wrensoft Web Software
        Sydney, Australia
        Zoom Search Engine

        Comment


        • #5
          I don't know why but using a combo of include for the header and virtual() for the search and footer works.

          <?php include("header2.php"); ?>
          <center><?php virtual("search.php"); ?></center>

          <?php virtual("footer.php"); ?>


          results are now being displayed.

          Why would it work like this? Any reasons I shouldn't mix virtual and include?


          using virtual() for all.. header, search and footer would give an error.

          BTW here is the header
          http://profitconcepts.net/new/header2.php

          Comment


          • #6
            It depends on what you are doing in "header2.php". I can't see your script's code from that URL alone. I am only able to see the output of the script.

            I suspect that you are doing something in either "header2.php" or "footer.php" which relies on certain file paths, or they are dependent on other things in your "mysearch.php" file that you have not shown us. Or it may simply be that your file paths are incorrect when you specify them with the different functions.

            There is no problem using both virtual() and include() in the same script. They differ in a number of subtle ways, most notably the path that they expect as a parameter.

            For more information on virtual() and include(), please see the corresponding PHP documentation:

            http://www.php.net/manual/en/function.include.php
            http://www.php.net/manual/en/function.virtual.php
            --Ray
            Wrensoft Web Software
            Sydney, Australia
            Zoom Search Engine

            Comment


            • #7
              This is the header search and footer.


              >>>>>>>>
              header2.php


              <HTML>
              <HEAD>
              <TITLE>header2</TITLE>
              <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
              <LINK HREF="http://profitconcepts.net/new/style.css" TYPE="text/css" REL="stylesheet">
              <LINK HREF="http://profitconcepts.net/new/STYLE2.css" TYPE="text/css" REL="stylesheet">
              <link href="http://profitconcepts.net/new/styleHome.css" rel="stylesheet" type="text/css">
              <script language="JavaScript">
              // JS Languages Messages

              var glbl_list_please_select_a_record = "Please, select a record(s)";
              var glbl_list_do_you_really_want_to_delete_the_record = "Do You really want to delete the record(s)?";
              var glbl_list_do_you_really_want_to_delete_the_record2 = "Do you really want to delete the document titled";
              var glbl_list_please_enter_valid_value = "Please enter valid $title value";

              var demo_mode = 0;

              function AfterLoad()
              {
              if('' != '')
              {
              alert('');
              }
              }
              </script>


              <style type="text/css">
              <!--
              .style1 {color: #000000}
              -->
              </style>
              </HEAD>
              <BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0 rightmargin="0" bottommargin="0" onLoad="AfterLoad();">
              <center>
              <TABLE WIDTH=727 BORDER=0 CELLPADDING=0 CELLSPACING=0>
              <TR>
              <TD> <TABLE WIDTH=727 BORDER=0 CELLPADDING=0 CELLSPACING=0>
              <TR>

              </TR>
              <TR>
              <TD> <TABLE WIDTH=727 BORDER=0 CELLPADDING=0 CELLSPACING=0>
              <TR>
              <TD WIDTH=281 HEIGHT=59 valign="bottom" ></TD>
              <TD background="http://profitconcepts.net/new/images/m1.gif" WIDTH=86 HEIGHT=59 ><div style="padding-top:38px;padding-left:14px ">Main Page</div></TD>
              <TD background="http://profitconcepts.net/new/images/m2.gif" WIDTH=81 HEIGHT=59 ><div style="padding-top:38px;padding-left:14px "> Products</div></TD>
              <TD background="http://profitconcepts.net/new/images/m3.gif" WIDTH=84 HEIGHT=59 ><div style="padding-top:38px;padding-left:14px ">Services</div></TD>
              <TD WIDTH=108 HEIGHT=59 valign="top" background="http://profitconcepts.net/new/images/m4.gif" ><div style="padding-top:28px;padding-left:5px ">
              <center><a href="requestsupplies.php" class="menu">Request

              Supplies</a>
              </center>
              </div></TD>
              <TD background="http://profitconcepts.net/new/images/m5.gif" WIDTH=87 HEIGHT=59 ><div style="padding-top:38px;padding-left:14px ">Contact Us</div></TD>
              </TR>
              </TABLE></TD>
              </TR>
              <TR>
              <TD bgcolor="#FFFFFF" WIDTH=727 HEIGHT=5 ></TD>
              </TR>
              <TR>
              <TD> <TABLE WIDTH=727 BORDER=0 CELLPADDING=0 CELLSPACING=0>
              <TR>
              <TD> <TABLE WIDTH=281 BORDER=0 CELLPADDING=0 CELLSPACING=0>
              <TR>
              <TD background="http://profitconcepts.net/new/images/home_06.jpg" WIDTH=281 HEIGHT=132 ><div style="padding-top:83px;padding-left:15px;padding-right:10px ">



              Classroom training Online Training </div></TD>
              </TR>
              <TR>
              <TD background="http://profitconcepts.net/new/images/home_08.jpg" WIDTH=281 HEIGHT=133 ><div style="padding-top:89px;padding-left:15px;padding-right:10px ">

              Industry and Compliance</div></TD>
              </TR>
              </TABLE></TD>
              <TD> <TABLE WIDTH=446 BORDER=0 CELLPADDING=0 CELLSPACING=0>
              <TR>
              <TD> </TD>
              </TR>
              <TR>
              <TD WIDTH=446 HEIGHT=28 valign="middle" bgcolor="#3D3D3D" ><div style="padding-top:3px;padding-right:10px " align="right">
              <form method="GET" action="http://profitconcepts.net/new/mysearch.php">
              <div> <strong class="white" align="bottom">Site search:[/b]
              <input type="text" name="zoom_query" size="15">
              <input name="image" type="image" SRC="http://profitconcepts.net/new/images/go.gif">
              </div>
              </form>
              </div></TD>
              </TR>
              </TABLE></TD>
              </TR>
              </TABLE></TD>
              </TR>
              </TABLE></TD>
              </TR>
              <TR>
              <TD WIDTH=727 HEIGHT=1 ></TD>
              </TR>
              <TR>

              </TR>
              <TR>

              </TR>

              </TABLE>
              </center>

              >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
              mysearch.php

              <?php include("header2.php"); ?>
              <center><?php virtual("search.php"); ?></center>

              <?php virtual("footer.php"); ?>



              >>>>>>>>
              footer.php


              <TR>
              <TD bgcolor="#E3E4DC" WIDTH=727 HEIGHT=81 ><div style="padding-top:28px " align="center">
              Copyright 2006 &copy; Profit Concepts Inc. All rights reserved Privacy Policy.</div></TD>
              </TR>
              </body>
              </html>

              Comment

              Working...
              X