mysql - How to auto generate a random unique permanent secure ID based on current url, store it automatically inside database and display it in php page? -
I need help in creating a random unique permanent secure id based on the current URL to the generated URL Php page?
I have a multisite and make a new subdomain every time, I want to display a unique safe ID based on the current new subdomain on the page and likes to display it in my page: < / P>
ID Page Safe Numbers : PHP has a hashing function that you can use. I will also add a random salt to it, actually there can be anything like a string of text or numbers There are other hashes you can use: PHP also has a task, but it requires 5.5.0 or more. Edit The URL for $ _SERVER ['HTTP_HOST'] has been ejected, though there are probably a better way of getting the current URL 6465465DSGDGDGDG4564EEEZ7778
$ url = $ _SERVER ['HTTP_HOST']; $ Salt = "i.am.a.rand0m.str1ng.ff.ChAAcT3r $"; Echo hash ('sha1', $ url. $ Salt);
Comments
Post a Comment