Jump to content

Archived

This topic is now archived and is closed to further replies.

Cell0518

Frustration with a Simple Variable... *SOLVED*

Recommended Posts

I am passing a variable through the url ($_get)
example:
http://www.dslr-photography.com/chk_id.php?id=3
[code]
<?php
//Setup $id
echo "ID CHECKER<br />";
$id == $_get['id'];
echo "Story ID = ".$id;
?>
[/code]

Why is this not working?  I am very frustrated with this simple, stupid problem.  ??? >:( :-[

I've tried $_GET, $_get, 'id', "id".

Share this post


Link to post
Share on other sites
== is equals as in for use in if statements e.g. if (1==1) { echo ('1 is equal to 1') } what you need is just =


[code]<?php
//Setup $id
echo "ID CHECKER<br />";
$id = $_get['id'];
echo "Story ID = ".$id;
?>
[/code]

See how that goes mate :)

Regards
Liam

Share this post


Link to post
Share on other sites
line 4 must be $id = $_GET['id']; not ==

Share this post


Link to post
Share on other sites
Fixed,

Thanks.  I didn't realize you needed both GET and =.

Thanks.

Share this post


Link to post
Share on other sites
try F5 refresh or ctrl + F5 as that link actualy works fine for me :)

liam

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.