Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Show search results on same page

  1. #1
    Join Date
    Jun 2007
    Location
    DeKalb, IL
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Show search results on same page

    I have a .shtml file that has a form search box on it.

    I'm calling

    HTML Code:
    <form action="search-help.php"  method="GET" id="searchform">
    And the search file works. However, it goes to another page instead of showing the results immediately below the form.

    I know I must have a SSI and this is what I have

    HTML Code:
    <!--#include virtual="search-help.php" -->
    But it still doesn't work and goes to a new page.

    I can't rename the .shtml file to a PHP. The page doesn't look right and my template is gone. But if I do & copy and paste the search-help.php code onto that page, then it works and shows my results under the search form.

    Any other ideas? For a better idea here's the link: http://www.kishwaukeecollege.edu/con...s/index2.shtml

  2. #2
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    There are two possibilities that you can try:

    1. Change the action of the form from search-help.php to index2.shtml.

    2. If #1 doesn't work, try a Jscript redirect to search-help.php.

    Code:
    <script type="text/javascript">
    location.href = 'search-help.php';
    </script>
    Lemme know how it worksout.
    - Josh

  3. #3
    Join Date
    Jun 2007
    Location
    DeKalb, IL
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    #1 doesn't work. It does stay on the page and it shows that it searches it in the URL but doesn't show anything on the page.

    Where do I put the Jscript code at?

  4. #4
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    Make the .shtml page empty, and only put that code in. I recommend that you design the search-help.php file to match the rest of the site.

    HTH
    - Josh

  5. #5
    Join Date
    Jun 2007
    Location
    DeKalb, IL
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Aww, man. That sounds like a pain in the butt! There's no other solutions out there anyone??

  6. #6
    Join Date
    Feb 2006
    Posts
    78
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Did you try
    Code:
    <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
    That might help

  7. #7
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    That's not the problem. index2.html doesn't process the data, search-help.php does.
    - Josh

  8. #8
    Join Date
    Jun 2007
    Location
    DeKalb, IL
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Yep, I was gonna say that I did try that before posting here and it still doesn't help. So not sure what else I'm going to do to fix this solution.

  9. #9
    Join Date
    Mar 2007
    Location
    New York, NY
    Posts
    557
    Thanks
    8
    Thanked 66 Times in 66 Posts

    Default

    Are you new to web-development? If you have enough know-how, you can develop the system in ajax, which is very simple and fast. Not only does ajax have the advantage of allowing the content to be displayed as desired as in this case, it also makes the php page run much fester.
    - Josh

  10. #10
    Join Date
    Jun 2007
    Location
    DeKalb, IL
    Posts
    45
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    yea, I don't have the time to learn a new whole new ballgame to run this unfortunately. No matter what I mess with, the search results still show up in a new page. sooo don't know what my next step will be; guess tell my boss that I didn't know how to do it!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •