Jump to content

Simple? Urgent Coding Help Please


Mysterio75

Recommended Posts

Hello,

 

Can anyone help with the following please? I have written a mainly HTML site for a charity (a support forum mainly) but have also tried to incorporate a "site search" function using some software called Search Engine Builder.

 

The indexing software seemed to go ok, and it created 3 files which were copied to my webserver:

 

Search.php

searchfunc.php

webdata.php

 

However (and being a newcomer to PHP) , when I try to link to the Search.php from my homepage, I saw "Internal Server error" when clicking the relevant URL.

 

The contents of search.php are :

 

<HTML><HEAD>

<TITLE>Search Engine Builder Professional -- Search this site</TITLE>

</HEAD>

 

<BODY>

 

 

 

<!-- You can move the following search box code to where you want to display a search box. -->

<!-- Don't modify the name of the FORM and INPUT -->

 

<!-- *********************** BEGIN of search box code *********************** -->

<FORM name="formSear" action="search.php" method="GET">

<p align="center">

<INPUT name="searWords"> <INPUT name="Send" type="submit" value="Search">

<p align="left">

</FORM>

<!-- *********************** END of search box code ************************* -->

 

 

 

<!-- You can move the following search results output code to where you want to output search results. -->

<!-- Modify the "include()" if needed. For example, modify to include("/search/webdata.php") etc. -->

 

<!-- ******** BEGIN of search results output code ******** -->

<?include("webdata.php");?>

<?include("searchfunc.php");?>

<!-- ******** END of search results output code ********** -->

 

 

 

<!-- Ignore the following IFrame line if you will not use IFrame in your search engine -->

     

 

 

</BODY>

</HTML>

 

 

I tried renaming the search.php to search.html (and reflected it on my homepage) and it indeed brought the search box up, but then I am stuck as it doesn't seem to trigger any query (or output on the screen) of the data the indexing (seems to have) gathered.

 

What am I "not doing" or missing please? Is there some code I have missed out?

 

I mailed the SW provider - no reply!

 

I really hope this makes sense to someone, I'm doing the site for nothing and it's making me pull my hair out (what is left of it)

 

Thanks,

 

Martin.

 

 

 

Link to comment
Share on other sites

The first thing I would do is eliminate the short tags and see what happens. The problem could also be within one of the included files.

 

Next, how exactly did the file get to your server? Is the script that creates the files on your remote server? Is it Linux/Unix or Windows? Did you develop the site on your home PC and upload the files. The reason I'm asking is that a 500 error can be caused by improper line endings. Linux/Unix server will not use a file with windows line endings.

 

 

HTH

Teamatomic

Link to comment
Share on other sites

Thankyou very much for your help firstly.

 

I have PM'd you the site name.

 

I didn't know whether to call the file I directed my URL to as search.php or search.html - when I called it .php, the internal error appeared. When I renamed it .html, the search box appeared but when I actually did a search it came back with "The link appears to be broken".

 

I get the feeling that I'm not telling the script to run a command, or indeed output the results somewhere - but I could be wrong?

 

My Search.html now looks like this

 

<HTML><HEAD>

<TITLE>Search Engine Builder Professional -- Search this site</TITLE>

</HEAD>

 

<BODY>

<FORM name="formSear" action="search.php" method="GET">

<p align="center">

<INPUT name="searWords"> <INPUT name="Send" type="submit" value="Search">

<p align="left">

</FORM>

 

 

<?include("webdata.php");?>

<?include("searchfunc.php");?>

 

 

 

</BODY>

</HTML>

 

I FTP'd the files up, the perms were 644, but are now 655 as I thought this may have caused an issue also. No joy.

 

I edited the files on my home pc and uploaded them but I'm not sure what OS my host webserver uses (not sure how to find out)

 

In case you haven't noticed, I'm very "green" !!!!

 

thanks so much again.

 

Martin

 

Link to comment
Share on other sites

A 500 error is not caused by syntax. It is caused by the server puking at a deeper level although a bad .htaccess file can throw a 500 thus masking a parallel problem with script syntax.

 

File permissions probably are not a problem unless you went and did a wholesale chmod to 755 or 777. But if you are developing on a linux box and uploading to a linux/unix server the chances increase that it could be permission related. I can, on my home SuSe box do a recursive 777 to home and all will serve happily along. If I pushed a site over to a production serve there would be massive 500 errors as linux to linux preserves the original file permissions whereas windows tol linux the remote serve will set the perms.

 

As I said earlier the line endings can be a cause.

 

Another cause can be a bad .htaccess file.

 

If you want more you need to answer these:

 

How did the files get to the remote server?

What OS is the remote?

What OS are you developing on.

Did you open the files, edit and save on a windows box with a windows centric editor like note or heavens forbid, office/works?

Did the search script that created the three files make a .htaccess file? Did you?

What are the perms of the three files and their associates folders on the remote server?

 

 

HTH

Teamatomic

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.