SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Oct 2006
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ajax submit form, allow only when logged in

    For example, I have commenting system where I want to use ajax to display and submit comments.

    How do I check if user is logged in, if logged in then display the form, otherwise forward it to login page.

    Once they submit the form, how do you update the page to reflect the changes?

    Do you update the partial page or just reload the whole page with new comment?

  2. #2
    I meant that to happen silver trophybronze trophy Raffles's Avatar
    Join Date
    Sep 2005
    Location
    Tanzania
    Posts
    4,662
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    This is not javascript land. What you describe is the job of server-side scripting. Anything to do with logging in has to be done on the server side (even Ajax relies on the server). Doing anything like logging in with just javascript is not only very insecure, it's silly.

    Perhaps you should delve into some server-side scripting language, like PHP.

  3. #3
    SitePoint Addict
    Join Date
    Oct 2006
    Posts
    216
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what i need to do is, display the form by ajax when user is logged in, without making a request to new page.


    Since this is not possible, I have to do it in server side scripting and make a Request for a new page, check if user logged in, then display forms. That means I need a separate page for this.

    So there is no ajax solution with the first original page request. correct me if I am wrong.


Bookmarks

Posting Permissions

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