The code below is kept in a file called search.php I call this file with an include to the index page performing a search function. The issue is the search is in the top right corner and the results end up appearing in the top right corner instead of in the main text part of the page. Any help is Appreciated.
Rather than echoing the output of the search why don't you store it in a variable and then you can echo that variable anywhere on the page that you want.
This will include the file on whatever file you included it on. <?php require_once("myfile.php"); ?> Code (markup):
Yeas that is using an include maybe i didn't explain myself clear enough. I have a file called search.php that contains the code in the above posts. I use and include to make the search work on my main index page. The problem is when someone searches it replaces the search box with the results in the same section when i want it to post the results in the main section... hope this clarifies your help is appareciated.
Something along the lines of the following... Don't just echo your output. Store it in a variable, like $search_output or something. Then, in your index, you've presumably already included this search.php so $search_output should have something in it if a search was performed. So, throw something like this in where the output should show: <?php if ($search_output) echo $search_output; ?> PHP: You're just not putting it in the included file. Because you're outputting HTML in the included file, it's wanting to echo the same code right up there in the box. This should be a start..
ok guys i have tried and i just can't seem to figure it out. I need to get this done. If someone can help me i am willing to pay them $10 via paypal once it is complete. PM me. Esp rszrama as u seem to know what u are talkin about.
Well, the problem is not with the search script,so you should give the search script as well as the code of the page that includes the search.php file.... if I find some time and you send me the 2 files I guess I can help you... Good luck
the page that the code is included on is www.all-freemagazines.com/test If you need the actauly files pm me with where to send them.