Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 26th, 2003, 01:59 PM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 5 page 150 - Wondering why....

In the last part of loan2.html the code reads...

"How much do you want to pay a month?
<INPUT NAME=Month TYPE=text SIZE=5>"

Why are there no quote marks around Month? It seems to work either way (with or without the quote - I tried), but in earlier examples of naming user data input, quote marks are put around the name. Does it matter whether or not I use quotes?
Seems like it should. Any help is appreciated. Thank you!



Reply With Quote
  #2 (permalink)  
Old July 26th, 2003, 02:34 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 5 Times in 5 Posts
Default

It doesn't matter if you are using a loose HTML interpreter 'Docutype' setting. Like 'Transitional'. If you want to be strictly HTML 4.01 compliant or XHTML compliant then the statement should be written like this:

<input type="text" name="month" value="" size="5" />

Each value should be enclosed within quotes, you should stick to all lowercase letters (future versions of HTML are going to be case-sensitive). And use a slash to close the tag for tags which have no opening AND closing tag already (for XHTML compliance). The XHTML standard states that all tags must have both an opening and closing tag and uses the slash method as a shortcut for tags which do not already have a closing tag like (br, img, input, meta, etc.).

Even if you consider yourself to be pretty HTML savvy, it wouldn't hurt to pick up a copy of wrox's HTML 4.01 book, which has loads of information about the docutype setting and pretty much tells all there is to know about HTML and where its going. I was very pleased with the book. It helped me to understand a lot of the nuisances between browsers.

My advice is don't be lazy! Get used to the standards now! This will guarantee that your code won't break on future browser releases.

: )
Rich



:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::
Reply With Quote
  #3 (permalink)  
Old July 26th, 2003, 02:42 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 5 Times in 5 Posts
Default

Oh and single name attributes should be written as name, value pairs,

Like so:

<select size="4" name="my_select" multiple="multiple">
<option value="my_value">My option text</option>
</select>

The old way of writing this was:

<select size=4 name=my_select multiple>
 <option value=my_value>My option text
</select>

This is very sloppy and should be avoided! It takes just a few extra keystrokes to do this to standards compliance. The second example should by all rights break under a strict docutype setting.

: )
Rich



:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::
Reply With Quote
  #4 (permalink)  
Old July 27th, 2003, 12:05 AM
Registered User
 
Join Date: Jul 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for the prompt response Rich!

Best,
Karen

Reply With Quote
Reply


Thread Tools
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
More than 150 Ajax links ajax JSP Basics 2 January 20th, 2007 01:46 AM
Wondering how I'd go about doing this Smythe Classic ASP Basics 8 July 20th, 2006 08:28 AM
Wondering why .UDL for connecting string shailu BOOK: Beginning ASP 3.0 3 May 17th, 2005 07:39 AM
VB.net 2K3 Ch. 5 Confusion page 150 ralphtrent BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 5 June 9th, 2004 12:30 PM
CH5 pg 150 While Loops wadesmart BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 11 November 8th, 2003 03:51 PM



All times are GMT -4. The time now is 08:22 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.