Reputation: 23
I'm using a custom login script for my wordpress installation. Everything works fine except that when the activation key is sent to registered users in the following format:
http://mydomain.com/?page_id=1278&[email protected]&activate_key=7edbad
When users click on the above link however, the '@' in the email disappears and therefore gives an error that the activation key is invalid.
Can someone guide me on this?
This is the piece of code that puts the activation link together:
$link=get_option('home').'/?page_id='.$pageid.'&mail='.$user_email.'&activate_key='.$key;
Upvotes: 1
Views: 632
Reputation: 360
Try urlencode()
around the $user_email
to convert it to a URL-friendly value.
Upvotes: 0
Reputation: 401142
You probably need to encode the parameters in that URL, using the urlencode()
function on each parameter's value :
$link=get_option('home')
.'/?page_id='.urlencode($pageid)
.'&mail='.urlencode($user_email)
.'&activate_key='.urlencode($key);
$params = array(
'page_id' => $pageid,
'mail' => $user_email,
'activate_key' => $key,
);
$query_string = http_build_query($params);
$link=get_option('home') . '/?' . $query_string;
Upvotes: 1