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 "<p>database 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
******************************************************



Reply via email to