forumnz Posted December 29, 2006 Share Posted December 29, 2006 what does this mean when a certain website has used this for each pagewww.thisisanexample.com/?id=10&cat=2www.thisisanexample.com/?id=3&cat=6all of the pages has this... what has the person done to do this? Quote Link to comment Share on other sites More sharing options...
marcus Posted December 29, 2006 Share Posted December 29, 2006 They could be using a mySQL database or just files.Basically if they used a mysql database it would be something like:[code]$id = $_GET['id'];$cat = $_GET['cat']; if(!isset($id)){ $id = 1; } if(!isset($cat)){ $cat = 1; }$sql = "SELECT * FROM `pages` WHERE `pageid` =$id AND `cat` =$cat";$res = mysql_query($sql) or die(mysql_error());$row = mysql_fetch_assoc($res);echo "page title: $row[title]<br>author: $row[author]<br><br>\n";echo "contents: $row[pagecontents]";[/code] Quote Link to comment Share on other sites More sharing options...
forumnz Posted December 29, 2006 Author Share Posted December 29, 2006 Thanks,Where can I get a tutorial on this? Quote Link to comment Share on other sites More sharing options...
trq Posted December 29, 2006 Share Posted December 29, 2006 I think that simple example is probably as good as you'll get, its not really a huge subject. Quote Link to comment Share on other sites More sharing options...
forumnz Posted December 29, 2006 Author Share Posted December 29, 2006 What would you call it? Quote Link to comment Share on other sites More sharing options...
trq Posted December 29, 2006 Share Posted December 29, 2006 Passing variables via url. Quote Link to comment Share on other sites More sharing options...
corbin Posted December 29, 2006 Share Posted December 29, 2006 It's using the $_GET variable... So research $_GET and maybe $_POST a little and then look up some php and mysql interaction stuff. You should be able to figure it out from that :p Quote Link to comment Share on other sites More sharing options...
forumnz Posted December 29, 2006 Author Share Posted December 29, 2006 Thanks all! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.