Jpoel Posted December 23, 2007 Share Posted December 23, 2007 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 More sharing options...
PHP_PhREEEk Posted December 23, 2007 Share Posted December 23, 2007 In order to associate a username with a user_id, or vice versa, you need to store both of them somewhere. If not MySQL, do you intend on using a text file (flat file)? PhREEEk Link to comment https://forums.phpfreaks.com/topic/82921-convert-integer-to-string/#findComment-421701 Share on other sites More sharing options...
Jpoel Posted December 23, 2007 Author Share Posted December 23, 2007 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 Link to comment https://forums.phpfreaks.com/topic/82921-convert-integer-to-string/#findComment-421703 Share on other sites More sharing options...
Daukan Posted December 23, 2007 Share Posted December 23, 2007 mcrypt will encrypt and decrypt a string. Just make sure to use urlencode and decode on it before putting it in a url. Link to comment https://forums.phpfreaks.com/topic/82921-convert-integer-to-string/#findComment-421704 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.