July 15, 201016 yr Hi all, I am looking to encrypt some data in a form echoed in php. If the user views the source of the page they'll just get the encrypted string, however the form should still submit as normal. Can anyone recommend a php function / encryption tool that will do this for me? Thanks in advance, Wayne.
July 15, 201016 yr So you want to encrypt the html that makes up the form? or you want to encrypt the form values the user has submitted?
July 15, 201016 yr Author Well i would like to encrypt the HTML form itself. I have done a bit of research into it seems to be a touchy issue in cases, some people say it's just a waste of time while others seem to think its not and is quite easily done with the right tool/script and not having to rely on a javascript enabled browser, in other words via PHP. I guess what im really asking is there a a way of just encrypting a couple of lines of your PHP that when it is echoed/printed to the browser in HTML that those couple of lines will be encrypted and when the users submits the form the form then gets decrypted before submission?? Wayne.
July 15, 201016 yr You can use PHP to echo out the encrypted HTML but its not possible to decrypt it without using javascript. In practice its a wasted of time, you can see the form code in the DOM once javascript has decrypted it.
July 15, 201016 yr Just out of interest, why did you want to encrypt the form? To stop spam bots or something?
July 16, 201016 yr waynef if you're looking to mak sensitive information (or keep it secure) you'll have to install a TLS/SSL. They're very cheap (namecheap.com offers one free with every domain purchase) Add a field and hide it, if it gets submitted then well, it's a spammer. <input type="text" name="first_name_" style="display:none" />
July 19, 201016 yr Yh in general encrypting HTML is a waste of time, If you want to protect against bots, captcha is the way to go mate
Create an account or sign in to comment