[WSG] PHP is stopping my page validating as xhtml 1.0 Strict

2004-08-25 Thread Steven Clark
I've got a page with a small logon form, nothing major. It has a couple of 
small hurdles for validating as XHTML 1.0 strict though.

The first is that XHTML doesn't support the name attribute, so of course my 
php that processes this login feature won't work with id instead of name. Is 
there something in PHP that I don't know about? Well in JavaScript I'd just 
have used the id attribute and then getElementById() in the script. But does 
PHP have this ability? Or am I just in a pickle of having to put up with it 
because its the way it is. What is the alternative to using name if you want 
to use PHP?

Secondly, the page won't validate as XHTML 1.0 strict because of something 
in the said php code. Mmmm.

 http://blog.lindenlangdon.com/prototype/
The php code is
  $username = strip_tags(trim($_POST['username']));
   $password = strip_tags(trim($_POST['password']));
if (isset($logon)) // if login is pressed
  {
 // open the database and check if the user 
exists
 include(level/include/dbfuncs.inc);
 $link = connectToDatabase();
 if(!link)
 {
  print pdatabase connection error/p;
  mysql_close($link);
exit();
 }
	 // run a query to get all of the user and password combinations
	 $query = select * from member where  username = \$username\  
password = \$password\;
  $result = mysql_query($query);

	 // if one set matches
   if (mysql_num_rows($result)== 1)
	 {
	 			header(location: level/form/submission.php);  // go to 
submission.php
  }
	 else
	 {
  header(location: index.php);  // go to index.php again
  }
}

---
Any advice on this one would be greatly appreciated thanx. Its got me 
stumped.

Steven Clark
www.nortypig.com
www.blog.nortypig.com
_
All only $4! Get the latest mobile tones, images and logos:   
http://fun.mobiledownloads.com.au/191191/index.wl

**
The discussion list for  http://webstandardsgroup.org/
Proud presenters of Web Essentials 04 http://we04.com/
Web standards, accessibility, inspiration, knowledge
To be held in Sydney, September 30 and October 1, 2004
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**


Re: [WSG] PHP is stopping my page validating as xhtml 1.0 Strict

2004-08-25 Thread Manuel González Noriega
El mié, 25-08-2004 a las 10:39, Steven Clark escribió:
 I've got a page with a small logon form, nothing major. It has a couple of 
 small hurdles for validating as XHTML 1.0 strict though.
 
 The first is that XHTML doesn't support the name attribute, so of course my 
 php that processes this login feature won't work with id instead of name.

name is only deprecated in XHTML for some elements like form, so you
can continue using name in every element within form  without trouble.

 Secondly, the page won't validate as XHTML 1.0 strict because of something 
 in the said php code. Mmmm.

Check this page
http://martin.f2o.org/php/session

-- 
   Manuel trabaja para Simplelógica, construcción web
(+34) 985 22 12 65http://simplelogica.net
escribe en Logicola http://simplelogica.net/logicola/

**
The discussion list for  http://webstandardsgroup.org/

Proud presenters of Web Essentials 04 http://we04.com/
 Web standards, accessibility, inspiration, knowledge
To be held in Sydney, September 30 and October 1, 2004

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



Re: [WSG] PHP is stopping my page validating as xhtml 1.0 Strict

2004-08-25 Thread Natalie Buxton
There is nothing wrong with your PHP, the Validator (just like the
browser) never sees it.

The exact error is:

Line 76, column 146: document type does not allow element input
here; missing one of p, h1, h2, h3, h4, h5, h6, div,
pre, address, fieldset, ins, del start-tag

...=feed55d0090f3055f4e5c6f7553ff5eb / 

The mentioned element is not allowed to appear in the context in which
you've placed it; the other mentioned elements are the only ones that
are both allowed there and can contain the element mentioned. This
might mean that you need a containing element, or possibly that you've
forgotten to close a previous element.

One possible cause for this message is that you have attempted to put
a block-level element (such as p or table) inside an inline
element (such as a, span, or font).

And this is line 76 and your Form:
76:  form action=index.php method=post id=submissionforminput
type=hidden name=PHPSESSID
value=feed55d0090f3055f4e5c6f7553ff5eb /
 77: pUsername/p
 78:   p class=inputfieldinput size=10 type=text
maxlength=13 name=username//p
 79: pPassword/p
 80: p class=inputfieldinput size=10 type=password
maxlength=13 name=password//p
 81: p class=buttoninput class=button type=submit
value=Logon name=logon//p
 82: /form




But, I cannot work out why you are getting that result. Hopefully this
bit of information Ive added for you will help.

