Asked by FunWeb 23 months ago

Details:

This works:
echo "<meta http-equiv=\"refresh\" content=\"10;url=";
echo "http://www.yahoo.com\" />";

but this doesn't:
echo "<meta http-equiv=\"refresh\" content=\"10;url=";
echo "\"$pathdirectory\" />";

$pathdirectory = a fully functional URL. (???)

Viewing the source of the HTML generated by the PHP, the one with the variable looks perfect, just like the yahoo one, but a different, complete URL, but it never redirects. ???

So, why would a variable not work?

Again, the variable when viewing the sources looks perfect, example:
http://www.site.com/path1/file.php

Any ideas as to why it doesn't refresh/redirect?


0
 Forward to friends
 Discuss this question (0 comments) why can't I answer? Report abuse

av-answers (1)
 
Show all details, Hide all details

"Remove the extra quote in front of the URL..."

 by NC on Feb 23 2008 (23 months ago)
 Best Answer
Official Rating

Your first example outputs a valid META tag:

<meta http-equiv="refresh" content="10;url=http://www.yahoo.com" />

Your second example outputs an invalid META tag:

<meta http-equiv="refresh" content="10;url="[Your URL here]" />

(Note the unnecessary double quote in the middle of the content attribute.)

So what you need is to rewrite your code like this:

echo "<meta http-equiv=\"refresh\" content=\"10;url=$pathdirectory\" />";
Like this Answer?




Ask a question of your own: