--- YOGESH ROMANTIC <[EMAIL PROTECTED]> wrote:

> Hello Sir,
>  
> Thanks for sending me right code for form handler for blank text box but i
> have follwing error...message after clicking on submit button.
> Parse error: parse error, unexpected '{' in c:\inetpub\wwwroot\find.php on
> line 8
>  
> .....and the PHP code is this------->
>  
> code:-
>  
> <?php 
> if ((is_array($_POST)) && isset($_POST['submit'])) 
>  {
> if (!isset($_POST['name']) 
> {
> $err = 1; $errmsg[] = "Please enter your name";
> }
>    else
>  {
> $name = addslashes($_POST['name']);
>  }
>  }
>   after run the html file witout entered the text i have clicked on submit
> button then above error message i have got so plz help me for it, guide me
> for it plz.
>  
> Thanks 
> Yogesh.


You can save yourself a lot of grief by structuring your indents for each code
block (see below)

However, in this case, your problem is in the second IF statement on line 3 (or
4) where you have two left parens and only one right paren.

Also, in your first IF statement you have some misplaced parens as well.

I would note that $_POST as a superglobal will always be defined and always be
an array so the first half of the first IF is always true in a web server
environment (might be different in the command line environment).

Depending on your server configuration, you should not need to ADDSLASHES() if
magic_quotes_gpc is on.  It may be well to check this value in your program
before indiscriminantly adding slashes since you could end up doing it twice if
it is on.  Many servers have magic_quotes_gpc on to affect the input of GET,
POST, and COOKIE input values.

James
_____

<?php 
if (is_array($_POST) && isset($_POST['submit'])) 
{
 if (!isset($_POST['name'])) 
 {
  $err = 1; 
  $errmsg[] = "Please enter your name";
 }
 else
 {
  $name = addslashes($_POST['name']);
 }
}
?>



Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


Reply via email to