Let's say the document i'm working on is index.html and I want to reference wally.php within the html document. Php code is as follows:
%26lt;?
echo "Hello Wally";
?%26gt;
Need the html code to reference this php script so it is executed within the html document.
How do you call a php file to be executed within an html file?
you can place the code directly into the body of the html OR you can create a separate php file - like hello.php, then include it in your html wherever you want to use it like this
%26lt;?
include("hello.php")
?%26gt;
here's a link to a good tutorial on the include function in php:
http://www.tizag.com/phpT/include.php
Reply:you shoul use the tag :"form" like this:
in your index.html, write this code:
%26lt;form method="GET" action="wally.php"%26gt;%26lt;/form%26gt;
or this one
%26lt;form method="POST" action="wally.php"%26gt;%26lt;/form%26gt;
Reply:The way to execute PHP on a .html page is to modify your .htaccess file. This file may be hidden, so depending upon your FTP program you may have to modify some settings to see it. Then you just need to add this line for .html:
AddType application/x-httpd-php .html
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment