[eluser]CI-Newb[/eluser]
I am working on an activation function for user accounts. I want to structure the link in this way:
Code:
www.website.com/activation/jof9jff94j9f84jf94f-003
where everything before the dash is the activation code and everything after the dash is the user id.
Currently I am using the following piece of code to accomplish this:
Code:
$parts = explode("-",$code);
$code = $parts['0'];
$userid = $parts['1'];
if ($code != NULL && $userid != NULL && $user->exists()) {
In my check If the userid = null then it will redirect to a page saying the provided link is invalid. All of this works but when the page showing the invalid message opens I get a php error "Message: Undefined offset: 1". How can I write the code in such a way as to not receive this message or would someone have thoughts on a better way to structure the link.