Random URL |
Hello,
I found that one of the best way to secure Website pages from unknown people is random URL. For example: http://domain.com/controller/page/1 to sth like: http://domain.com/6456r43462344/2342345424 and change URL after each login. How can I do this
You can create the page content from a random query parameter. A very basci example could be a controller like
PHP Code: <?php defined('BASEPATH') OR exit('No direct script access allowed'); And this route PHP Code: $route['random/(:any)'] = 'random/index/$1';
Ok, again a very simple example. First you need the random link like the one in the following welcome controller
PHP Code: <?php Normaly you would echo this link inside your view but it should be only a simple e.g. This link redirects you to a page called "random" with two paremeters that are random numeric strings, produced by the ci string helper (for details look inside the documentation). To handle this random links you have to make a route in your /application/config/routes.php PHP Code: $route['random/(:any)/(:any)'] = 'random/index/$1/$2'; Now you can catch this two random parameters and call the method for the random controller PHP Code: <?php With this kind of logic you can handle you're random stuff and your following logic. |
Welcome Guest, Not a member yet? Register Sign In |