PHP output in HTML page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
anand
Forum Commoner
Posts: 80
Joined: Fri May 22, 2009 11:07 am
Location: India
Contact:

PHP output in HTML page

Post by anand »

Hello guys, I need to know something. Can we generate HTML output using PHP ?

Check this site. This is a sample review,

http://www.mouthshut.com/review/Apple_M ... 734-1.html

I am very much sure that this site is PHP based, but then my question is, how is it delivering contents in HTML?

Thanks in advance.
Last edited by anand on Sun May 24, 2009 3:41 pm, edited 1 time in total.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Re: PHP output in HTML page

Post by jayshields »

Don't post in red. PHP is primarily used for producing HTML. Use the echo operator to output whatever you want to the client.

Do you mean the .html extension? That is probably an Apache configuration which is telling it to parse .html files as PHP applications. Some websites do things like this for SEO.
anand
Forum Commoner
Posts: 80
Joined: Fri May 22, 2009 11:07 am
Location: India
Contact:

Re: PHP output in HTML page

Post by anand »

jayshields wrote:Don't post in red. PHP is primarily used for producing HTML. Use the echo operator to output whatever you want to the client.
Edited.

yea, Echo method is common. I meant the .html extension.
jayshields wrote:Do you mean the .html extension? That is probably an Apache configuration which is telling it to parse .html files as PHP applications. Some websites do things like this for SEO.
Okay. I got it. Thanks. This can also be done with .htaccess file. Right.

I thought they did it using .htacess file but if i replace filename with .php , it doesn't open up.

Thanks for clearing the confusion though.
Post Reply