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 2 of 2

Thread: Ajax help

  1. #1
    New Coder
    Join Date
    May 2012
    Posts
    25
    Thanks
    4
    Thanked 1 Time in 1 Post

    Ajax help

    Hi All,

    Not sure if I should post this here or in the jQuery forum, but basically I am trying to create a login link where the user clicks on the link the jquery will then call the PHP script to destroy the session and then refreshes the page, so basically as far as the user is concerned the page has just refreshed.

    I've been trying to use the below code but I'm not having any luck.

    Code:
    	$('#logout').click(function() {
    		$.post("login.php?action=logout", {currentpage: "<?php echo curPageURL(); ?>"}, function(){
     			window.location.reload(true);
    	});
    The function that is next to currentpage: just echos the current page that the user is on.

    Any help would be fantastic,

    Thanks

  • #2
    Senior Coder
    Join Date
    Dec 2010
    Posts
    2,398
    Thanks
    12
    Thanked 570 Times in 563 Posts
    What is the problem?

    Does login.php execute? Do you see the parameters "action" and "currentpage" inside of login.php? What is login.php supposed to do?


  •  

    Posting Permissions

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