Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

77 users online



Tutorial: GPC variables the good way!

Tutorial: GPC variables the good way!

Currently viewing this thread: 1 (0 members and 1 guests)


Page 3 out of 3
Jeremie

Jeremie

Neversidian
Status: Offline!

Heh it's alright

btw &= is a valid operator. You use it to replace:
$a = $a & $b;
with $a &= $b;

=& isnt an operator, it's just a = followed by a &, you can write
$a = &$b;
and it will do the same thing

___________________

Jeremie - Used to be the Director of Community Development

GPX

GPX

Status: Offline!

I Liked the tutorial Wink
Got some questions - Let's say i use <a href='bla.bla?bla=blat'> , the item would belong to the get array ?
Can i refer to him as a $_GET['bla'] ? cause i used this only for values submited by froms until now ...

2nd question isn't really about tutorial, just wanted to ask what this line means :
$id = ( isset( $_GET['id'] ) ) ? intval( $_GET['id'] ) : 0;
i can understand $id = ( isset( $_GET['id'] ) ) , but what does the "?" mean? and what does the ": 0" means ?

Thanks ! good tut, helped me Smile

___________________

[glow]Cumbaya Milord Cumbaya[/glow]

Phil

Phil

with Mr. Jones
Status: Offline!
Quote:

I Liked the tutorial
Got some questions - Let's say i use <a href='bla.bla?bla=blat'> , the item would belong to the get array ?
Can i refer to him as a $_GET['bla'] ? cause i used this only for values submited by froms until now ...

heres a link to my tut on superglobals and variable scope and stuff - it answers your problem. It covers a wider scope of things then EvilGen's but his goes into more detail, but mine gets the basic point accross.

http://tutorialforums.com/showthread.php?s=&threadid=48722&highlight=$_GET

___________________

http://www.philbrodeur.com - Expert PHP Development and Tutorials

Jeremie

Jeremie

Neversidian
Status: Offline!

and about the $id = ( isset( $_GET['id'] ) ) ? intval( $_GET['id'] ) : 0;

it's only an if-else statement, it's the same as :

if( isset( $_GET['id'] ) )
{
$id = intval( $_GET['id'];
}
else
{
$id = 0;
}

it's way shorter Tongue

___________________

Jeremie - Used to be the Director of Community Development

amplify

amplify

I'm a Neverside Newbie?
Status: Offline!
Quote:

Originally posted by EvilGenius
Heh it's alright

btw &= is a valid operator. You use it to replace:
$a = $a & $b;
with $a &= $b;

=& isnt an operator, it's just a = followed by a &, you can write
$a = &$b;
and it will do the same thing

Yes, I know. I used to be a pro at PHP.

Jeremie

Jeremie

Neversidian
Status: Offline!

PHP is like bike, you dont forget it Grin

___________________

Jeremie - Used to be the Director of Community Development

Page 3 out of 3
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0179 seconds.