Some javascript help needed

Discussion in 'JavaScript' started by Nick_Mayhem, Jul 2, 2008.

  1. #1
    I have a code here

    <script language="javascript"><!--//
    var hello_id = 1234;
    //--></script>
    <script type="text/javascript" src="http://www.examplesite.com/show.php">
    </script>

    What I want to do is get the value of var hello_id to be accessed in the show.php file.

    Can someone tell me how to access that variable in the PHP code.

    Thanks.
     
    Nick_Mayhem, Jul 2, 2008 IP
  2. Nick_Mayhem

    Nick_Mayhem Notable Member

    Messages:
    3,486
    Likes Received:
    338
    Best Answers:
    0
    Trophy Points:
    290
    #2
    Sorry my bad.

    Have found the solution :)

    Thanks.
     
    Nick_Mayhem, Jul 2, 2008 IP
  3. MMJ

    MMJ Guest

    Messages:
    460
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Either put that value in the cookie or in the query string. Google is your friend.

    edit; nvm, seems like you found your solution.
     
    MMJ, Jul 2, 2008 IP
  4. realmahbub

    realmahbub Peon

    Messages:
    240
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    You can use xmlhttprequest object to use java script variable value in php pages. Or you can also set cookie to be available the variable to other pages

    thanks
     
    realmahbub, Jul 2, 2008 IP