What are you trying to achieve?
1. If the file is called from the browser and has a php extention, you
can use raw html and php snippets.
<h1>This is raw html</h1>
<?php
$user = $_SESSION[user_id];
echo "<h2> welcome " . $user;
?>
<h1>This is raw html again</h1>
2. if the file has a html extension, you can make your server to
process php snippets in HTML file as well.
You have to modify .htaccess for this and add something like "AddType
application/x-httpd-php .html"
3. Reading your question again, if you just want to add a html snippet
in a php file, use
<?php
include_once ('header.html');
?>
On 29-Jun-10, at 10:25 AM, Shaz wrote:
> Can you be a bit more detailed on what you are trying to achieve?
>
> Outputting html in php is a simply matter of using echo '<html> ....
> </
> html>';
>
> On Jun 29, 7:25 am, sunny <ravite...@gmail.com> wrote:
>> Can anyone tell me how to add an html file to php script.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help
> others with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google
> Groups "CakePHP" group.
> To post to this group, send email to cake-php@googlegroups.com
> To unsubscribe from this group, send email to
> cake-php+unsubscribe@googlegroups.com For more options, visit this
> group at http://groups.google.com/group/cake-php?hl=en
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment