desjardins2010 Posted February 6, 2014 Share Posted February 6, 2014 echo "<tr><td>".$prog_name."</td><td><a href='".<?php echo htmlspecialchars($_SERVER["PHP_SELF"])?>."?id=".$title."'>EDIT</a></td></tr>"; what am I doing wrong - and could you please just explain my mistake so I can learn from it.. I know it's having to do with the "" and '' but I confuse on where to use them Quote Link to comment Share on other sites More sharing options...
Barand Posted February 6, 2014 Share Posted February 6, 2014 You are using "echo" at the beginning of the line so you must already be inside PHP tags. In that case you do no need the extra "<?php echo ... ?>"around the htmlentities. Also when using double-quotes you do not need to concatenate php variable names. echo "<tr><td>$prog_name</td><td><a href='". htmlspecialchars($_SERVER["PHP_SELF"]) . "?id=$title'>EDIT</a></td></tr>"; Quote Link to comment Share on other sites More sharing options...
gristoi Posted February 7, 2014 Share Posted February 7, 2014 i personally like to use this approach to make it stand out a little more : echo "<tr><td>$prog_name</td><td><a href={ htmlspecialchars($_SERVER["PHP_SELF"]) }?id={ $title }'>EDIT</a></td></tr>"; Quote Link to comment Share on other sites More sharing options...
Barand Posted February 7, 2014 Share Posted February 7, 2014 Why would you personally like something that doesn't work? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.