dcsimg
www.webdeveloper.com
Results 1 to 5 of 5

Thread: Javascript Var to php $ assignment?

  1. #1
    Join Date
    Jun 2014
    Posts
    9

    Javascript Var to php $ assignment?

    How to insert a value of javascript to PHP variables.
    I mean

    Four scores = 100;

    To
    $score = 100;

  2. #2
    Join Date
    Aug 2004
    Location
    Ankh-Morpork
    Posts
    19,604
    The question does not make any sense to me, as (normally) PHP runs on the web server, which sends its output to the browser, which is where any JavaScript is then executed. PHP is often used to dynamically populate JavaScript that will be sent to the browser, but your question seems to imply doing the reverse?
    "Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
    ~ Terry Pratchett in Nation

    eBookworm.us

  3. #3
    Join Date
    Jun 2014
    Posts
    9
    Thanks for fast reply.
    I mean I have some calculation done by javascript on the browser side. i
    I see many websites that process a Mysql Fetch, Update and Add fields from Java, i think throw PHP.
    Sorry for stupid questions can I made.
    How it's possible?

  4. #4
    Join Date
    May 2014
    Posts
    77
    If there really is a need to send a JS variable to PHP, trying using AJAX with jQuery. However, that's a whole new can of worms and will take a ton of reading on your part.

    There's also the serious question of: do you really need to do this?

  5. #5
    Join Date
    Jun 2014
    Posts
    9
    OK, I have another question.
    Is Javascript or Jquery can Change database fields and information?

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