Search code examples
phphrefsession-cookies

PHP echo href issue


I am trying to add a delete session option in my form, but I cannot get around the following error:

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /users/bfullilo/acme_dl_sessions.php on line 31

Here is my line 31

echo "<a href=\"acme_dl_sessions.php?delete_session=1\"> Not $_SESSION[\"email\"]?</a>";

I know that I'm not escaping everything I need to, but I've hit a wall. Any help?


Solution

  • It's slightly faster to use single quotes

    echo '<a href="acme_dl_sessions.php?delete_session=1"> Not ' . $_SESSION["email"] . '?</a>';