Page 1 of 1

PHP output in HTML page

Posted: Sun May 24, 2009 3:17 pm
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.

Re: PHP output in HTML page

Posted: Sun May 24, 2009 3:28 pm
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.

Re: PHP output in HTML page

Posted: Sun May 24, 2009 3:44 pm
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.