PDA

View Full Version : How to pass var from window.location.href



kathycam
01-22-2012, 10:10 PM
Hello

I have a window location call:
window.location.href="http://www.mysite/myfile.php?id=sTemp1";
where sTemp1 = a string that may be different for each call.

When I display the var in php, it displays'sTemp1 and not the value of sTemp1

How do I get the value?

Thanks.

ankush
01-23-2012, 09:01 AM
Hello

I have a window location call:
window.location.href="http://www.mysite/myfile.php?id=sTemp1";
where sTemp1 = a string that may be different for each call.

When I display the var in php, it displays'sTemp1 and not the value of sTemp1

How do I get the value?

Thanks.

show your code...

why are you using window.location ?

use this instead in php


header("location:myfile.php?id=$sTemp1");