Page 1 of 1

unable to put a link in the 'echo' command

Posted: Tue Aug 09, 2011 12:49 pm
by n3wb1e
Ive given up trying to figure out why my 'header' function fails to redirect to a new page, so now Im using the 'echo' function. When a user submits a form utilising recaptcha, I get errors.

This works:
echo "Your email was successfully sent.<br /><br />";

This doesnt work:
echo "The security code entered was correct. Click <a href="index.php">here</a> to return to the homepage<br /><br />";

It spits out a server error message. Can someone tell me why?
Thanks.

Re: unable to put a link in the 'echo' command

Posted: Tue Aug 09, 2011 1:09 pm
by Celauran
You need to escape quote inside what you're trying to echo.

Code: Select all

echo "The security code entered was correct. Click <a href=\"index.php\">here</a> to return to the homepage";

Re: unable to put a link in the 'echo' command

Posted: Wed Aug 10, 2011 11:59 am
by n3wb1e
Thank you.