![]() |
Put link into variable? PHP Hi, I'm trying to add a paused re-direct to a page using: Code: echo '<META HTTP-EQUIV="Refresh" Content="3; URL=$mylink">';What am I doing wrong? T |
Re: Put link into variable? PHP Php wont parse variables in this kind of bracket. Here is the right way: echo '<META HTTP-EQUIV="Refresh" Content="3; URL=' . $mylink . '">'; |
Re: Put link into variable? PHP Not sure what you're doing wrong, if you could post your code that should help narrow down the problem. |
Re: Put link into variable? PHP Nik. is correct. Echos wrapped in single quotes will not interpret. Do what he said or wrap the echo in double quotes so it interprets variables. I am on my DROID or I would post a snippet. |
Re: Put link into variable? PHP If the variable is set do this: echo "<META HTTP-EQUIV=\"Refresh\" Content=\"3; URL=$mylink\">"; OR echo "<META HTTP-EQUIV=\"Refresh" Content=\"3; URL=".$mylink."\">"; |
Re: Put link into variable? PHP Hello Amsterdam, Your problem is that you used ' instead of " after echo. With ' php will not parse variables in the string while in " it will. So your correct syntax would be echo "<META HTTP-EQUIV= \"Refresh\" Content=\"3; URL=$mylink\">"; Of course you need to escape " in the code then. Hope that helped you. Greetings |
| All times are GMT -6. The time now is 05:07 AM. |