www.webdeveloper.com
Results 1 to 3 of 3

Thread: Accessing js variable from php

  1. #1
    Join Date
    Jan 2008
    Posts
    78

    Accessing js variable from php

    I have written a piece of code that is half php and half js.

    I want to access the content of a js variable from the php side.

    file1.php:

    //js begin
    …
    var x = 5;
    …
    //js end

    …

    //php begin
    …
    $x = x; // How can I do this? Obviously, it doesn’t work in this way
    …
    //php end


    Comments welcome,
    Ruben

  2. #2
    Join Date
    Jun 2006
    Location
    Down at the bottom of the garden
    Posts
    1,239
    Use Ajax.

    I would suggest using the Prototype javascript library.
    Quote Originally Posted by temp.user123
    You know... You're not so smart. Do you need me to educate you?
    If you say, "please," (and do so, nicely) then I will show you where you're dead wrong.

  3. #3
    Join Date
    Oct 2007
    Posts
    113
    Single answer -> ajax

    Dont try to find another way to do that!!!! and save time

    XMLHttpRequest

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles