Assign php variable value using ajax/javascript

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • farukcse
    New Member
    • Nov 2007
    • 52

    Assign php variable value using ajax/javascript

    Hi,
    Can any one tell me how to assign a php variable value using ajax / javascript?

    Regards,
    Faruk Chowdhury
  • MarkoKlacar
    Recognized Expert Contributor
    • Aug 2007
    • 296

    #2
    Originally posted by farukcse
    Hi,
    Can any one tell me how to assign a php variable value using ajax / javascript?

    Regards,
    Faruk Chowdhury
    Hi,

    I don't see why your should not be able to do it just as long as you call the functions correctly.

    Do you have any example code of what you are calling/assinging?

    Cheers

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      Originally posted by farukcse
      Hi,
      Can any one tell me how to assign a php variable value using ajax / javascript?

      Regards,
      Faruk Chowdhury
      The Javascript code is run on the client browser and the PHP variables are stored in memory locations on the server which Javascript cannot access. AJAX cannot only retrieve results of PHP scripts not manipulate them to change values of variables.

      Comment

      • henryrhenryr
        New Member
        • Jun 2007
        • 103

        #4
        Use javascript to create a new cookie. Use PHP to get the contents of the cookie.

        You will have to do some reloading.

        Comment

        Working...