Dismiss

askville homepage
Asked by FunWeb 21 months ago ( Send a Compliment)

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 Forward to friends
Discuss this question (0 comments) why can't I answer? add to Digg Digg it! add to Facebook Add to Facebook Report abuse

av-answers (1)
 
show all details - hide all details

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

Hightest Level: 3 by NC on Feb 23 2008 (21 months ago)
Best Answer Winner! Best Answer
Official Rating
Five stars
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? Thumb Up (0)




Or ask a question of your own: