As Shaz points out, there are a few basic and very simple options. 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');
?>

B
http://webhostingangel.com

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 <[email protected]> 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 [email protected]
To unsubscribe from this group, send email to
[email protected] 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 [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to