phred Posted December 23, 2014 Share Posted December 23, 2014 this is simple i know ... but i cannot get php to execute correctly in html. could someone look at the following: i start withhttp://localhost/index.html-----"the title here" --- in the right spots-----but this is what i gethello, 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><?phpprint "<span style=\"font-weight:bold;\">hello, world</span>";?></body></html> ----------------------------- any help would be greatly appreciated. phred Link to comment Share on other sites More sharing options...
HartleySan Posted December 24, 2014 Share Posted December 24, 2014 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 More sharing options...
phred Posted December 24, 2014 Author Share Posted December 24, 2014 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 More sharing options...
Recommended Posts