Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #8738

Re: validation of a text box input...

From Salvatore <sal@yojimbo.hack.invalid>
Newsgroups comp.lang.php
Subject Re: validation of a text box input...
Date 2013-03-19 16:13 +0000
Organization Yojimbo NNTP server
Message-ID <kia2rk$8jo$1@yojimbo.hack> (permalink)
References <a00dc856-f0c2-4dda-b972-bb8fc7097ce6@googlegroups.com> <ki7ls2$2cfq$1@yojimbo.hack> <518e6477-8f53-4d84-a138-7d8b54418521@googlegroups.com>

Show all headers | View raw


On 2013-03-18, nag <visitnag@gmail.com> wrote:
> [snip]
> 
> Thanking you.

I see several problems:

1. You aren't stopping anything from happening when the $_GET['agnt']
superglobal is empty. All your script does is echo out an error message:

> if(!empty($_GET['agnt'])){
> $agnt=$_GET['agnt'];
> }else{echo "Enter agents code!";}

2. The "$agnt" variable isn't declared in the right scope. PHP will
probably handle this for you and will only issue you a warning, but you
shouldn't keep the declaration of $agnt in the top of club.php.

3. In your <form> tag, you are setting the action to
"club.php?agnt=$agnt", and your request method is set to "GET". Instead
of forcefully setting the "agnt" request variable in the <form> tag, you
should set it in its respective <input> tag.

-- 
Blah blah bleh...
GCS/CM d(-)@>-- s+:- !a C++$ UBL++++$ L+$ W+++$ w M++ Y++ b++

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

validation of a text box input... nag <visitnag@gmail.com> - 2013-03-18 08:46 -0700
  Re: validation of a text box input... Salvatore <sal@yojimbo.hack.invalid> - 2013-03-18 18:19 +0000
    Re: validation of a text box input... nag <visitnag@gmail.com> - 2013-03-18 16:54 -0700
      Re: validation of a text box input... Salvatore <sal@yojimbo.hack.invalid> - 2013-03-19 16:13 +0000
  Re: validation of a text box input... "J.O. Aho" <user@example.net> - 2013-03-18 20:28 +0100

csiph-web