Jump to content
Larry Ullman's Book Forums

Php-Not-Read-W-Html


Recommended Posts

this is simple i know ... but i cannot get php to execute correctly in html.

 

could someone look at the following:

 

i start with
http://localhost/index.html
-----
"the title here" --- in the right spots
-----
but this is what i get

hello, world"; ?>

-----------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<script type=text/php>
</script>
<meta http-equiv="Content-Type"
content="text/html; charset=utf-8"/>
<title>"the title here:"</title>
</head>
<body>
<?php
print "<span style=\"font-weight:bold;\">hello, world</span>";
?>
</body>
</html>

-----------------------------

any help would be greatly appreciated.

 

phred

Link to comment
Share on other sites

First off, localhost is local only to you, meaning that the URL you posted will not work for anyone else.

 

More importantly than that though, you need to change index.html to index.php and then run the script through a server.

Do you have XAMPP or some other server software installed?

Link to comment
Share on other sites

hi HartleySan;

 

thanks for the reply.  i am using debian and am practicing on a local computer.  i changed index.html to index.php and everything went well.  i assumed that once embedded in the html, php would be started when <?php was found in the html script and the php script would end with ?>. after that, processing would be turned over to html.

 

anyway, thanks for your response

 

phred

Link to comment
Share on other sites

 Share

×
×
  • Create New...