0

I am working on a registration system that sends an email to the user with an activation link, using the username they provided. I cannot seem to figure out how to append the variable as a get argument. The email sends, but my link is not showing up right. Am I using the wrong syntax?

$message = "Thank you for creating an account. Please activate it now here : <a href=\"http://cts.gruv.org/jstudent/activate.php?username=".$_GET['user']."\"></a>";

I have user declared as such:

$user = $_POST['newUserName'];

which is grabbing the information provided in the form by the registrant. Any ideas? Thanks!

2
  • 1
    Activating users by their username is extremely stupid idea. Commented Oct 15, 2015 at 20:06
  • It's just for practice. I'm the only user going to be registering. Also just using a text file to store info right now, which I also know is stupid. Just practice Commented Oct 15, 2015 at 20:13

2 Answers 2

1

I think you need some text within the 'a' tag. something like this:

$message = "Thank you for creating an account. Please activate it now <a href=\"http://cts.gruv.org/jstudent/activate.php?username=".$_GET['user']."\">here</a>";

Sign up to request clarification or add additional context in comments.

3 Comments

Thank you for creating an account. Please activate it now <a href="http://cts.gruv.org/jstudent/activate.php?username=">here</a> is the ouput from the email with that. About what I've been getting.
Need it to show the username in the link and link to it.
Ok, I'm not sure if I'm understanding correclty. But you might simply need to do this: $message = "Thank you for creating an account. Please activate it now <a href=\"http://cts.gruv.org/jstudent/activate.php?username=".$user."\">here</a>";
0

There is no text in your anchor tags. The link won't show unless you put something there I.e

<a href ="...">my link</a>

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.