mightywayne Posted March 30, 2007 Share Posted March 30, 2007 Hello there. I have a user system where I'd like players to be able to view each others' profiles. So basically what I'm hoping for is something like... The URL, is viewprofile.php?id=xxxxxx Where xxxxxx is, would be that player's ID number. But what I'm wondering is how exactly if I generated that, the script would figure out what the ID was referring to. This'd also make searching for the ID easier cuz I have a cool way of doing that. Quote Link to comment Share on other sites More sharing options...
DeathStar Posted March 30, 2007 Share Posted March 30, 2007 1) dont come here for 1 purpose only! 2) We are not here to write scripts for you! $id = $_GET['id']; Thats a hint! Quote Link to comment Share on other sites More sharing options...
mightywayne Posted March 30, 2007 Author Share Posted March 30, 2007 O.o; It was that easy? Jeez. Uhm thanks for the help, but I didn't expect you to write any sort of script for me. I just needed the answer. I'd actually forgotten GET even existed, I learned so long ago. In the future, you should probably not be like, racist to newbies and stuff. Quote Link to comment Share on other sites More sharing options...
DeathStar Posted March 30, 2007 Share Posted March 30, 2007 haha Quote Link to comment Share on other sites More sharing options...
Caesar Posted March 30, 2007 Share Posted March 30, 2007 O.o; It was that easy? Jeez. Uhm thanks for the help, but I didn't expect you to write any sort of script for me. I just needed the answer. I'd actually forgotten GET even existed, I learned so long ago. In the future, you should probably not be like, racist to newbies and stuff. Newbies are indeed a strange breed. I hear they make funny noises when they mate. Quote Link to comment Share on other sites More sharing options...
DeathStar Posted March 30, 2007 Share Posted March 30, 2007 IMAO Quote Link to comment Share on other sites More sharing options...
Hughesy1986 Posted March 31, 2007 Share Posted March 31, 2007 Wow you guys are harsh, lol if you wana flame people for wanting to learn just like you did why are you in the php help forums? Glen Quote Link to comment Share on other sites More sharing options...
poirot Posted March 31, 2007 Share Posted March 31, 2007 Basically whenever you need to get something from a URL use $_GET, the POST method is something else and has nothing to do with the URL. Quote Link to comment Share on other sites More sharing options...
neel_basu Posted March 31, 2007 Share Posted March 31, 2007 OK Tell me the Following. 1. Whats Given (e.g. id) 2. What Fields You want to get (e.g. firstname, lastname, ................) 3. Your dbName 4. Table name Quote Link to comment Share on other sites More sharing options...
desithugg Posted March 31, 2007 Share Posted March 31, 2007 lol, funny discussion going on here anyways <form action='#' method='post'> <input type='text' name='id' value='133'> <input type='submit' value='view'> </form> <? $id = $_POST['id']; //id now contains the value 133 ?> the method post like secretly sends the information and is alot safer compared to get <form action='#' method='GET'> <input type='text' name='id' value='133'> <input type='submit' value='view'> </form> <? //when you submit the form the url will change to ?id=133# $id = $_GET['id']; //id now contains the value 133 ?> the get method shows the information in the url which some isp's allow you to edit i think and it's not considerd too safe well that's what I was told in these same forums or you can simply enter the url in the browser url thing http://domain.com/page.php?id=133 <? $id = $_GET['id']; //id now contains the value 133 ?> hope that helped you out a bit Quote Link to comment 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.