Problem embedding php in html
Posted: Mon Nov 18, 2002 11:51 pm
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
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