sean14592 Posted March 29, 2008 Share Posted March 29, 2008 Hi, as you can see im new at php, though i am learning very quickly and just need bit of a start. Basically im creating a site that allows users to add pages in the cpanel. This is the steps they will take: Login-->Cpanel Home--> Click add page--> fill in form with details for that page--> this will then be stored in DB and given a unique ID--> NOW THIS IS THE BIT I DONT GET I need to create a page like http://mysite.com/pages/index.php?[iD] or http://mysite.com/pages/[iD].php I cant see how I can do this, any help that will point me in the right direction would be very, very nice. Cheers Sean Link to comment https://forums.phpfreaks.com/topic/98537-creating-pages-with-id/ Share on other sites More sharing options...
ohdang888 Posted March 29, 2008 Share Posted March 29, 2008 its like this.. index.php?id=5 and on the index.php page, put... <?php function sql_quote($data) { if (get_magic_quotes_gpc()) { $data = stripslashes($data); } return addslashes($data); } $id = sql_quote($_GET['id']); ?> Link to comment https://forums.phpfreaks.com/topic/98537-creating-pages-with-id/#findComment-504318 Share on other sites More sharing options...
MadTechie Posted March 30, 2008 Share Posted March 30, 2008 to get the ID from index.php?id=5 in php is $_GET['id']; so for example echo $_GET['id']; would print 5 to the page theirs no need to filter it, until you know what your doing with it Link to comment https://forums.phpfreaks.com/topic/98537-creating-pages-with-id/#findComment-504463 Share on other sites More sharing options...
sean14592 Posted March 30, 2008 Author Share Posted March 30, 2008 ummm, I still dont fully understand, has anyone got Xfire, msn or Aim? All I need is for some one to explain it once and im done. Cheers Sean Link to comment https://forums.phpfreaks.com/topic/98537-creating-pages-with-id/#findComment-504578 Share on other sites More sharing options...
redarrow Posted March 30, 2008 Share Posted March 30, 2008 look index.php?id=5 id is set to 5 ok $id=$_GET['id'] now varable id is 5 using $_GET['id'] from url...... Link to comment https://forums.phpfreaks.com/topic/98537-creating-pages-with-id/#findComment-504584 Share on other sites More sharing options...
redarrow Posted March 30, 2008 Share Posted March 30, 2008 url http://www.w3schools.com/php/php_forms.asp $_get and $_post Link to comment https://forums.phpfreaks.com/topic/98537-creating-pages-with-id/#findComment-504586 Share on other sites More sharing options...
sean14592 Posted March 30, 2008 Author Share Posted March 30, 2008 I now how to do that, its the matter of creating a duplicate page using a design that I already have. Cheers Sean Link to comment https://forums.phpfreaks.com/topic/98537-creating-pages-with-id/#findComment-504594 Share on other sites More sharing options...
redarrow Posted March 30, 2008 Share Posted March 30, 2008 http://www.tutorialized.com/view/tutorial/Pagination-with-PHP/6925 Pagination Link to comment https://forums.phpfreaks.com/topic/98537-creating-pages-with-id/#findComment-504601 Share on other sites More sharing options...
sean14592 Posted March 30, 2008 Author Share Posted March 30, 2008 ok, cool, this should help. Thanks again Sean Link to comment https://forums.phpfreaks.com/topic/98537-creating-pages-with-id/#findComment-504630 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.