Connecting Tech Pros Worldwide Forums | Help | Site Map

HELP: I got a "Parse error" when try to get data from form

Steven
Guest
 
Posts: n/a
#1: Jul 16 '05
I got a "Parse error: parse error in ..." in this line:

if(empty($_POST['ssn']){
.....

But if I fist assign $ssn=$_POST['ssn']; and then if(empty($ssn){ ... it is
working.

Any advice? Thanks in advance.

Reards,
-Steven



Marcus
Guest
 
Posts: n/a
#2: Jul 16 '05

re: HELP: I got a "Parse error" when try to get data from form


So it still isn't working?



Steven wrote:[color=blue]
> The error I got is:
>
> Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
> `T_NUM_STRING'
>
> Thanks.
>
> "Steven" <xueming@attbi.com> wrote in message
> news:oqRLa.61294$R73.8171@sccrnsc04...
>[color=green]
>>I got a "Parse error: parse error in ..." in this line:
>>
>> if(empty($_POST['ssn']){
>>....
>>
>>But if I fist assign $ssn=$_POST['ssn']; and then if(empty($ssn){ ... it[/color]
>
> is
>[color=green]
>>working.
>>
>>Any advice? Thanks in advance.
>>
>>Reards,
>>-Steven
>>
>>[/color]
>
>
>[/color]

Steven
Guest
 
Posts: n/a
#3: Jul 16 '05

re: HELP: I got a "Parse error" when try to get data from form


Thanks !! My first post is a typo (missing the parenthesis ). But I just
make it work by using double quote for ssn:

if(empty($_POST["ssn"])){
....

The single quote will work if I assign the variable first, but won't work if
I don't. But it is working fine now with the double quote... Some kind of
type casting ?

-Regards,
Steven


"Marcus" <JumpMan222@aol.com> wrote in message
news:3EFFE55B.7080007@aol.com...[color=blue]
> So it still isn't working?
>
>
>
> Steven wrote:[color=green]
> > The error I got is:
> >
> > Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or
> > `T_NUM_STRING'
> >
> > Thanks.
> >
> > "Steven" <xueming@attbi.com> wrote in message
> > news:oqRLa.61294$R73.8171@sccrnsc04...
> >[color=darkred]
> >>I got a "Parse error: parse error in ..." in this line:
> >>
> >> if(empty($_POST['ssn']){
> >>....
> >>
> >>But if I fist assign $ssn=$_POST['ssn']; and then if(empty($ssn){ ... it[/color]
> >
> > is
> >[color=darkred]
> >>working.
> >>
> >>Any advice? Thanks in advance.
> >>
> >>Reards,
> >>-Steven
> >>
> >>[/color]
> >
> >
> >[/color]
>[/color]


Closed Thread


Similar PHP bytes