Shinyshell Community Forums > Coding >
Confused...


[1]


August 10 02009, 00:44 GMT
Pikachu
Kelp is good!

Pikachu's avatar
Location: California
Post count: 50
us
1. Alright, so I've been chatting with Faltzer, a programmer known by most of the Pokémon community. We were talking about XHTML and he said that since I don't use all the features that XHTML offers, I should switch to HTML 4.1. I'm confused. Should I or not? And what are the tools he mentioned? He also said that XHTML is not supported by any browser.

2. Some Python. I was wondering if Python had something similar to this:
<?php 
$varaible = $_POST['stuff'];

if ($varaible == "") {
echo "varaible is empty!";
}
?>
<?php
$varaible = $_POST['stuff'];

if ($varaible == "") {
echo "varaible is empty!";
}
?>
]]>

______________________________

Linux | Chrome | Python | Chuck

August 10 02009, 00:51 GMT
Peter*
A Pythonic One

Peter's avatar
Location: US
Post count: 99

2 -- I'm pretty sure you have to use CGI to get variables from forms.

**variable lol

August 10 02009, 00:53 GMT
Pikachu
Kelp is good!

Pikachu's avatar
Location: California
Post count: 50
us
No, I know how to do that. I was wondering if you could check if the submitted form has any empty variables.
______________________________

Linux | Chrome | Python | Chuck

August 10 02009, 01:09 GMT
lec**
Supra stultitiam

lec's avatar
Location: Varaždin, Croatia
Post count: 173
hr
1. I don't use all the features C++ offers, so should I switch to BASIC? Nope.

Choosing a suitable document type is something usually up to the designer. As far as I can tell, XHTML is better accepted by web designers, and is currently more widely used. XHTML 1.0 Strict in particular gives off a very "this code is clean and simple" aura.

Of course there are technical differences between HTML and XHTML, but honestly, which one you use really won't have such a substantial effect on your designs or the accessibility of your site. Using one or the other won't make your site either better or worse. XHTML is cleaner and makes the data in that document more easily accessible, which is why I prefer to use it. Faltzer may be fussing over something that's too trivial to have any significant influence, but I really can't guess why he'd suggest reverting to HTML 4.1 (unless your code is particularly broken and doesn't validate).

2. You can check them exactly like that if they're empty.
if forms["id"].value == "": 
print "empty!"
if forms["id"].value == "":
print "empty!"
]]>

To check whether they were provided to the script, use the has_key method.

if not forms.has_key("id"): 
print "it wasn't set"
if not forms.has_key("id"):
print "it wasn't set"
]]>

August 11 02009, 22:30 GMT
Pikachu
Kelp is good!

Pikachu's avatar
Location: California
Post count: 50
us
Okay, thank you very much, electron.
______________________________

Linux | Chrome | Python | Chuck


[1]



Forum Information
  Currently Active Members [detailed] (0 members and ? guests)
-
Forum Statistics
Topics: 0, Posts: 0, Members: 108.
Welcome to our newest member, adamthephantump
Most members online was 5, on August 28 2009, at 21:49:28.
Legend
    Forums with unread topics in them are indicated by a strong yellow colouring around the forum icon.
    Forums with no unread topics have the standard pale yellow colouring around the forum icon.
    Forums with a blue arrow icon will redirect you to a non-forum page.
    Locked forums have a little padlock by their icon. You won't be able to post in these forums.
Shinyshell Home | Contact | Staff List | Archive | Top 

Conventional Login

Don't have an account? You may want to create one.

OpenID Login
OpenID login and registration is usable, but not finished.
What is OpenID?
Search

(advanced search)
Site Stats
  Total members: 108
  Latest member: adamthephantump
  Members currently online: 0
  Most online: 5 - Aug 28, 2009 (21:49)
  Front page hits: 88115
Developer info
  Site version: 3.5 Alpha
  16 queries - 9 templates
Under the Spotlight
Collide Site
Collide make fabulously dreamy electronic-industrial music, they're one of my favourite bands! Give them a chance to take control of your life - myspace | youtube - "Euphoria".

Collide Site - Hits: 4925

5/5 (2) | Rate this site?