iarp Posted April 30, 2008 Share Posted April 30, 2008 Hey, I finally figured out how to make pages easily editable by storing all the info in a database. Now I'm trying to figure out how to make it so an admin could make a new page. I don't need the coding, if someone could point me in a general direction of where i'd find out how that would be awesome. I don't understand how wordpress and them work when you make a new page... yet it's not physically there. Unless the pages can be accessed by ?p=### then how does one change ?p### to /page-name Link to comment https://forums.phpfreaks.com/topic/103603-solved-using-php-to-create-pages/ Share on other sites More sharing options...
Lumio Posted April 30, 2008 Share Posted April 30, 2008 simple example: index.php?page=test <?php $sql = "SELECT `page_content` FROM `pages` WHERE `page_name` = '".$_GET['page']."' LIMIT 1;"; $res = mysql_query($sql); if (mysql_num_rows($res)) { $row = mysql_fetch_assoc($res); echo $row['page_content']; }else echo 'No page found'; ?> Beware of SQL-Injections. Link to comment https://forums.phpfreaks.com/topic/103603-solved-using-php-to-create-pages/#findComment-530576 Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 They usually use mod_rewrite to make the "nice URLs", but beneath the surface, they are really just ?page=121 or whatever. =) Link to comment https://forums.phpfreaks.com/topic/103603-solved-using-php-to-create-pages/#findComment-530584 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.