Jump to content

Recommended Posts

Posted

I'm trying to put PHP coding into an HTML script. I've heard it is possible and have read the possible fixes to get it to work, but nothing is working.

 

Tried:

 

add this to a .htaccess file or httpd.conf

"AddType application/x-httpd-php .htm .html"

 

 

 

and inserted the code correctly into the web page...I think :ph34r:

 

Has anyone else done this here successfully? I could really use some help. Thanks!

Posted

AddType application/x-httpd-php .htm .html is what I use and it's worked for everything except inside Movable Type templates. Not quite sure why it doesn't work there.

Posted

OK...What are movable type templates?? What I'm trying to do in particular is move a search engine script that is stored on our site inside one of our pages so it will display the results on our website. I may be inserting the code incorrectly. I have tried saving it with .htm and .html exstensions and nothing shows up where the included script should be. If I call the search.php page direct it displays just fine, but I can't seem to get it inside of one of our website pages. I have tried including the page inside a .php page and I get "failed to open stream errors." The include code I am trying to use for the html page is: <?php include ("Search/Search.php");?> I'm really new to php, but this looked quite simple to install. Maybe I was wrong. Any ideas?

Posted
OK...What are movable type templates?? ?

Blog templates

 

What I'm trying to do in particular is move a search engine script that is stored on our site inside one of our pages so it will display the results on our website. I may be inserting the code incorrectly. I have tried saving it with .htm and .html exstensions and nothing shows up where the included script should be.  If I call the search.php page direct it displays just fine, but I can't seem to get it inside of one of our website pages.  I have tried including the page inside a .php page and I get  "failed to open stream errors."  The include code I am trying to use for the html page is: <?php include ("Search/Search.php");?>  I'm really new to php, but this looked quite simple to install. Maybe I was wrong. Any ideas

 

Try using the full path to the script.

Posted

<?php include ("Search/Search.php");?>

 

Is the path and file upper and lower case

or all lower case?

 

I looks like you are including a file named Search.php

in a folder called Search that resides inside the current folder?

Posted
<?php include ("Search/Search.php");?>

 

Is the path and file upper and lower case

or all lower case?

The case are correct...I've double-checked that three-thousand times 'til my eyes hurt :)

 

 

 

I looks like you are including a file named Search.php

in a folder called Search that resides inside the current folder?

 

"Search" is not the actual name of the folder and file - just using it for reference -

The"Search" folder is in the ROOT directory and the file is in the "Search" folder. It shows up in the source html for a test page I'm using but not on the page iteself...like it's hidden or something.

 

Here is the working script:

 

h**p://www.bluegrassgardens.com/SearchGoogle/googleSearch.php

 

The page I'm trying to test to take the page is:

 

h**p://www.bluegrassgardens.com/001.html

 

Maybe I'm just not inserting the php code correctly...can anybody check the source and see?? Thanks!

Posted (edited)

try

 

<?php

include $_SERVER['DOCUMENT_ROOT']."/SearchGoogle/googleSearch.php";

?>

 

and double chek your .htaccess file

for that line (I know you have but?)

 

AddHandler application/x-httpd-php .htm .html .shtml

Edited by TCH-Don
Posted

Should that be:

#AddHandler application/x-httpd-php .htm .html .shtml

 

like everything else or just go down a line and add:

AddHandler application/x-httpd-php .htm .html .shtml ??

Posted
h**p://www.bluegrassgardens.com/SearchGoogle/googleSearch.php

 

The page I'm trying to test to take the page is:

 

h**p://www.bluegrassgardens.com/001.html

 

 

 

 

DUH!! Maybe I should put my nerd hat on. I see what I was doing wrong. The path for the file for the search was inside of googleSearch folder. By putting the search script into the page, I was changing where the script was looking for the search files that go with the googleSearch.php file(see URLS above)...outside of the folder...or something like that...helps to sleep on it for awhile. Rather than getting into changing all of the php files, I just moved the few files and the folder into the public_html folder and it solved the whole mystery. I love this stuff! Thank you all for helping me make sense of this. I would have never known about the # in the .htaccess file meaning it ignored the rest of the line and that there were so many variables involved in all of this. Rock Sign

Posted

Glad you have it working! :)

 

One other thing you may want to consider next time

is to keep the file names in all lower case

it will make things simpler

all you have to do is forget to capitalize in one place

and it can take forever to find.

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...