PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I have a problem with a PHP task. I'm completely new to this and really have no clue how to solve this. It can't be that hard? It's a HTML form, I have two "option value" with "crypt" and "decrypt" and when I pick crypt I want a function to execute (show the crypt text from the text input box) after clicking OK. When I pick decrypt I want another function to execute (show the decrypt text from the text input). How do you solve this, how do I read HTML form tags with PHP? It works now, but the form shows both of them. All I want to do is to connect the php functions to the two different values. Does anyone know how to do this?
There is also a logic problem here : You cannot decrypt anything that hasn't been encrypted first. Having a 'decrypt' option before anything is encrypted would be moot. Your code should following a path similar to this :
1.Display textarea.
2.Encrypt user input
3.Show option to decrypt (after encryption)
4.If yes, decrypt text and display.
Note : crypt() is one way hashing so you cannot 'decrypt' it once it's been hashed. From the php manual (sic)
Note: There is no decrypt function, since crypt() uses a one-way algorithm.
“Don’t worry if it doesn’t work right. If everything did, you’d be out of a job.” - Mosher’s Law of Software Engineering