Imoddedu Posted April 7, 2009 Share Posted April 7, 2009 You know how in some pages it has like www.whatever.com/whatever/whatever.php?id=1345In that ?id=1345How do I get that? Link to comment Share on other sites More sharing options...
zppblood Posted April 7, 2009 Share Posted April 7, 2009 $_GET['id']Prints the value of 1345 on the screen. <?php echo $_GET['id'];?> Link to comment Share on other sites More sharing options...
jlhaslip Posted April 7, 2009 Share Posted April 7, 2009 It is called a Query String and is used to pass data from your page (via a link) to the receiving script. Link to comment Share on other sites More sharing options...
Sanilm Posted April 7, 2009 Share Posted April 7, 2009 you can do it like this: $id = htmlspecialchars($_REQUEST['id']);if($id == 'whatever') { function;} elseif$id == 'other') { function1;}exit;functionwhat it do<input type="hidden" name="id" value="whatever">function1what it do<input type="hidden" name="id" value="other">that's it Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.