A website is made up of Web pages. Users move between Web pages through links that direct them to other Web pages. A Web page can be an HTML file or it can be a file in a scripting language such as PHP that outputs HTML code. Since both HTML and PHP files are considered Web pages, you can link to a PHP file the same way you link to any Web page in a website.
Create a new HTML file using an HTML editor or Notepad.
Insert the HTML header information. For example, type:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
Insert a link to a PHP file using the HTML "<a>" tag. Specify the name of the PHP file with the "href" parameter. For example, type:
<a href="phpfile.php">Run PHP file</a>
Exit the editor and save the file. Navigate to the "phplink.html" file in a browser and test that it functions correctly.
- Photo Credit John Foxx/Stockbyte/Getty Images
How to Call an External PHP File Form with HTML
The "action" attribute for the HTML "<form>" tag is used to call an external PHP file. The method attribute of the "<form>"...
How to Convert PHP Files to Microsoft Publisher
Over the years, file extensions will change meaning as old programs are made obsolete. Currently (2010), a PHP file refers to a...