save value with ajax
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5

Thread: save value with ajax

  1. #1
    Join Date
    May 2008
    Posts
    74

    save value with ajax

    hi,
    i want save a value to the db by pressing a link or button without reload or open a new window i have see the ajax returning data without refreshing the page but save a value...
    any one know a way to save a value using ajax? i using php
    thanks a lot for your help

  2. #2
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,871

    Re: save value with ajax

    AJAX can only send data, PHP itself will have to save it to the database. Can you post your code so we can understand what you are doing?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  3. #3
    Join Date
    May 2008
    Posts
    74

    Re: save value with ajax

    i dont have any code so far.
    what i want to do this is:

    iŽdeveloping a site for ads and i want that any user can click in the ad to add/remove the ad to the favorit list the ads id will be stored in the db with the user id.
    my objective is performe this
    operation( add/remove the id) in real time without reload the page or without any frame/iframes may be the other way to this is with cookies but so far i do like to learn how can i do this with ajax or a similiar way and them do with cookies too, thanks for your attention

  4. #4
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002
    Posts
    10,871

    Re: save value with ajax

    Well, then you are going to want to read through W3School's tutorials on AJAX and MySQL using PHP.
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

  5. #5
    Join Date
    May 2006
    Posts
    306

    Re: save value with ajax

    You'd have to...

    request.open(MyFile.php?" + id1 + "=" + id1value);
    OR request.open(MyFile.php?" + yourdata);

    you can keep adding id's and php will get the variables passed onto it via ajax, maybe send something back via a iframe that was refreshed, you could then pull the data from that hidden iframe and apply it to your page.

    eh? im new, that the best i could come up with. I'd say iframe's is the only way, but make it hidden from user's view.

Posting Permissions

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


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center