Jump to content

Convert Integer to String?


Jpoel

Recommended Posts

Ok, heres my problem

 

currently i am making something which shows information about a specific user contained in a highscore list of an online game (the hiscore list is public)

 

its all working fine, and i currently have a link like:

 

http://mywebsite.com/script.php?user=James

 

But what i am wanting, is instead of having the username in the url, i would like a number, which could then be "converted" into the username using the php code

 

example:

 

http://mywebsite.com/script.php?id=72184546545

 

and then in my php i could have something like:

 

$id = $_GET['id'];
$user = convertbacktostring($id);

 

i would also need another function to convert the string to the id, obviously ;)

 

the reason i want to do this, is because i do not want the username to be visible to other people.

 

 

Please note: I am NOT wanting to use MySQL

 

Thanking you guys :-)

Link to comment
https://forums.phpfreaks.com/topic/82921-convert-integer-to-string/
Share on other sites

Actually, instead of using a MySQL database (which uses server space)

 

i was wanting to generate some kind of code, almost like encryption, but only using numbers, not special characters etc

 

even something simple like asigning each letter in a username a number, for example

 

123 could equal abc, or something to that effect

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.