Page 1 of 1

Url Unique ID

Posted: Thu Apr 01, 2010 2:43 pm
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

Re: Url Unique ID

Posted: Thu Apr 01, 2010 3:10 pm
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

Re: Url Unique ID

Posted: Thu Apr 01, 2010 3:30 pm
by wardyb
no that wasn't what I was looking for. that involved typing a url to be shortened.

Re: Url Unique ID

Posted: Fri Apr 02, 2010 3:11 am
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?