Welcome Guest, Not a member yet? Register   Sign In
Invalid character on Url error

[eluser]Arun Joshi[/eluser]

In my site am trying to activate a user when he click on the activation link on his email. In myaddress i have user email address. So the '@' symbol on email address causing the following error. How can I solve this?

An Error Was Encountered
The URI you submitted has disallowed characters.

http://mysite.com/activation/[email protected]/01c19622adc2d47749353b7aae785829

I tried urlencode(), but didnt work.


You can set the allowed url characters in config/config.php. If you add the @ to them, it will work like you want to.
Of course, if someone had an email address containing another illegal character you would have the same problem. You could also solve it by not using the email address in the activation link but some other unique id.

Do NOT allow @ char!! You can break down your security!

Try do replace the @.
str_replace('@', 'at', $email)

Or, transform the email into a token, or something else
$email = md5($email);

Then you can check using this way:
if ( md5($this->uri->segment(n)) == md5($email) )
  echo 'Ok Sam';

[eluser]Arun Joshi[/eluser]
Thanks ELRafael,

Great information.

Theme © iAndrew 2016 - Forum software by © MyBB