Problem embedding php in html

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
serambin
Forum Newbie
Posts: 9
Joined: Wed Nov 13, 2002 11:27 pm
Location: Haughton, LA 71037

Problem embedding php in html

Post 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:
serambin
Forum Newbie
Posts: 9
Joined: Wed Nov 13, 2002 11:27 pm
Location: Haughton, LA 71037

Never mind

Post 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:
Rincewind
Forum Commoner
Posts: 27
Joined: Thu Nov 21, 2002 11:15 am
Location: Norway

filename

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