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 5 of 5
  1. #1
    New Coder
    Join Date
    May 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to call a php script from a javascript event

    Hello,
    I need to execute a php code (that update a database) when user click on a checkbox so I need to call the php update code from onclick javascript event

    thanks

  • #2
    Senior Coder
    Join Date
    Feb 2006
    Location
    USA
    Posts
    1,013
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Learn CSS. | SSI | PHP includes | X/HTML Validator | CSS validator | Dynamic Site Solutions
    Java != JavaScript && JScript != JavaScript
    Design/program for Firefox (and/or Opera), apply fixes for IE, not the other way around.

  • #3
    New Coder
    Join Date
    May 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    is there any other way than ajax
    if not where is the best place to start using ajax

  • #4
    New Coder
    Join Date
    Mar 2006
    Location
    In an apartment.
    Posts
    57
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Couldn't you use JavaScript Object Notation (JSON)? Or would it have to be AJAX with JSON instead of XML?

  • #5
    New Coder
    Join Date
    May 2006
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can any one post a sample code to what I want ? I just need when a user click on a checkbox a session variable updated with passed value

    for example :
    if checkbox is checked then append to session variable a value passed from the checkbox
    if not checked find this value if it is exists if so remove it from the session variable

    the session values is like that $session_var = '1,2,3,4,5'

    it will be appreciated if any one can give me a starter code for this
    (I use PHP)
    Last edited by isaac_cm; 06-07-2006 at 09:13 PM.


  •  

    Posting Permissions

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