block access to a function |
[eluser]pam81[/eluser]
Hi all, I'm making a typical class call user so there is a function register where you get the register's form wich could be access like www.mysyte.com/user/register Code: function register() but there is another function add wich is call from the form to insert the user but I don't wanna somebody access like www.mysite.com/user/add because this only must be called from the register's form. There is a way to prevent this kind of access? Thanks in advance
[eluser]minhbu[/eluser]
function _add() { //your code here } if you want to use above function $this->_add();
[eluser]n0xie[/eluser]
[quote author="pam81" date="1275995035"]but there is another function add wich is call from the form to insert the user but I don't wanna somebody access like www.mysite.com/user/add because this only must be called from the register's form. [/quote] Do you mean you want to POST to /user/add from the register form? In that case no, you can't block access. The only thing to do is to check in your add function if there is POST data available.
[eluser]pam81[/eluser]
Ok thanks a lot!! I think to check POST is which i would try because the referer could by but only if somebody try to access from another site. |
Welcome Guest, Not a member yet? Register Sign In |