Results 1 to 2 of 2

Thread: How to pass var from window.location.href

  1. #1
    Join Date
    Jun 2010
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to pass var from window.location.href

    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.

  2. #2
    Join Date
    Jan 2012
    Location
    India
    Posts
    45
    Thanks
    12
    Thanked 1 Time in 1 Post

    Default

    Quote Originally Posted by kathycam View Post
    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

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

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •