Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP: print '<meta http-equiv="refresh" content="0;url=' with URL parameters

Tags:

php

How do I create this string with URL parameters? What I want is something like:

print '<meta http-equiv="refresh" content="0;url=http://domain.com?a=1&b=2">';

But that doesn't pass my second parameter correctly. I get a ")" instead of a b. What am I doing wrong?

I've tried &amp; instead of the ampersand, but that doesn't work either,

like image 428
sehummel Avatar asked Feb 26 '23 10:02

sehummel


2 Answers

echo "<meta http-equiv='refresh' content='0;url=http://domain.com?a=1&b=2'>";

or even

header ("Location: url=http://domain.com?a=1&b=2");

since you are using 0 as delay

like image 106
thegryphon Avatar answered Mar 29 '23 22:03

thegryphon


If you're already using 0 delay for the <meta> refresh, why don't you just use a HTTP Location redirect?

<?php
   header('Location: http://domain.com?a=1&b=1');

and if it's in the middle of a page you have to rewrite your program to make it SENSIBLE

like image 36
Your Common Sense Avatar answered Mar 30 '23 00:03

Your Common Sense