RE: syntax question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> Daniel, the '<>' syntax is perfectly valid PHP, 

Is it really?  I didn't know that.  (I didn't believe it either, but going
to the PHP documentation confirms that is correct.  :O )

> plus you haven't
> actually
> answered the question.

Guess I read too much into it...  I presumed it wasn't working.  :(

> If you supply a parameter in the URL, i.e.
> 'www.mysite.com/geocountry=uk'
> then information is made available in an array called '$_REQUEST'.

Wouldn't that be 'www.mysite.com?geocountry=uk' ? or is this another format
that I just haven't seen?

> The specific parameter is accessed using the key name, in this case
> 'geocountry'.
> 
> So, the statement is saying, did a parameter called geocountry get
> passed in
> the URL. If it was, then load it into a session variable called
> 'geocountry'
> and 'geocountryId' :-
> 
> if ($_REQUEST["geocountry"] <> "") {
> 	$_SESSION['geocountry']= $_REQUEST["geocountry"];
> 	$_SESSION['geocountryId']=$_REQUEST["geocountry"];
> }
> 
> 
> As Daniel pointed out, you should also use isset() to avoid a PHP
> warning
> message, and is also better programming.
> 
> Rob.


-D. Israel
dan@xxxxxxxx
http://www.customcodebydan.com 
AIM: JudoDanIzz


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux