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

2

2291980

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
 
I

Ian Collins

2291980 said:
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?
 
P

pcx99

2291980 said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top