DrearNevada Posted December 2, 2013 Share Posted December 2, 2013 Hi Guys, I am really new person to all this and working on my semester project, so don't mind if my question is a little childish or off topic. Here is what I want my website to do: An admin Input the data from admin panel in the form for example title, description, a picture and a new webpage is created dynamically which will title as the title of webpage, show the picture and description where I want it to......kind of like facebook where you just click on the "create new event" link and it asks for the Name of the event and a new webpage is created with your event name as the title etc. (Sorry can't think of any other example) Does it require any additional knowledge like XML or javascript?Oh! and thanks in advance :-) Quote Link to comment https://forums.phpfreaks.com/topic/284433-noob-tell-me-what-to-do/ Share on other sites More sharing options...
Solution requinix Posted December 2, 2013 Solution Share Posted December 2, 2013 Nope, nothing fancy. All you need is a database to store the information and a little PHP to add stuff and to show stuff. Start by writing the admin page without any database interaction to the point where you have the information you want (title, description, and uploaded picture) into variables. Then write the "show" page to the point where you start with variables with that data (you'll get those from the database later) and outputs the page how you want it. Note that you never actually create a "new webpage". You don't make a file for every event but instead have URLs like "showevent.php?id=123"; that ID tells showevent.php what event information (from the database) to show on the page. If you want a fancier URL, like "event/example-event-123", that can happen easily later. Quote Link to comment https://forums.phpfreaks.com/topic/284433-noob-tell-me-what-to-do/#findComment-1460904 Share on other sites More sharing options...
DrearNevada Posted December 4, 2013 Author Share Posted December 4, 2013 Sorry for late replying but Thanks for telling me about it......Would I be using $_GET to do this stuff??? Quote Link to comment https://forums.phpfreaks.com/topic/284433-noob-tell-me-what-to-do/#findComment-1461230 Share on other sites More sharing options...
paddy_fields Posted December 4, 2013 Share Posted December 4, 2013 Yes, you will use $_GET. So for example if your page id was '123' your url will be 'mypage.com/page.php?id=123' Then you would use $_GET to pull the id from the URL... $pageId = $_GET['id']; ... and using MySQL you would then look up in the database all of the details associated with the id '123' , with a query such as below; SELECT * FROM mytable WHERE `id` = '$pageId' Quote Link to comment https://forums.phpfreaks.com/topic/284433-noob-tell-me-what-to-do/#findComment-1461232 Share on other sites More sharing options...
DrearNevada Posted December 4, 2013 Author Share Posted December 4, 2013 Awesome....Thanks paddyfields Quote Link to comment https://forums.phpfreaks.com/topic/284433-noob-tell-me-what-to-do/#findComment-1461233 Share on other sites More sharing options...
paddy_fields Posted December 4, 2013 Share Posted December 4, 2013 (edited) Note that you will need to read up on techniques to avoid SQL injection, as what I've suggested above is open to abuse if the GET value is not escaped correctly. Preferably learn mysqli or PDO, and read up on the use of prepared statements. Edited December 4, 2013 by paddyfields Quote Link to comment https://forums.phpfreaks.com/topic/284433-noob-tell-me-what-to-do/#findComment-1461234 Share on other sites More sharing options...
DrearNevada Posted December 4, 2013 Author Share Posted December 4, 2013 thanks but I am just doing the project on the semester scale....may be when I am more experienced and want to publish it online Quote Link to comment https://forums.phpfreaks.com/topic/284433-noob-tell-me-what-to-do/#findComment-1461235 Share on other sites More sharing options...
paddy_fields Posted December 4, 2013 Share Posted December 4, 2013 Good luck Quote Link to comment https://forums.phpfreaks.com/topic/284433-noob-tell-me-what-to-do/#findComment-1461236 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.