Custom Routes with Account Verify Controller |
[eluser]xtremer360[/eluser]
I've been at this for a few days and have tried working with my routes and code to make this work but for some reason I just can't find the correct solution. After a user registers they are sent an email with a link to the activate account page where the user must enter their password into a form field and submit the form so that it takes the user_id and registration key and password and tries to activate the account. What I would like to see happen is when the user only puts in kansasoutlawwrestling.com/kowmanager/activate OR kansasoutlawwrestling.com/activate/whateverUserID it gives the error page as it should AND when they put in kansasoutlawwrestling.com/activate/whateverUserID/whateverRegistrationKey it shows the activate page. I tried echoing out the param variables but all they did was echo $1 and $2. My url looks like this: kansasoutlawwrestling.com/kowmanager/activate/10000(user_id)/4ku08daf8fd90df8098f0da(registration_key) My custom route is as follows: Code: $route['activate/:num/:any'] = "activate/index/$1/$2"; My activate controller is as follows: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
[eluser]CroNiX[/eluser]
The manual for route talks about (:any) and (:num), but you are using :any and :num.
[eluser]xtremer360[/eluser]
Yes thank you I finally noticed that however I'm still getting a problem when their is only the userid such as the page here http://www.kansasoutlawwrestling.com/kow...ate/10000/ BUT its the same code on all the pages because it uses the same templating system.
[eluser]CroNiX[/eluser]
Maybe try this (in this order): Code: $route['activate/(:num)/(:any)'] = "activate/index/$1/$2"; First line of your index() method: Code: if (is_null($param1) OR is_null($param2)) //if either is still null, error out |
Welcome Guest, Not a member yet? Register Sign In |