HTML within PHP coding

@cmw4562 (239)
United States
August 12, 2007 7:10am CST
If one wants to insert HTML coding within PHP, what is the coding that you have to put around the HTML so then the HTML will function correctly? Thanks in advance for your help...
2 people like this
4 responses
• Canada
12 Aug 07
PHP is a programming language on its own. It is not enough to know how to include it in HTML files. You will need to learn the language as well. the official PHP site is http://php.net To include PHP in HTML you will need to use the tags. Also, on the majority of servers, the file as to end with extension .php for the PHP code to be processed, otherwise the PHP code will be just rendered on the web page like any other text.
• Canada
12 Aug 07
OK, it seems that mylot does not stop you from using certain symbols here, and rather filters them out silently: here are the required tags again (I guess the member who wrote the first response had the same problem as well): (?php some PHP code ?) You should replace ( by less than character and ) by greater than character.
• United States
24 Nov 07
Thanks Spidey. I've been trying to get my partner to teach me php for over a year, but that woman is slammed with work, so she hasn't had time. I can thank video professor and a few search engines for my html skills, lol.
1 person likes this
• Canada
24 Nov 07
You are welcome. There are many PHP cookbooks out there. Personally, I prefer reference manuals. I use a book called Programming PHP, by Lerdorf (the guy who first set the syntax of the language). The book is not that great, but I think that it is the most decent book on PHP programming.
1 person likes this
@babostwick (2036)
• United States
12 Aug 07
You have to put the code within the body tag. It also has to end with a .php extension so that way when opening on the web, it knows its that type of page. That's about the only way I could possibly put it that makes sense considering that it is just a server script language.
1 person likes this
@polemical (199)
• Canada
9 Sep 07
If you want to have a PHP script show HTML output, some simple ways are: include 'filename.html';//this will use the contents of the specified file print 'my text here';//uses whatever you have between the single quotes print 'having \'single\' quotes';//using single quotes in your text print 'having "double" quotes';//using double quotes in your text
• Poland
28 Nov 07
I'd rather use include_once instead of include, since it includes the page only once - and that's what you want to do most of the time. So you won't fall in some nasty neverending loop... Also, you can echo text, just as you do it with print. You can use double quotes instead of single quotes for the string that will be outputed...
• India
13 Aug 07
You can code normally like you code html. For ex. Include tags whenever php code comes. If you want to insert another php or html file, you can use . In other words, if the file you are going to code is having .php extension, you can use html in that file as you want and you can put tags anywhere or everywhere , where you want to put php code. If our answers are not clear for you, say it again here, we will try to help you at the most possible way we can!
@migenKC (792)
• Philippines
14 Aug 07
hehe.. ;) seems like your a web page developer whos willing to help.. how about if ill use java on my html? on what extension file i must save it? can you please PM me about this? thank you