Jump to content
xisto Community
habbovalley

Php Or Html? which do you use?

Recommended Posts

Html is much easier for websitei use html for my web template and its too easy i can say it and i'm using dreamweaver so that much easier because they have auto html its just like if you put anything img or you click something then tata there's the code for the templates

Share this post


Link to post
Share on other sites

I know a bit of html and a tad of php (Syntax, Variables, Echo, Strings and Operators) but when I do learn both quiet well, I will probably use php as most good looking websites I have seen use Php (and also html too i guess). So I'd probably use both actually.

Share this post


Link to post
Share on other sites

Well being a HTML its easy for me but what do people use the most?Is it HTML or PHP.
It depends really on which you learnt first.
So im gonna have a poll.Post HTML for Html and PHP for php and we will see which is more popular.


This is very strange comparisson and I would say that you cannot compare it in such a way because PHP is scripting language and HTML is markup language (HTML is abbreviation for the hyper text markup language).

So this is really strange comparisson. You should first consider in which situation you would like to use each and just to add if you use HTML you can create web site but you cannot create web site without HTML that is you can but it would be really ugly and it would be able to present just some simple outputs. Though there are many other things that you cannot do with HTML that is why you use PHP.

Also I would like to add that PHP is language that is being executed on the server that is on the server side, while HTML is client sided that is HTML is processed and executed on the client side that is Browser is defining and executed commands from HTML file.

And someone said here that he has problems that his or hers pages aren't cashed in google cash this is not problem with HTML and PHP and certainly not with google problem lyies in simple thing that pages that use also PHP are not static and that is why google doesn't remembers them.

Share this post


Link to post
Share on other sites

I do a mixture of both really. Html to set out the site and just php scripts for stuff which requires me to connect to my sql database and display information. For the html I do mostly <div> with the class from my css stylesheet. For the php scritping, mostly connecting to mysql and displaying data. I really ought to learn more php. I personally vote for Php scritping though, alot more advanced and gives a better feel to the site. Which always changes depending on whats happening to the site.

Share this post


Link to post
Share on other sites

Php or HTML? It's not like you have a choice without HTML. What are you going to use on the web if you're not using HTML?
Php with HTML, yes, that's a great combination. I generally make snippets of code in HTML and unite them using PHP includes/requires. Thats' a great way to develop websites. You can use and reuse your code a lot of times using Php includes and require commands.
If you want to find out how they work, well you can go to http://www.w3schools.com/php/ and read about them. It's really very simple as far as includes and requires are concerned.

Share this post


Link to post
Share on other sites

In the case of PHP, you cant use one without the other, the PHP has to output HTML.I always make my sites in PHP, even static ones. i leave some spare variables for headers ect, i can pass data to it if I need to, that way, i can refer people to my site, with a cookie, or information stored in the URL, to do things like, display a link back the referrer site etc.Also, tat way, if I decide I want to add interactivity to it, I can, without having to re-design the site.

Edited by minimcmonkey (see edit history)

Share this post


Link to post
Share on other sites

In the case of PHP, you cant use one without the other, the PHP has to output HTML.

Not quite... You could also output an image with the appropriate headers :lol:

Share this post


Link to post
Share on other sites

I think a good combination of the two would be a good idea, depends what you're doing.

 

HTML for starters, if you're good at scripting then use PHP. Im new at PHP, so it looks confusing to me. People that know how to use PHP say that it is only a little bit confusing.

 

For now, i'll stick to HTML, and then I'll probably steal a couple of scripts :lol:

Share this post


Link to post
Share on other sites

If you don't need to generate anything at server side, then simple HTML is enough. And simple HTML page will be lot more faster because it don't need any server processing. When some browser requested a HTML page the server will directly give that page to the browser. So usually its faster than PHP. But if you want more interactivity with the user or want to put login pages etc...then you need PHP. Simply, You need PHP when you want to generate some content server side. Else HTML is enough. But PHP will give more control over your page. And PHP is not that much hard to learn.

Share this post


Link to post
Share on other sites

Indeed it is such u always have to use html.... php is only to make dynamic websites add special functions and html are the design! exampler

