All web pages are in HTML format - that's the language of the web. PHP is a way of adding dynamic content to HTML, so PHP pages are better in that they can do more.
You can paste PHP scripts into a web page. The scripts have to be marked off by at the end. On most systems you also have to name your file with a .php extension so the server will know to look for the code.
2007-02-05 06:00:35
·
answer #1
·
answered by injanier 7
·
0⤊
0⤋
HTML and PHP are two different languages. They have different uses. HTML is a client side language which will render a static page on the client computer. PHP is a server side scripting language which can deliver dynamic web content to a client computer. PHP is a language which can communicate with the server to provide connections to the database, a mail server and host of other services to deliver content to the web page.
One is neither better or worse than the other... they server different functions.
Most web sites or hosting services will be able to render html pages. If you want to use PHP scripts, you would need to make sure that the hosting service supports PHP. PHP is one of the languages of choice to connect with a database [such as mysql] to store things such as email addresses or phone numbers.
You can not normally just cut and paste a PHP script into an HTML document. You need to have a .php page for the page to render the PHP script on the webpage.
2007-02-05 07:11:30
·
answer #2
·
answered by Thomas H 3
·
0⤊
0⤋
You use PHP in conjuntion with HTML. You use HTML to format and display your content, PHP for any coding (data retrieval, in your case). You paste the PHP code into your HTML pages like:
// PHP Code here
?>
If you're going to be displaying clients' personal data, make sure you have a login page so the data can't be displayed to anyone else.
2007-02-05 05:30:22
·
answer #3
·
answered by rongee_59 6
·
0⤊
0⤋
HTML is a lot simpler and easier to use, not to mention PHP can have a lot of loopholes that require patches on the code. And yes the two can be intertwined. Just like how you have a HTML site with a forum, which is php.
2007-02-05 05:26:30
·
answer #4
·
answered by dustinh456 4
·
0⤊
0⤋
HTML is the design. PhP is for data, not design. If you are going to use PhP, the page needs to have a .php extension, not .htm.
I use a lot of PhP on my website. I use it to get info from a database and then display it. Kinda like this...
//Get info from database
$sql=("SELECT * FROM tablename");
$query=mysql_query($sql);
while($row=mysql_fetch_array)
{
//Display info
$row[Name]
}
This will display all the 'Names' from the database.
If you will be displaying a lot of data that changes, names added, removed, edited, etc, then it would be better to use PhP because you would not have to wade through the page to find the name.
If you need more help, contact me at http://www.yuchniuk.com
2007-02-05 05:30:41
·
answer #5
·
answered by Yuchniuk Website Design 3
·
0⤊
0⤋
it would not count number what you take advantage of. you ought to layout your information superhighway web site so as that curiously an identical. in case you've been a good own living house web page programmer, then you fairly can make it so that you do not ought to rewrite the finished html everytime. CSS isn't waiting to make each and every thing look an identical except you hyperlink it for your html code, meaning you ought to write that besides.
2016-11-02 09:43:46
·
answer #6
·
answered by Anonymous
·
0⤊
0⤋