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 : 6465465DSGDGDGDG4564EEEZ7778

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

  $ url = $ _SERVER ['HTTP_HOST']; $ Salt = "i.am.a.rand0m.str1ng.ff.ChAAcT3r $"; Echo hash ('sha1', $ url. $ Salt);   

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

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -