DS928
asked on
Insert PHP into HTML page.
I need to insert a snippet of PHP into an HTML page. How can this be achieved? Thank you.
<div class="welcome-content">
<div class="row-body">
<div class="welcome-box-section">News</div>
<?php include("/home/audiodigz/public_html/ADDESIGN/blog.php"); ?>
</div>
</div>
Your own snippet is already correct. Maybe you mean, it doesn't work because the web server didn't have PHP properly installed? Then the answer is clear: Properly install PHP on the webserver, and your own snippet code will work.
ASKER
I have several PHP pages on this site that work fine. Am I still missing something?
Oh wait, I now see what you mean. It's not possible. HTML files don't pass through the PHP parser. Have the HTML forward to PHP, where all html code are echo commands and then have your php code inserted.
Change the .html to .php
ASKER
Changed the two pages to square.php and content.php. Deleted the two previous from the server. Square.html and content.html. Now the page is not loading at all. Sounds like a rabbit hole to me!! LOL!. The PHP does show in red though in Dreamweaver,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you Ray.