Page 1 of 1

Problem embedding php in html

Posted: Mon Nov 18, 2002 11:51 pm
by serambin
Funny problem this.

I need to run a php code snippet in an html page and can't get it done.

Here are the ways I've tried:

<?php
require("/home/lhost/public_html/cgi-bin/newspro/news.txt");
?>

<?php require("/home/lhost/public_html/cgi-bin/newspro/news.txt"); ?>

<script language="php">
require("/home/lhost/public_html/cgi-bin/newspro/news.txt"); </script>

<% require("/home/lhost/public_html/cgi-bin/newspro/news.txt"); %>

Now I know the scripts work, because when I change the page name from page.htm to page.php the code runs fine and the path works. So the problem only happens with the .htm document ending.

Thanks for any help or ideas,

Stan Rambin :oops:

Never mind

Posted: Tue Nov 19, 2002 12:13 am
by serambin
Never mind :oops:

I deleted the .htaccess file yesterday so the server couldn't parse the php.

:oops: :oops:
Stan Rambin
:oops: :oops:

filename

Posted: Thu Nov 21, 2002 11:36 am
by Rincewind
There could very well be that I have missed some points in .htaccess and that you can use that to get the php-engine to parse html-docs, but the default setting for the php-engine is that if the file-extension isn't php it will not look at it at all, iow: Apache won't send it to the php-engine, it will just output it as html.