I'm pretty new to webpage design. I've been using XHTML and CSS and get the feeling I should learn JavaScript and/or PHP. I understand that JavaScript is used along with XHTML. How about PHP? Is it used with XHTML or instead of? How important is it to know PHP?
As is the case in most of these types of questions, "it depends" on what you want to do. PHP is generally a replacement for HTML/CSS to construct dynamic pages and web-based applications. For me, Javascript is more of a helper to shape what your HTML and CSS does, e.g., pages effects and such.
I'm trying to learn how to format a webpage for handheld devices. I've just barely begun looking into it, but one site I was looking at mentioned 'detecting the user agent string with a server-side language such as PHP'. In further reading I've realized that's not a good option for a small operation like mine. As I've worked my way through many issues in the past year or so, I come across solutions to many problems that involve PHP; but so far I've been able to achieve whatever I'm attempting without it. If it's a replacement for XHTML, I'm not so keen on learning it unless it's a huge improvement over XHTML. Any opinions on that?
PHP is server-side and JavaScript is client side; Learn them both e.g. With PHP you can connect to a database and query records, with Javascript you can interact with the users browser without going back to the server
Like markus said PHP has nothing to do with web design. It's primarily a server-side scripting language. Javascript is a client-side scripting language which can be used to manipulate a website's design. The vast majority of webhosts provide Apache with PHP, so it's the most convenient to learn. There are other options of course from Java and Perl to C++. It depends on the complexity of your needs.
Bah why on earth are people still using XHTML? There's no benefit using it over strict HTML 4.01 and those damn closing tags are just a waste of characters. Not the mention the fact that XHTML is becoming deprecated. It's like people want to make life harder! Who wants to see something funny? Just, why?
I can see I need to get a lot better at searching for threads already in progress. All of a sudden this seems to be a very common topic. Sorry! BRUm . . . don't get mad at me, okay? I'm just a peon . . . but won't HTML 4.01 and XHTML both eventually become deprecated after HTML 5 comes out? I'm using XHTML because I learned it together with CSS in an online course. The impression I got while taking that course was that HTML 4.01 is yesterday, while XHTML is today. I've realized since then that not everyone agrees with that point of view. I don't know enough yet to have a point of view.
You are absolutely correct. Opinions are fine as far as they go, but you should look for either a well-supported opinion or go to an authoritative source with questions like this. Here is a fairly authoritative source on HTML 4.01 v XHTML: http://www.webstandards.org/learn/articles/askw3c/oct2003/
@MaryMach, Hey don't worry, I don't get mad! I just like to be as correct as possible and make sure that the information and advice I give to others is too. HTML4.01 won't be deprecated for a long time because it is the latest standard of HTML that can use a strict doctype, while there is no strict standard for HTML5 and I don't expect to see one for quite some time - if there ever is one. This is why even when HTML5 becomes a strong standard HTML4.01 will still be used by those who may wish to stick to strict markup syntax. I need to dispel a myth: XHTML is not any more strict HTML. If you want to be held by strict validation use HTML with a strict doctype and write the markup in a strict manner. Also, while XHTML was released later than HTML4.01 it doesn't offer anything new in terms of HTML rendering, in fact XHTML1.0 is a reformulation of HTML4.01 in XML. People forget that XHTML is also a subset of XML. By using it you ask for an XML parser - which are very easily broken by the way. Sadly, XHTML is massively misused. There's no problem with using XHTML as long as you use it properly and it seems that ironically even the developers who worked on Digital Point haven't caught on yet. You see if you declare an XHTML doctype, whether transitional or strict, if you then declare a "text/html" content type you're forcing the browser to parse all the markup as HTML, which means the browser ignores all XHTML specific markup and converts it all back to HTML! Can you see how silly this is? Doing this is actually detrimental as it means the browser has to work harder and thus load pages slower because it has to do things like replace closing tags and trailing slashes that don't exist in HTML. My point is, if people are going to use XHTML then follow through with it; declare an XML MIME type (content-type: application/xhtml+xml), encoding (<?xml version="1.0" encoding="utf-8"?>) and namespace (xmlns="http://www.w3.org/1999/xhtml") otherwise you defeat the entire purpose of using XHTML markup wasting all the time you spent doing daft things like <br />. This is what I was getting at in my previous post. The online course you took was wrong in assuming that just because XHTML is newer that is replaces HTML4.01 - they're completely different markups and serve completely different purposes. Why get used to using XHTML syntax when HTML5 will be the next standard? Sure, it supports both but why would you type more than you need? It has also been said that a strict HTML4.01 document is more future proof than an XHTML one, especially one with transitional markup. I found that this nicely explains why so many people use XHTML when there's no real technical need: I apologise if this is a bit much to read but I've been doing some pretty extensive research today and have learned a lot myself
Not to be rude or anything, but this is the same as asking "should I learn Spanish or French?" Well... why? What are you looking to do? If you want to visit Spain, then I'd suggest Spanish. Same with Javascript / PHP. JavaScript, as I understand it, is more for the "design" of websites - fancy interactive stuff, while PHP is more backend, processing stuff.
Thought I’d never have time to get back to this!! I hope you don’t mind . . . I have two or three (or 30) questions, but I’m going to take this a little at a time . . . mainly because my head explodes when I try to take your whole reply in at once. First . . . I’m sure I’ll sound like an idiot here, but this is the first thought I’ve given to declaring a MIME type. The subject did not come up in either the HTML online class I took or XHTML/CSS. So in trying to understand that portion of your reply, I ended up on a W3C page on the subject. They recommend the MIME type you mention ‘application/xhtml+xml’ but go on to admit that it is not supported by IE (up to and including IE8) and so ‘many XHTML files are actually served using the text/html MIME type.’ As much as I hate IE and would never use it (except as one of 5 browsers I check sites on), you can’t just discount IE if you care about traffic. But it does sound screwy to tell a browser your site is written in XHTML+XML but then direct that browser to read it as HTML. You’re right . . . it does sound silly . . . and screwy. But here’s my problem (I think). After taking the class in HTML, I created a webpage for the small business I work for. It looks okay, it’s easy to navigate and customers like it; but the code is a mess. I have a heck of a time figuring out what I did. Then I finished the class in XHTML/CSS and I’m working on another site. I love how clean the code is, how easily I can control the appearance of my page and how easy it is to change it. So . . . . I’m probably going to sound like an idiot again . . . can I use CSS with HTML 4.01 Strict?
Duh . . . no <div> tags . . . talk about not seeing the forest for the trees . . . I guess I'm stuck with strict XHTML until they finish HTML5 . . . at least for the site I'm working on now . . . the tables just got too complicated. BRUm . . . another question your post brought up for me was the encoding. While I was taking that XHTML/CSS class, my site kept validating as correct except 'no character encoding found'. When I brought the question up in the discussion area of the class, the instructor said 'Don't worry about it' !!!!! So I looked around until I found what appeared to be right for strict XHTML . . . <?xml version="1.0" encoding="ISO-8859-1"?> and put that above my <DOC type>. It validates as correct now. My question is, when I tried the utf-8, the validation site didn't like my using ' instead of ' , etc. With the utf-8, do I not need to use those types of codes? Which is better?
God! Is there a level below Peon?! Obviously I didn't know you could use the <div> tag in HTML. I'm going to go away now and try to work out as much as I can based on BRUm's comments re: HTML 4.01 vs. XHTML. Thank you BRUm, MarkusJ_NZ and Ray Baron. Your comments were helpful.
No problem Mary, don't be so hard on yourself. We were all beginners once You referred to tables in your post, do you mean HTML tables for layout? If so, you shouldn't use those. Use CSS. Tables are ancient and deprecated. CSS3 is superior in every way. Here's a tip for you: HTML is a catch all for many types of markups including XHTML. It's best not to think of them as separate. Thinking this way would have prevented you from not realising that <div> tags are allowed in HTML. In fact, HTML supports just about every XHTML because the latter is a subset of HTML. It's good to think of HTML as a tree with HTML4.01 and XHTML as branches. XHTML 1.0 is just a reformulation of HTML4.01 but with XML instead. It may help you're understanding if you read the wikipedia article on XML. CSS is of course supported by all HTML. CSS is used by the browser to style your markup, as far as I'm aware there are no limitations dependant on the particular X/HTML version you use. Hm, telling students no to worry about a raised question is not an answer at all. This usually means they themselves don't have the answer. I'm glad you worked it out. The encoding property of the XML tag just tells the browser which character set to use. For example, the benefit of being English and using the English language is that the character sets UTF-8 and ASCII support all "usual" keyboard characters. However, what about those who use extra characters not in our language? That's where the ISO character set came in and stands for International Organisation for Standardisation followed by the particular number that identifies the character set. These sets contain extra characters that other languages would use allowing the browser to properly display them. Try this for yourself, declare the UTF-8 charset and place some text with non-English characters, they won't display correctly. By the way, the doctype should always come first. Place the charset after it. This is probably because those characters are included in the UTF-8 character set. You can read more about it here: UTF-8
Wish I’d known that a year ago. If you want to see a real mess, google Native Nurseries (the plant nursery I work for in Tallahassee). There are almost fifty pages there that I really need to redesign completely . . . if I can ever find the time. . . . I lOVE CSS! I played around with this on the index page of my current project last night. I switched to UTF-8 and got rid of all the unnecessary special character tags. It still wouldn’t validate though because W3 didn’t like the special character I was using for the copyright symbol. This is what I ended up with and it does validate now. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <head> <meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"> If there’s a problem with using ISO-8859-1, I’d appreciate your feedback. As you can see, I did switch to strict html4.01 (on this page at least for the time being). Then I posted a thread in the HTML & Website Design forum asking for opinions. Your comments about declaring one language to the browsers, but then telling them to convert it to another, make sense to me. Unless someone comes up with a very good reason for using xhtml, I’m convinced. Back to the W3 School and JavaScript . . . . geesh, it ain’t easy!
I'm glad you understand this, you'd be shocked how many of the most popular websites on the internet don't! I dare you to view the source of a wikipedia article. ISO-8859-1 is a very good choice. It's the standard Western character set and so covers European languages and their characters. Unless there's a specific reason, I'd recommend HTML5. Now that we're ending 2012 the browser support is usually very good and so you can save yourself a lot of wasted characters. For instance, the doctype is a nice and easy: <!DOCTYPE HTML> plus the encoding tag is just <meta charset=ISO-8859-1>
PHP is a powerful tool for making dynamic and interactive Web pages. PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP. To learn PHP, at first you have to know about the HTML/XHTML as well as Java Script.
If you are looking to learn user interface design then go for Javascript or probable JQuery will be better choice.