were do u put a search engine script on a html table

01-06-10, 10:39 AM
|
|
Newbie Coder
|
|
Join Date: Nov 2009
Posts: 14
Thanks: 3
Thanked 0 Times in 0 Posts
|
|
|
were do u put a search engine script on a html table
I need some help with this script. its working fine but what do i do if i want to insert it within a html script. I have tried to but it between the <head> tags but dont get the result i want, pls help.
|

01-06-10, 01:40 PM
|
 |
Coding Addict
|
|
Join Date: Jul 2009
Posts: 377
Thanks: 6
Thanked 10 Times in 10 Posts
|
|
I assume you create the form and database that 'feeds' this script.
Option1:
Put it where ever you want in the page (where you want the output to show) and rename the page to (pagename).php
Option2:
Save this as a .php and use an IFRAME to include it in the page
Option3:
Change .htaccess so that you can run php from within .html / .htm
__________________
This post was created with 100% recycled electrons.
|

01-06-10, 03:03 PM
|
 |
Community Liaison
|
|
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
|
|
Put it all on one page.
Something like this:
And make sure the page has a .php extension.
__________________
Jerry Broughton
Last edited by job0107; 01-06-10 at 03:07 PM.
|

01-06-10, 03:43 PM
|
 |
Coding Addict
|
|
Join Date: Jul 2009
Posts: 377
Thanks: 6
Thanked 10 Times in 10 Posts
|
|
That is not correct, if you just put the code on top of the page in this way (even a .php page) then the output will be prior to the <html> <head> and <body> tags. The code should be inserted where the output is wanted.
and yes ... you can ensure that the page has a .php extension, however if it is an existing page then you might not want to change the page extension. In that case use one of the other options (see my original post)
__________________
This post was created with 100% recycled electrons.
|

01-06-10, 05:37 PM
|
 |
Community Liaison
|
|
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
|
|
Quote:
Originally Posted by ruteckycs
That is not correct, if you just put the code on top of the page in this way (even a .php page) then the output will be prior to the <html> <head> and <body> tags. The code should be inserted where the output is wanted.
and yes ... you can ensure that the page has a .php extension, however if it is an existing page then you might not want to change the page extension. In that case use one of the other options (see my original post)
|
I don't mean to rain on your parade,
but if you knew anything about PHP,
you would see that my code not only works,
but I can use the stored variables anywhere in my HTML.
__________________
Jerry Broughton
|

01-06-10, 07:12 PM
|
 |
Level II Curmudgeon
|
|
Join Date: Dec 2004
Posts: 3,027
Thanks: 14
Thanked 35 Times in 33 Posts
|
|
Quote:
Originally Posted by ruteckycs
That is not correct, if you just put the code on top of the page in this way (even a .php page) then the output will be prior to the <html> <head> and <body> tags. The code should be inserted where the output is wanted.
|
Actually, all of Job0107's code runs before the page is printed, and the output is stored in the variable "$results". That variable could be placed anywhere in the page just by printing it out with <?php echo $results ?>.
I often do the same sort of thing when I want the result to be able to be moved around or placed in different areas. If you have a lot of code to run then it may delay the page output slightly, but it's better than printing out part of the page, then seeing a pause as the code runs, and then seeing the rest of the page appear.
Last edited by job0107; 01-07-10 at 04:46 PM.
|

01-06-10, 08:41 PM
|
 |
-
|
|
Join Date: Feb 2006
Posts: 2,515
Thanks: 20
Thanked 109 Times in 106 Posts
|
|
There are lots of different coding styles. I like job0107's approach, too.
|

01-06-10, 09:10 PM
|
 |
Community Liaison
|
|
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
|
|
Thank you, I am flattered.
__________________
Jerry Broughton
|

01-06-10, 09:58 PM
|
 |
Coding Addict
|
|
Join Date: Jul 2009
Posts: 377
Thanks: 6
Thanked 10 Times in 10 Posts
|
|
Oh sorry Job, I do that as well. I didnt actually read your script. I had assumed that you just pasted the OP's code on top of a page.
But hey thanks for the smart *** comment .... if you knew anything ... glad to see that we have maturity in this forum .. especially from someone who is suppose to represent the forum community,
__________________
This post was created with 100% recycled electrons.
|

01-07-10, 08:05 AM
|
 |
Community Liaison
|
|
Join Date: Dec 2006
Location: Tacoma, Washington USA
Posts: 3,454
Thanks: 0
Thanked 140 Times in 137 Posts
|
|
Quote:
Originally Posted by ruteckycs
Oh sorry Job, I do that as well. I didnt actually read your script. I had assumed that you just pasted the OP's code on top of a page.
But hey thanks for the smart *** comment .... if you knew anything ... glad to see that we have maturity in this forum .. especially from someone who is suppose to represent the forum community,
|
I am also sorry if I rattled your cage a little.
I do not have much tolerance for programmers that do not examine the code before speaking.
But I am working on that.
__________________
Jerry Broughton
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|