Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2010
    Location
    God's Own Country
    Posts
    87
    Thanks
    6
    Thanked 0 Times in 0 Posts

    assigning javascript variable into php

    Can anyone tell me of how to take or assign a javascript variable into php.

  • #2
    Regular Coder bacterozoid's Avatar
    Join Date
    Jun 2002
    Location
    USA
    Posts
    490
    Thanks
    24
    Thanked 35 Times in 35 Posts
    Easiest way is to have that javascript variable stored in a hidden form input - then when the user submits the form on the page the variable goes right to the PHP with everything else.

    If you're not using a form, then the only way would be to use Javascript to submit a request to a PHP script (AJAX).

    Got any more details about what you're trying to do?

  • #3
    New Coder
    Join Date
    Feb 2010
    Location
    God's Own Country
    Posts
    87
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by bacterozoid View Post
    Easiest way is to have that javascript variable stored in a hidden form input - then when the user submits the form on the page the variable goes right to the PHP with everything else.

    If you're not using a form, then the only way would be to use Javascript to submit a request to a PHP script (AJAX).

    Got any more details about what you're trying to do?
    Thanks..I understood wat u meant


  •  

    Posting Permissions

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