Jump to content

Getting POST from a URL?


mightywayne

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.