check for the correct data in mysql with php
I have a wordpress theme that i'm trying to add some minor security to (prevention from stealing (torrenting, other il开发者_如何学编程legal download methods)).
It's not the best way to prevent the matter but it's a start i guess.
What I'm trying to do is get PHP to hop into a database and check if there are certain values in certain fields. If there are, the server can finish processing the rest of the script. If the data is not correct in the database, a short message will explain the matter and so on.
Now i'm pretty sure this is going to include the "if" function but i have no idea how to get php to just check (not fetch) for the data.
What if you query db with where clause and then check number of rows against your query. If you found number of rows greater than 0 . Then you may proceed otherwise use PHP exit function to stop processing
PHP isn't compiled, so anyone will always be able to view the source and remove any PHP you put in to prevent illegal distribution. Unfortunately, protecting web work is basically impossible.
精彩评论