Re: forms problem

From: Date: Thu, 04 Jun 2009 03:30:14 +0000
Subject: Re: forms problem
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-293590@lists.php.net to get a copy of this message
On Wed, Jun 3, 2009 at 7:13 PM, PJ <af.gourmet@videotron.ca> wrote: > Tom Chubb wrote: >> 2009/6/3 PJ <af.gourmet@videotron.ca>: >> >>> The code: >>> ...snip >>> <div id="loginbox"> >>>        <form name="login" method="post" action="<? >>> echo >>> $_SERVER['PHP_SELF'] ?>"> >>>            <h2>acc&egrave;s client <br /><input >>> type="text" >>> name="title" value="<? echo $user; ?>" size="10" >>> /><br /> >>>            mot de passe <br /><input type="text" >>> name="title" value="<? >>> echo $passwd; ?>" size="10" /><br /> >>>            <input class="submit" name="submit" >>> type="submit" >>> value="      entrez     " /><br /></h2> >>>            <h2><a href="inscription.php"> Inscription >>> </a></h2> >>>        </form> >>>    </div >>> snip... >>> >>> PROBLEM 1: On Firefox3, the first input (accès client) does not accept >>> any input, does not show the cursor; the second input (mot de passe) >>> works fine. >>> >>> PROBLEM 2: The form does not appear on IE 6 >>> >>> Running FreeBSD 7.1, apache22, php 5, using sessions, CSS >>> >>> Am I doing something wrong? >>> >>> -- >>> Hervé Kempf: "Pour sauver la planète, sortez du capitalisme." >>> ------------------------------------------------------------- >>> Phil Jourdan --- pj@ptahhotep.com >>>   http://www.ptahhotep.com >>>   http://www.chiccantine.com/andypantry.php >>> >>> >>> -- >>> PHP General Mailing List (http://www.php.net/) >>> To unsubscribe, visit: http://www.php.net/unsub.php >>> >>> >>> >> >> I think the first problem is because both your inputs are defined as "title". >> > Does that change anything in the functionanlity? If so, how? > Bastien says it works in IE8; here it does not in IE6. :-) > I'm not sure about functionanlity, but it definitely changes the functionality. ;-) It means that regardless of whether someone is able to enter a value in the field you have labeled "accès client", your PHP page will never see it because it will look at the value from the field you have labeled "mot de passe", even if it is left blank. And that is true regardless of which browser they are using. In some scripting platform other than PHP, or if you process the raw post data yourself it could be different, but in PHP the variable $_POST['title'] will only have one value in it, and it will be the last one passed by the form. (In this case, "mot de passe".) Andrew

« previous php.general (#293590) next »