topflight Posted October 13, 2008 Share Posted October 13, 2008 How can I make pages so that it the url is like ?=. Also is their a big reason why I should or shouldn't do that? Becuase in the futrure I want to make profile pages so that users can view their profile and I know in order to do that I need to have ?= correct. So suggestions are welcome. Thanks in Advanced Quote Link to comment https://forums.phpfreaks.com/topic/128212-pages/ Share on other sites More sharing options...
Maq Posted October 13, 2008 Share Posted October 13, 2008 How can I make pages so that it the url is like ?=. What exactly do you mean? Are you asking how to use the $_GET method. In that case you just create a link with the variables attached on the end like: www.mysite.com/index.php?var1=abc123 Quote Link to comment https://forums.phpfreaks.com/topic/128212-pages/#findComment-664021 Share on other sites More sharing options...
topflight Posted October 13, 2008 Author Share Posted October 13, 2008 Well in order to create a profile page for each user is that what I need to use? Quote Link to comment https://forums.phpfreaks.com/topic/128212-pages/#findComment-664051 Share on other sites More sharing options...
trq Posted October 13, 2008 Share Posted October 13, 2008 This example may help you. Quote Link to comment https://forums.phpfreaks.com/topic/128212-pages/#findComment-664053 Share on other sites More sharing options...
Maq Posted October 13, 2008 Share Posted October 13, 2008 Well in order to create a profile page for each user is that what I need to use? All that you really need to use is their unique identifier whether it be their ID, name, email etc. because that's what you'll need to use to look up that person in the DB and pull out their information. Thorpe has an excellent example that uses basic concepts for you to use. Quote Link to comment https://forums.phpfreaks.com/topic/128212-pages/#findComment-664060 Share on other sites More sharing options...
topflight Posted October 13, 2008 Author Share Posted October 13, 2008 Great example thorpe. What I am currious is about some links has www.mysite.com/?=seahub what does that question mark mark and equal mark means. And is it a good think for use? Also if I do create that will I have to create less pages? (i.e I have 4 rosters one for group A,B,C,D) Each group has a a certain amount of members in that group now inorder to show the roster for that indivual group will I have to create a whole new page or just use ?= and it will create and only show members in that certain group?) Sorry if I sound confusing. Quote Link to comment https://forums.phpfreaks.com/topic/128212-pages/#findComment-664079 Share on other sites More sharing options...
mrMarcus Posted October 13, 2008 Share Posted October 13, 2008 Great example thorpe. What I am currious is about some links has www.mysite.com/?=seahub what does that question mark mark and equal mark means. And is it a good think for use? Also if I do create that will I have to create less pages? (i.e I have 4 rosters one for group A,B,C,D) Each group has a a certain amount of members in that group now inorder to show the roster for that indivual group will I have to create a whole new page or just use ?= and it will create and only show members in that certain group?) Sorry if I sound confusing. the question mark represents the beginning of the query string .. your example isn't on since following the '?' will be a name, ie. www.mysite.com/index.php?name=seahub a better example would be www.mysite.com/index.php?userid=22 .. it's a way to carry values over various pages using the $_GET method. so, what that link would do (if properly connected to a database), would extract information from the database where the userid is 22 using something like this: $sql = sprintf("SELECT * FROM table WHERE userid=%d", $_GET['userid']); // continue with sql... /*don't use the above example as it carries no security*/ whether it's a good thing to use all depends on what you're trying to accomplish .. it is a common way to gather and extract information from users and against a database. Quote Link to comment https://forums.phpfreaks.com/topic/128212-pages/#findComment-664107 Share on other sites More sharing options...
topflight Posted October 20, 2008 Author Share Posted October 20, 2008 I apologize for being such a noob about this but may somebody please like show me an example to use '?='. Quote Link to comment https://forums.phpfreaks.com/topic/128212-pages/#findComment-670076 Share on other sites More sharing options...
aximbigfan Posted October 20, 2008 Share Posted October 20, 2008 You can't just do "URL?=something" You need to do something like ?name=123abc In that case, $var = $_GET['name']; Chris Quote Link to comment https://forums.phpfreaks.com/topic/128212-pages/#findComment-670091 Share on other sites More sharing options...
Maq Posted October 20, 2008 Share Posted October 20, 2008 thorpe already gave you a link to a thread with an example. to assign the link: echo "{$row['uname']} "; $_GET the data from the link: if (isset($_GET['member'])) { echo $_GET['member']; } Please attempt to do something so we can help you. Quote Link to comment https://forums.phpfreaks.com/topic/128212-pages/#findComment-670123 Share on other sites More sharing options...
topflight Posted October 20, 2008 Author Share Posted October 20, 2008 thanks I am still going to do some research Quote Link to comment https://forums.phpfreaks.com/topic/128212-pages/#findComment-670428 Share on other sites More sharing options...
Guest Xanza Posted October 20, 2008 Share Posted October 20, 2008 navagation.php $switch = $_GET['q']; if($switch == 'index'){ include("index.php"); } if($switch == 'games'){ include("/pages/games.php"); } usage: http://site.com/navagation.php?q=games ==> /pages/games.php This is the easiest way for you to do what you wanted. But the best way would be to use a database. Quote Link to comment https://forums.phpfreaks.com/topic/128212-pages/#findComment-670475 Share on other sites More sharing options...
Maq Posted October 21, 2008 Share Posted October 21, 2008 thanks I am still going to do some research Sure, it's pretty straightforward. Quote Link to comment https://forums.phpfreaks.com/topic/128212-pages/#findComment-670505 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.