On Wed, 25 Aug 2004 08:39:40 +, Steven Clark [EMAIL PROTECTED] wrote:
 I've got a page with a small logon form, nothing major. It has a couple of
 small hurdles for validating as XHTML 1.0 strict though.
 
 The first is that XHTML doesn't support the name attribute, so of course my
 php that processes this login feature won't work with id instead of name. Is
 there something in PHP that I don't know about? Well in JavaScript I'd just
 have used the id attribute and then getElementById() in the script. But does
 PHP have this ability? Or am I just in a pickle of having to put up with it
 because its the way it is. What is the alternative to using name if you want
 to use PHP?
 
 Secondly, the page won't validate as XHTML 1.0 strict because of something
 in the said php code. Mmmm.
 
  http://blog.lindenlangdon.com/prototype/
 
 The php code is
   $username = strip_tags(trim($_POST['username']));
$password = strip_tags(trim($_POST['password']));
 
if (isset($logon)) // if login is pressed
  {
 // open the database and check if the user 
 exists
 include(level/include/dbfuncs.inc);
 $link = connectToDatabase();
 if(!link)
 {
  print pdatabase connection 
 error/p;
  mysql_close($link);
exit();
 }
 
 // run a query to get all of the user and 
 password combinations
 $query = select * from member where  
 username = \$username\ 
 password = \$password\;
   $result = mysql_query($query);
 
 // if one set matches
   if (mysql_num_rows($result)== 1)
 {
header(location: 
 level/form/submission.php);  // go to
 submission.php
   }
 else
 {
   header(location: index.php);  // go to index.php again
   }
}
 
 ---
 
 Any advice on this one would be greatly appreciated thanx. Its got me
 stumped.
 
 Steven Clark
 www.nortypig.com
 www.blog.nortypig.com
 
 _
 All only $4! Get the latest mobile tones, images and logos:
 http://fun.mobiledownloads.com.au/191191/index.wl
 
 **
 The discussion list for  http://webstandardsgroup.org/
 
 Proud presenters of Web Essentials 04 http://we04.com/
 Web standards, accessibility, inspiration, knowledge
 To be held in Sydney, September 30 and October 1, 2004
 
 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
 **
 
 


-- 
--
Freelance Website Designer/Developer
www.pixelkitty.net
www.ausblog.net
**
The discussion list for  http://webstandardsgroup.org/

Proud presenters of Web Essentials 04 http://we04.com/
 Web standards, accessibility, inspiration, knowledge
To be held in Sydney, 

Re: [WSG] PHP is stopping my page validating as xhtml 1.0 Strict

2004-08-25 Thread Lea de Groot
On Wed, 25 Aug 2004 20:06:58 +1000, Natalie Buxton wrote:
 One possible cause for this message is that you have attempted to put
 a block-level element (such as p or table) inside an inline
 element (such as a, span, or font).

Your input tag has to be wrapped by a block element inside the form tag.
DIV is a common choice for this.
FIELDSET is an excellent choice

HIH
Lea
-- 
Lea de Groot
Elysian Systems - http://elysiansystems.com/
Brisbane, Australia
**
The discussion list for  http://webstandardsgroup.org/

Proud presenters of Web Essentials 04 http://we04.com/
 Web standards, accessibility, inspiration, knowledge
To be held in Sydney, September 30 and October 1, 2004

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



Re: [WSG] PHP is stopping my page validating as xhtml 1.0 Strict

2004-08-25 Thread Marc Greenstock
Hi Steven,
Firstly XHTML DOES support the name attribute for input elements, there 
is no other way to parse form data. It appears the problem lies 
elsewhere, not in the PHP code either.

I do recommend removing the PHPSESSID it can cause problems, there is 
plenty of info to remove the url rewriting that is used to ensure a 
session id is parsed when cookies are not available. Obviously using a 
login form you need the session id so I recommend using p3p to ensure 
cookies are employable on default browser settings. There is no other 
alternative if the user switches off cookies altogether though, if a 
user is going to be suborn and turn cookies off, they shouldn't be 
logging into sites anyway.

Marc.
Steven Clark wrote:
I've got a page with a small logon form, nothing major. It has a 
couple of small hurdles for validating as XHTML 1.0 strict though.

The first is that XHTML doesn't support the name attribute, so of 
course my php that processes this login feature won't work with id 
instead of name. Is there something in PHP that I don't know about? 
Well in JavaScript I'd just have used the id attribute and then 
getElementById() in the script. But does PHP have this ability? Or am 
I just in a pickle of having to put up with it because its the way it 
is. What is the alternative to using name if you want to use PHP?

Secondly, the page won't validate as XHTML 1.0 strict because of 
something in the said php code. Mmmm.

**
The discussion list for  http://webstandardsgroup.org/
Proud presenters of Web Essentials 04 http://we04.com/
Web standards, accessibility, inspiration, knowledge
To be held in Sydney, September 30 and October 1, 2004
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list  getting help
**


RE: [WSG] PHP is stopping my page validating as xhtml 1.0 Strict

2004-08-25 Thread Trusz, Andrew


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of Natalie Buxton
Sent: Wednesday, August 25, 2004 6:07 AM
To: [EMAIL PROTECTED]
Subject: Re: [WSG] PHP is stopping my page validating as xhtml 1.0 Strict

