code- what am I doing wrong

  badgermansix 08:15 29 Apr 2006

Could someone advise me about this please?

I am attempting to use the search engine from phpFreaks
"MySQL Full-Text Searching with PHP"

I have created a very basic test webpage on my test server.
with a small database and table.

I copied and inserted the code for the for the search facility
but this is the result click here

I would appreciate any advice.


  beynac 11:14 29 Apr 2006

You need to "escape" the double quotes in your "echo" lines (i.e. precede them with a backslash - \").

There may be other problems but I can't check fully because I, obviously, can't connect to the database. The code doesn't show now and I get the correct, expected warning.

  beynac 11:40 29 Apr 2006

Sorry - I didn't notice that you were using single quotes for the "echo" lines. Please ignore my previous post.

The page is displaying as if it was saved as "html" rather than "php". Is your test server working OK for other php pages? Have you saved the page with a php extension?

  badgermansix 19:14 29 Apr 2006

beynac, thank you for your imput.
Would it help if I copied the complete code that
was provided for this search facility, here?

My test server seems to be working fine.

  beynac 07:19 30 Apr 2006

The code works fine, as far as I can tell without the database set up. You have saved the page as index.htm instead of index.php. If you change this, then it will work.

  badgermansix 11:55 30 Apr 2006

beynac, thanks for replying, I saved the code which I copied and pasted from here
click here
I then looked at the code in FP2003 and also HTML-Kit
Both with the same result in "Preview" the code still shows with the "Search For" "Mode" and "Search" boxes displayed with code, its very frustrating, its probably me, but I can't see how if I just copied and pasted without saving even.

Thanks again for your help.

  PurplePenny 14:30 30 Apr 2006

Have you done as beynac says and saved it as .php instead of .htm? That is important.

  beynac 15:12 30 Apr 2006

As I said - the code is fine. The page on the server is "index.htm". You must rename this as "index.php". As PurplePenny says, this is important. All pages containing php code MUST have the .php extension in order to work.

  badgermansix 06:28 01 May 2006

Thank you for your patience and help.

I have copied the code, pasted to Notepad, and saved it as index.php.

What I cannot understand, and please feel free to "tut,tut" :-)) is this:-

How do I incorporate "index.php" onto my existing (very basic) WebPage, to get the search engine onto it?

This was created with FP2003. click here

I did not want to do anything more time consuming until I understand A: How to create a webpage and b. How to get a search engine to work on it.

I have followed the tutorial "MySQL Full-Text Searching with PHP" at
click here
the database and table are on my test server, so now I just have to connect this with my webpage,

If you could advise me on this.....

  beynac 08:20 01 May 2006

The "index.php" page has to be on your test server, which must have both php and MySQL installed and running. The php pages will not work locally using "Preview" mode in FP2003.

You need to replace the existing "index.htm" page with the new "index.php" page you saved in Notepad. I don't know how you achieve this using FP2003 I'm afraid. I would just upload it to the test server using FTP.

  Forum Editor 12:06 01 May 2006

First of all, with FP 2003 there are some things you need to do/know before you use php:-

1. You must disable any features in your site that require the FrontPage Server Extensions

2. If the Web server that runs your php page has the FrontPage extensions installed, do the following:

a) On the Tools menu, click Page Options, and then click the Authoring tab.

b) Under FrontPage and SharePoint technologies, clear the SharePoint Services and Browse-time Web Components check boxes.

c) Disable features that create ASP or ASP.NET code

3. If the Web server that runs your php pages can also run asp, do the following

a) On the Tools menu, click Page Options, and then click the Authoring tab.

b) Under Browsers, clear the Active Server Pages check box.

4. Enable and use ASP-style <% %> code delimiters

Do the following:
Open the php.ini (php.ini: The master configuration file for php that you can customize to help you control the way php works on your site.) file on the Web server, and set asp_tags="1".
Use ASP-like <% and %> tags instead of the <? php?> tags. This stops FrontPage from reformatting your PHP code.

As an alternative, you can use <script language="php"> and </script> tags instead of <? php?> tags.

5. Configure PHP file extensions to open in Design view

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

AMD Radeon Adrenalin release date, new features, compatible graphics cards

Inside the iMac Pro - Apple's most powerful Mac yet

iMac Pro release date, UK price & specs

Football : comment regarder la Ligue 1 en direct ?