jege Posted January 5, 2012 Share Posted January 5, 2012 Hello. I'm coding myself an small webpage, In the internet you can see that there is pages like index.php?id=223923 <- for example or index.php?=news. So, I'm trying to create similar to that myself. I tried googling and searching youtube how to do this but didn't really find anything. I figured it out that it needs some database etc. I tried myself doing some table in my mysql db. And in the table some 'id, title, content' and in the id would be the url, (index.php?='id') the title would be the <title> </title> and the content would be all the code inside the webpage. I got no idea how to link these to an php or whatever it should be done So would anyone kindly tell me howto do this or give some link to an tutorial? Quote Link to comment https://forums.phpfreaks.com/topic/254412-multiple-pages-mysql-too/ Share on other sites More sharing options...
AyKay47 Posted January 5, 2012 Share Posted January 5, 2012 Hello. I'm coding myself an small webpage, In the internet you can see that there is pages like index.php?id=223923 <- for example or index.php?=news. So, I'm trying to create similar to that myself. I tried googling and searching youtube how to do this but didn't really find anything. I figured it out that it needs some database etc. I tried myself doing some table in my mysql db. And in the table some 'id, title, content' and in the id would be the url, (index.php?='id') the title would be the <title> </title> and the content would be all the code inside the webpage. I got no idea how to link these to an php or whatever it should be done So would anyone kindly tell me howto do this or give some link to an tutorial? if you are storing html inside of your database, don't. To get started, you don't even need a database, whatever is after the ? in a url is called the query string, and contains values to be sent to that page and used with a server side coding language. You might want to start by viewing some basic tutorials on PHP. You can google for this or go to http://php.net/manual/en/tutorial.php which has quite a few good tuts on it. Quote Link to comment https://forums.phpfreaks.com/topic/254412-multiple-pages-mysql-too/#findComment-1304474 Share on other sites More sharing options...
jege Posted January 5, 2012 Author Share Posted January 5, 2012 Thanks, I'm really new to php so I just guessed how it might work Quote Link to comment https://forums.phpfreaks.com/topic/254412-multiple-pages-mysql-too/#findComment-1304485 Share on other sites More sharing options...
jege Posted January 5, 2012 Author Share Posted January 5, 2012 If you are aware of some tutorial for this, I would be more than pleased to get it Quote Link to comment https://forums.phpfreaks.com/topic/254412-multiple-pages-mysql-too/#findComment-1304492 Share on other sites More sharing options...
AyKay47 Posted January 5, 2012 Share Posted January 5, 2012 the link i gave you has several tutorials, and they are from the creators of PHP, can't get any better than that. But if you want to look at more, you can probably google "php tutorials" Quote Link to comment https://forums.phpfreaks.com/topic/254412-multiple-pages-mysql-too/#findComment-1304509 Share on other sites More sharing options...
jege Posted January 5, 2012 Author Share Posted January 5, 2012 When I clicked your link it just gave an webpage with 1 tutorial or so. Ill try it again Quote Link to comment https://forums.phpfreaks.com/topic/254412-multiple-pages-mysql-too/#findComment-1304512 Share on other sites More sharing options...
AyKay47 Posted January 5, 2012 Share Posted January 5, 2012 When I clicked your link it just gave an webpage with 1 tutorial or so. Ill try it again it involves some navigation on your part, but i'll post the other tut. http://www.php.net/manual/en/langref.php really, not tuts, informative documentation rather. Quote Link to comment https://forums.phpfreaks.com/topic/254412-multiple-pages-mysql-too/#findComment-1304536 Share on other sites More sharing options...
jege Posted January 6, 2012 Author Share Posted January 6, 2012 Thanks for your help I managed to do what I wanted with this: if($_GET['site']=='news'){ require ('news.php'); }elseif($_GET['site']=='info'){ require ('info.php'); }elseif($_GET['site']=='location'){ require ('location.php'); }else{ require('index.php'); } I guess there is more ways to do this but this worked for me really easily Quote Link to comment https://forums.phpfreaks.com/topic/254412-multiple-pages-mysql-too/#findComment-1304910 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.