SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Enthusiast
    Join Date
    Oct 2004
    Location
    Grapevine
    Posts
    34
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question JSVar to PHP Var

    I need a JScript that will capture a dynamic <div> scroll position and write it to a PHP Var. Every time a user clicks the <div> scroll bar, then the PHP Var is automatically updated. I have only been able to capture the <div> scroll bar postion with a SESSION cookie, but this will not work as I am extensively using PHP SESSIONS and the cookie does not seem to be dynamic and I can't get this JS Var to write to anything other than a form.textbox.

    tia ,
    cmc

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Use Ajax to send it over to a php script.
    Saul

  3. #3
    SitePoint Wizard cranial-bore's Avatar
    Join Date
    Jan 2002
    Location
    Australia
    Posts
    2,634
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Every time a user clicks the <div> scroll bar, then the PHP Var is automatically updated
    This doesn't make sense. A PHP script lives and dies for its execution time only. It doesn't persist like Javascript does. Once the page is rendered there is no PHP var.

    You could you Ajax to send the JS Var server side to PHP, but it would have to do something with the value before the script ends.


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
  •