The exact error is:

Line 76, column 146: document type does not allow element input
here; missing one of p, h1, h2, h3, h4, h5, h6, div,
pre, address, fieldset, ins, del start-tag

...=feed55d0090f3055f4e5c6f7553ff5eb / 

And this is line 76 and your Form:
76:  form action=index.php method=post id=submissionforminput
type=hidden name=PHPSESSID
value=feed55d0090f3055f4e5c6f7553ff5eb /
 77: pUsername/p
 78:   p class=inputfieldinput size=10 type=text
maxlength=13 name=username//p
 79: pPassword/p
 80: p class=inputfieldinput size=10 type=password
maxlength=13 name=password//p
 81: p class=buttoninput class=button type=submit
value=Logon name=logon//p
 82: /form


But, I cannot work out why you are getting that result. Hopefully this
bit of information Ive added for you will help.

==

It wants fieldset after form and before input.

drew
**
The discussion list for  http://webstandardsgroup.org/

Proud presenters of Web Essentials 04 http://we04.com/
 Web standards, accessibility, inspiration, knowledge
To be held in Sydney, September 30 and October 1, 2004

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**



RE: [WSG] PHP is stopping my page validating as xhtml 1.0 Strict

2004-08-25 Thread Patrick Lauke
As already mentioned, it's due to the url rewriter. You need to
get it to write the session id inside a fieldset, and not directly
in the form.

So: add a fieldset around your form's content and then have a look at
http://uk.php.net/manual/en/ref.session.php#ini.url-rewriter.tags.

As I don't have access to php.ini, and my host doesn't allow
changes to PHP via .htaccess, I've resorted to solving the issue on
a site I was working on directly in PHP, by calling the following at
the start of each page

ini_set('url_rewriter.tags',a=href,area=href,frame=src,fieldset=);

Obviously, if you can get it changed in php.ini, that makes it even less of a pain...

Patrick

Patrick H. Lauke
Webmaster / University of Salford
http://www.salford.ac.uk

 -Original Message-
 From: Steven Clark [mailto:[EMAIL PROTECTED]
 Sent: 25 August 2004 09:40
 To: [EMAIL PROTECTED]
 Subject: [WSG] PHP is stopping my page validating as xhtml 1.0 Strict
 
 
 I've got a page with a small logon form, nothing major. It 
 has a couple of 
 small hurdles for validating as XHTML 1.0 strict though.
 
 The first is that XHTML doesn't support the name attribute, 
 so of course my 
 php that processes this login feature won't work with id 
 instead of name. Is 
 there something in PHP that I don't know about? Well in 
 JavaScript I'd just 
 have used the id attribute and then getElementById() in the 
 script. But does 
 PHP have this ability? Or am I just in a pickle of having to 
 put up with it 
 because its the way it is. What is the alternative to using 
 name if you want 
 to use PHP?
 
 Secondly, the page won't validate as XHTML 1.0 strict because 
 of something 
 in the said php code. Mmmm.
 
   http://blog.lindenlangdon.com/prototype/
 
 The php code is
$username = strip_tags(trim($_POST['username']));
 $password = strip_tags(trim($_POST['password']));
 
 
   if (isset($logon)) // if login is pressed
 {
// open the database 
 and check if the user exists

 include(level/include/dbfuncs.inc);
$link = connectToDatabase();
if(!link)
{
 print 
 pdatabase connection error/p;
 
 mysql_close($link);
   exit();
}
 
// run a query to get 
 all of the user and password combinations
$query = select * 
 from member where  username = \$username\  
 password = \$password\;
$result = mysql_query($query);
 
 
// if one set matches
  if (mysql_num_rows($result)== 1)
{
   
 header(location: level/form/submission.php);  // go to 
 submission.php
}
else
{
header(location: index.php);  // go to 
 index.php again
}
   }
 
 ---
 
 Any advice on this one would be greatly appreciated thanx. Its got me 
 stumped.
 
 Steven Clark
 www.nortypig.com
 www.blog.nortypig.com
 
 _
 All only $4! Get the latest mobile tones, images and logos:   
 http://fun.mobiledownloads.com.au/191191/index.wl
 
 **
 The discussion list for  http://webstandardsgroup.org/
 
 Proud presenters of Web Essentials 04 http://we04.com/
  Web standards, accessibility, inspiration, knowledge
 To be held in Sydney, September 30 and October 1, 2004
 
  See http://webstandardsgroup.org/mail/guidelines.cfm
  for some hints on posting to the list  getting help
 **
 
 
**
The discussion list for  http://webstandardsgroup.org/

Proud presenters of Web Essentials 04 http://we04.com/
 Web standards, accessibility, inspiration, knowledge
To be held in Sydney, September 30 and October 1, 2004

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list  getting help
**