shopkanji
11-03-2004, 10:51 PM
I have a link that loads a PHP page that has several if/else statements.
Depending on variables, one of several different outcomes occurs.
In all situations the user is redirected to a new page using a header line.
This works fine and great, and I don’t need any help here.
On some of the outcomes I would like a script to load.
If I try to use print line above the header line, but then my header line doesn’t work and I get an error: “Cannot modify header information - headers already sent by…”
How can I load a script with my PHP page and have my headers work?
Alternatively, is there any native PHP way to prompt a user to bookmark a page?
if ($var == "this")
{
header("Location: http://www.site-a.com/");
}
else
{
print (“<script>if (document.all); window.external.AddFavorite(\"http://www.site-b.com\",\"Site B\");</script>”);
header("Location: http://www.site-b.com/");
}
Thanks for any help! :)
Depending on variables, one of several different outcomes occurs.
In all situations the user is redirected to a new page using a header line.
This works fine and great, and I don’t need any help here.
On some of the outcomes I would like a script to load.
If I try to use print line above the header line, but then my header line doesn’t work and I get an error: “Cannot modify header information - headers already sent by…”
How can I load a script with my PHP page and have my headers work?
Alternatively, is there any native PHP way to prompt a user to bookmark a page?
if ($var == "this")
{
header("Location: http://www.site-a.com/");
}
else
{
print (“<script>if (document.all); window.external.AddFavorite(\"http://www.site-b.com\",\"Site B\");</script>”);
header("Location: http://www.site-b.com/");
}
Thanks for any help! :)