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
  • 70,503
  • 15
  • 107
  • 148
FUIceman
  • 3
  • 2

2 Answers2

1

change to either:

echo " Not $_SESSION[email]?";

or

echo " Not {$_SESSION['email']}?";
Explosion Pills
  • 183,406
  • 48
  • 308
  • 385
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,372
  • 11
  • 59
  • 79