0

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?

bfavaretto
  • 71,580
  • 16
  • 111
  • 150
FUIceman
  • 3
  • 2

2 Answers2

1

change to either:

echo " Not $_SESSION[email]?";

or

echo " Not {$_SESSION['email']}?";
Explosion Pills
  • 188,624
  • 52
  • 326
  • 405
1

It's slightly faster to use single quotes

echo '<a href="acme_dl_sessions.php?delete_session=1"> Not ' . $_SESSION["email"] . '?</a>';
Community
  • 1
  • 1
Wouter Dorgelo
  • 11,770
  • 11
  • 62
  • 80