So… I want to learn some PHP and put up some multiple choice quizzes this semester. But I don’t know if students have a way of looking at the source code to find the answers. Since PHP is client-side, does that mean all the code involving seeing if they have the correct answer is hidden from the user? Is there something extra I have to do to hide this part?
PHP code is server side not client side, so the code is not sent to the users web browser. Only the output from the code is sent. As long as the code is running, users won’t be able to see it source code.
You can use a tool to protect your source code just in case security is not correct on the server. I use the one from ioncube.com because they offer an online option. I load my prepay account with as little as $5 and use it on a pay as you go basis. I mostly use it so I can install working code on a customer server for their review. If they agree to pay for it I give them the source code. The customers often like it because they are getting a protected version along with the source code.
It depends on how the code is written.
You can try using MySql database to put the answers to your questions or use a flat file…
PHP is a server side scripting language, not client side, so there is no problem.