<?php$bgc = $_GET['bgc'];if($bgc == "black"){$clr="white";}else{	$clr="black";	}$ip=$_SERVER['REMOTE_ADDR'];?><html><head>  <title><?phpecho "The color is $bgc !!";?></title><link rel="shortcut icon" href="image/favicon.ico" ></head><body style="background-color:<?php echo $bgc; ?>"><li style="color:<?phpecho"$clr";?>;"><a href="frame.php?bgc=black" >black</a>  </li><br /><li style="color:<?phpecho"$clr";?>;"><a href="frame.php?bgc=white" >White</a>  </li><br /><?phpecho $ip;?>

wich lets u change background and the visitor can see his ip :lol:

Share this post


Link to post
Share on other sites

for me I use both.. you can't use php alone, well heck you can but it is much easier to integrate PHP with HTML.. just like integrating HTML with CSS... and integrating PHP with HTML is much cleaner (in terms of the code itself) than using just PHP alone..

example:

<?phpecho '<html><body><a href="domain.com/login.php?user=' . $userID . '" /></body></html>';?>

instead you can just do:
<html><body><a href="domain.com/login.php?user=<?php echo $userID; ?>" /></body></html>

and using html alone will not suffice the needs of modern websites that is already integrated with PHP.. you can't have a login page without a PHP and MySQL..

Share this post


Link to post
Share on other sites

If there wasn't HTML,how PHP will work?PHP is server-side language which usually prints all data got from MYSQL,Oracle,text files etc. etc....But if you think do we want to use PHP,you should change your title :P Normally that there are kinds of websites.If you want to make interactive website like Google,MSN or Yahoo you will need to use PHP or other server-side languages.But because the best sites like Trap,Google,MSN or whatever,they need to use server-side scripting to store and search data from bases,to calculate.I think this forum is using PHP...

Share this post


Link to post
Share on other sites

I personally don't use PHP because I don't know it, although I hear that it's not that hard at all. I'm wanting to learn it and maybe sometime I will sit down and take the time to learn it and learn how to implement it on my site. I use just plain old HTML and CSS for my site. I know both so that just makes it easier on me, although I admit, there are some downsides to using only HTML. My site is static anyway, I don't really intend for it to be interactive, but if the day ever comes that I do want something more dynamic, I would definitely learn and start implementing PHP. I know a static site is very pre-modern but I think there are a lot of sites still on the web that still have that appeal. As long as it's not blinding you with bright colors and annoying GIFs, then it's all good, right? :PHowever, (X)HTML will never be obsolete, at least not the way I see it. HTML is the very basis of the web, the language that tells our browsers what to put up on our screens. Of course we'll always need it and like many others said, you can use all the advanced scripting and coding you want, you will always need HTML to help browsers render a site properly. Unless you want to take the long way around, that is. :P

Share this post


Link to post
Share on other sites

I personally don't use PHP because I don't know it, although I hear that it's not that hard at all. I'm wanting to learn it and maybe sometime I will sit down and take the time to learn it and learn how to implement it on my site. I use just plain old HTML and CSS for my site. I know both so that just makes it easier on me, although I admit, there are some downsides to using only HTML. My site is static anyway, I don't really intend for it to be interactive, but if the day ever comes that I do want something more dynamic, I would definitely learn and start implementing PHP. I know a static site is very pre-modern but I think there are a lot of sites still on the web that still have that appeal. As long as it's not blinding you with bright colors and annoying GIFs, then it's all good, right? :P

 

However, (X)HTML will never be obsolete, at least not the way I see it. HTML is the very basis of the web, the language that tells our browsers what to put up on our screens. Of course we'll always need it and like many others said, you can use all the advanced scripting and coding you want, you will always need HTML to help browsers render a site properly. Unless you want to take the long way around, that is. :P

PHP is simple programming language.Take a look at http://www.w3schools.com/ and you will see.The syntax of PHP is similar like C (sorry if you don't know it) and PHP is not like HTML.HTML is not programming language,but JavaScript in HTML is.I need to post simple script,just to see how much is simple

Hello!This is my website.It can generate random number from 0 to 20:<?php$random=rand(0,20);echo $random;?> <br>Nice,ahh?
You see,it is so simple,just you need to know that before every variable you should add dollar("$").About br tag,you should know it because you said you know HTML.That is all.You can use PHP combined with HTML.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.