Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Does PHP need the HTML, HEAD, and BODY tags?
Old 05-24-2010, 05:34 PM Does PHP need the HTML, HEAD, and BODY tags?
ericson3000's Avatar
Experienced Talker

Posts: 40
Name: Bob Davis
Location: Los Angeles, CA
Trades: 0
If I'm writing a page that only contains PHP and no HTML (like a page called from a form that sends and email), do I need the HTML, HEAD, and BODY tags?

Or can I just start and end the page as so:

<?php
... content
?>
ericson3000 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-24-2010, 05:40 PM Re: Does PHP need the HTML, HEAD, and BODY tags?
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
Short answer:
No

Long answer:
PHP and HTML are only related in that HTML is commonly (but not necessarily) the output of a PHP script.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Old 05-25-2010, 03:01 AM Re: Does PHP need the HTML, HEAD, and BODY tags?
ericson3000's Avatar
Experienced Talker

Posts: 40
Name: Bob Davis
Location: Los Angeles, CA
Trades: 0
Thanks for the info. Appreciate it.
ericson3000 is offline
Reply With Quote
View Public Profile
 
Old 05-27-2010, 04:19 PM Re: Does PHP need the HTML, HEAD, and BODY tags?
Average Talker

Posts: 20
Trades: 0
If you want it to be valid HTML yes lol.. TO display something on the screen no..
__________________

Please login or register to view this content. Registration is FREE
- Awesome Price, Awesome Support, Awesomely Awesome...


Please login or register to view this content. Registration is FREE
- Web Development, E-Commerce, SEO, SMM, CMS's
holmessph is offline
Reply With Quote
View Public Profile
 
Old 05-30-2010, 05:19 PM Re: Does PHP need the HTML, HEAD, and BODY tags?
mad_willsy's Avatar
Super Spam Talker

Latest Blog Post:
R&R Catering Hire Testimonial
Posts: 805
Name: Will Craig
Location: Cheltenham, Gloucestershire, UK
Trades: 0
If the output is a HTML webpage then HTML output of the PHP file needs the HTML HEAD and BODY tags, not PHP.

For example you may have a PHP file to be 'pinged' by a payment gateway with the status of the payment. This file would most likely have no output for security reasons and therefore not have to have a HTML, HEAD or BODY tag.
__________________
Wont :P

Please login or register to view this content. Registration is FREE
mad_willsy is offline
Reply With Quote
View Public Profile Visit mad_willsy's homepage!
 
Reply     « Reply to Does PHP need the HTML, HEAD, and BODY tags?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.21010 seconds with 12 queries