Jump to content


Photo

Frustration with a Simple Variable... *SOLVED*


  • Please log in to reply
4 replies to this topic

#1 Cell0518

Cell0518
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts
  • LocationUSA / Japan (US Navy)

Posted 11 August 2006 - 03:52 PM

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

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

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

#2 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 11 August 2006 - 03:55 PM

== 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 =


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

See how that goes mate :)

Regards
Liam
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge

#3 sasa

sasa
  • Staff Alumni
  • Advanced Member
  • 2,804 posts
  • LocationHrvatska

Posted 11 August 2006 - 03:56 PM

line 4 must be $id = $_GET['id']; not ==

#4 Cell0518

Cell0518
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts
  • LocationUSA / Japan (US Navy)

Posted 11 August 2006 - 03:57 PM

Fixed,

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

Thanks.
Chris

#5 shocker-z

shocker-z
  • Members
  • PipPipPip
  • Advanced Member
  • 864 posts
  • LocationNottingham

Posted 11 August 2006 - 03:59 PM

try F5 refresh or ctrl + F5 as that link actualy works fine for me :)

liam
www: www.ukchat.ws | irc: irc.ukchat.ws chan: #blufudge




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users