Log in

View Full Version : Show search results on same page



lindsaycb
08-11-2009, 06:09 PM
I have a .shtml file that has a form search box on it.

I'm calling


<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


<!--#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/contact_us/index2.shtml

JShor
08-11-2009, 08:05 PM
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.



<script type="text/javascript">
location.href = 'search-help.php';
</script>


Lemme know how it worksout.

lindsaycb
08-11-2009, 08:09 PM
#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?

JShor
08-11-2009, 08:17 PM
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:)

lindsaycb
08-11-2009, 08:20 PM
Aww, man. That sounds like a pain in the butt! There's no other solutions out there anyone??

Sikky
08-13-2009, 11:17 PM
Did you try
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">


That might help

JShor
08-13-2009, 11:25 PM
That's not the problem. index2.html doesn't process the data, search-help.php does.

lindsaycb
08-18-2009, 03:26 PM
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. :(

JShor
08-18-2009, 05:35 PM
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.

lindsaycb
08-18-2009, 05:38 PM
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!

JShor
08-18-2009, 10:08 PM
It's really not that tough, it's amatter of copy+pasting. If you want, I can easily take care of it for you.