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? Link to comment https://forums.phpfreaks.com/topic/32128-solved-a-php-file-question/ 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] Link to comment https://forums.phpfreaks.com/topic/32128-solved-a-php-file-question/#findComment-149076 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? Link to comment https://forums.phpfreaks.com/topic/32128-solved-a-php-file-question/#findComment-149082 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. Link to comment https://forums.phpfreaks.com/topic/32128-solved-a-php-file-question/#findComment-149085 Share on other sites More sharing options...
forumnz Posted December 29, 2006 Author Share Posted December 29, 2006 What would you call it? Link to comment https://forums.phpfreaks.com/topic/32128-solved-a-php-file-question/#findComment-149086 Share on other sites More sharing options...
trq Posted December 29, 2006 Share Posted December 29, 2006 Passing variables via url. Link to comment https://forums.phpfreaks.com/topic/32128-solved-a-php-file-question/#findComment-149091 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 Link to comment https://forums.phpfreaks.com/topic/32128-solved-a-php-file-question/#findComment-149092 Share on other sites More sharing options...
forumnz Posted December 29, 2006 Author Share Posted December 29, 2006 Thanks all! Link to comment https://forums.phpfreaks.com/topic/32128-solved-a-php-file-question/#findComment-149093 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.