krepepet Posted June 10, 2009 Share Posted June 10, 2009 Hello.. I am totally lost here, I dont have any idea to do it.. I have a system, each time user enter a new data, it will be put into database, and users can view the data in a page.. lets say user key in this data no: 300 title: abc mentor : awie so, users can now click on a new link appear on a page, lets say "300", then it will lead to the page showing the number 300, title abc and mentor awie. the question is, how can i create a page each time users key in new data, i can only think about manually creating new page..but how if users key in 500 data per day? tried to google but cant find suitable phrase to search.. ps : sorry if this is totally noob question, because im a totally lost noob here Quote Link to comment https://forums.phpfreaks.com/topic/161612-solved-creating-a-new-page-according-to-dbase/ Share on other sites More sharing options...
elis Posted June 10, 2009 Share Posted June 10, 2009 You would store the data in the database and pull it based on a key, usually an id. You can either pull the data from the database using $_GET or $_POST, if you're using a form. You said you were using a link, so you'd probably used a sanitized $_GET. More information here: http://www.tizag.com/phpT/postget.php You wouldn't physically create a new page as the amount of space you would waste if you ended up getting thousands of users would be massive. You would create one page and use PHP to dynamically pull information to fill the page based on the key retrieved from the database. Try reading up on PHP before starting; I suggest starting with Tizag's tutorials as PHP.net's information can usually end up going over the heads of people just starting out. Quote Link to comment https://forums.phpfreaks.com/topic/161612-solved-creating-a-new-page-according-to-dbase/#findComment-852802 Share on other sites More sharing options...
krepepet Posted June 10, 2009 Author Share Posted June 10, 2009 You wouldn't physically create a new page as the amount of space you would waste if you ended up getting thousands of users would be massive. You would create one page and use PHP to dynamically pull information to fill the page based on the key retrieved from the database. exactly, but i couldnt explain it in my last post. the "1 page which will pull infos from database" is what i need. will read the tizag first, anyone with anymore idea are welcome to give opinion. thx elis Quote Link to comment https://forums.phpfreaks.com/topic/161612-solved-creating-a-new-page-according-to-dbase/#findComment-852805 Share on other sites More sharing options...
elis Posted June 10, 2009 Share Posted June 10, 2009 Well a simple example would be if you want to pull id 300 from your database, you would do the following: Set your URL as http://www.yoursite.com/yourpage.php?id=300 Then in yourpage.php <?php $id = $_GET['id']; $result = mysql_query("SELECT * FROM yourtable WHERE no = '$id'"); $row = mysql_fetch_array($result); //whatever information you want to be pulled from the database using $row['fieldname']; ?> Above is a very simple generic, not sanitized nor checked version of something of what you would do -- just to point you in the right direction. Quote Link to comment https://forums.phpfreaks.com/topic/161612-solved-creating-a-new-page-according-to-dbase/#findComment-852808 Share on other sites More sharing options...
krepepet Posted June 10, 2009 Author Share Posted June 10, 2009 Well a simple example would be if you want to pull id 300 from your database, you would do the following: Set your URL as http://www.yoursite.com/yourpage.php?id=300 Then in yourpage.php <?php $id = $_GET['id']; $result = mysql_query("SELECT * FROM yourtable WHERE no = '$id'"); $row = mysql_fetch_array($result); //whatever information you want to be pulled from the database using $row['fieldname']; ?> Above is a very simple generic, not sanitized nor checked version of something of what you would do -- just to point you in the right direction. <a href='pullclosednf.php?id=$id'> problem solved..thx very much elis Quote Link to comment https://forums.phpfreaks.com/topic/161612-solved-creating-a-new-page-according-to-dbase/#findComment-852886 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.