By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,844 Members | 836 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,844 IT Pros & Developers. It's quick & easy.

any body have idea about diff in window.loaction & header of php

P: n/a
Hello

can any body tell me the dff between
function redirect($url)
{
echo "<script>";
echo "window.location='".$url."'";
echo "</script>";
}

and

header("Location $url")

syntex belong to php

Feb 19 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
2291980 wrote:
Hello

can any body tell me the dff between
function redirect($url)
{
echo "<script>";
echo "window.location='".$url."'";
echo "</script>";
}

and

header("Location $url")

syntex belong to php
Then why not ask on comp.lang.php?

--
Ian Collins.
Feb 19 '07 #2

P: n/a
2291980 wrote:
Hello

can any body tell me the dff between
function redirect($url)
{
echo "<script>";
echo "window.location='".$url."'";
echo "</script>";
}

and

header("Location $url")

syntex belong to php
The first will redirect the visitor only if they have javascript
enabled. The second will redirect all visitors regardless of if they
have scripting enabled or not.
--
http://www.hunlock.com -- Musings in Javascript, CSS.
$FA
Feb 19 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.