Url Unique ID

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
wardyb
Forum Newbie
Posts: 3
Joined: Thu Apr 01, 2010 2:28 pm

Url Unique ID

Post by wardyb »

I am creating a site similar to this one. http://mzplayer.se/
Basically you paste a string from a certain game and it splits this and stores them in the database as individual numbers/words. This allows users to post their teams (from the game) for anyone to see, without the need for users to sign up.

I am now at the stage where I need to generate a unique id (which I know how to do), but I don't know how to incorporate it into the url (like this - http://mzplayer.se/?id=924180384).

Please can someone give me a useful link or two?

Thanks, wardyb
wardyb
Forum Newbie
Posts: 3
Joined: Thu Apr 01, 2010 2:28 pm

Re: Url Unique ID

Post by wardyb »

am I right in thinking post 6 is what i'm looking for?

http://www.sitepoint.com/forums/showthr ... ?p=3072386

I could still do with another example
wardyb
Forum Newbie
Posts: 3
Joined: Thu Apr 01, 2010 2:28 pm

Re: Url Unique ID

Post by wardyb »

no that wasn't what I was looking for. that involved typing a url to be shortened.
DuckyDuck
Forum Newbie
Posts: 2
Joined: Fri Apr 02, 2010 2:57 am

Re: Url Unique ID

Post by DuckyDuck »

i'm not sure what you mean but, is this something like it?

Table:
Players
Columns:
id
players

form.php

Code: Select all

<html>
<form action="createurl.php">
<textarea cols="45" rows="45" name="players"></textarea></form>
createurl.php

Code: Select all

<?
/*mysql_connect-codes*/
mysql_query("INSERT INTO players VALUES('" . rand(100000, 999999) . "','" . $_POST['players'] . "');
?>
geturl.php

Code: Select all

<?
/*mysql_connect-codes*/
$play=mysql_query("SELECT * FROM players WHERE id='" . $_GET['id'] . "'");
while($players=mysql_fetch_array($play))
{
echo $players['players'];
}
?>
this is of cours just a draft, but something like that?
Post Reply