| | #1 |
| Active Warrior Join Date: 2005 Location: Wirral, UK
Posts: 66
Thanks: 2
Thanked 6 Times in 5 Posts
|
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 |
| |
| | #2 |
| HyperActive Warrior War Room Member Join Date: 2007 Location: Greece
Posts: 159
Thanks: 11
Thanked 31 Times in 29 Posts
|
Php wont parse variables in this kind of bracket. Here is the right way: echo '<META HTTP-EQUIV="Refresh" Content="3; URL=' . $mylink . '">'; |
| Last edited on 11th Dec 2011 at 05:08 AM. Reason: wrote wrong the code | |
| |
| The Following User Says Thank You to Nikolas For This Useful Post: |
| | #3 |
| Night Angel Join Date: 2009 Location: Underground
Posts: 158
Thanks: 2
Thanked 14 Times in 14 Posts
|
Not sure what you're doing wrong, if you could post your code that should help narrow down the problem.
|
| | |
| |
| | #4 |
| Warrior Member Join Date: 2011 Location: Cleveland
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts
|
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.
|
|
Play bocce? Check out our cool selection of Bocce Ball Sets or the only drink koozie that keeps score!
| |
| |
| | #5 |
| HyperActive Warrior War Room Member Join Date: 2002 Location: United States
Posts: 421
Thanks: 22
Thanked 98 Times in 74 Posts
|
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."\">"; |
| |
| | #6 |
| Quality > Quantity War Room Member Join Date: 2011 Location: Germany
Posts: 67
Thanks: 2
Thanked 8 Times in 8 Posts
|
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 |
| |
|
| Bookmarks |
| Tags |
| link, php, put, variable |
| |