Grow your CSS skills. Land your dream job.

How to separate PHP content returned in an AJAX Jquery POST function

  • # April 1, 2011 at 1:41 pm

    Ah gotcha ! I understand 100%

    Thanks very much kind sir !

    # April 4, 2011 at 4:22 am

    I did something completely different now to separate the content returned by the Jquery POST callback…

    In the callback, I receive just ONE echo and that is a confirmation that the user is logged on ( after running some backend PHP validation ). On this conformation I have a link that ( when clicked ) only refreshes the page, upon refreshing, the PHP Session will pick up that the user is logged on and display the content the user is allowed to see, by embedding the PHP tags and only echo’ing content based on the condition that the user’s Session exist.

    Not sure if it is the most elegant way to do this, but it works for me.

    Thanks for everyone’s input. Much appreciated.

    # January 8, 2013 at 12:12 am

    Entry a bit old now, but thanks for your code stefanbar, I needed the same thing for my code.
    I don’t really understand the use of this line:
    header(‘Content-type: application/json’);
    but it was necessary.

    # February 2, 2013 at 9:47 pm

    here’s a good tutorial that also uses the combination of PHP and AJAX, you can seach and the results are quick it also have limiters. http://www.upgradedtutorials.info/tutorials/fast-search-and-sorting-data-in-mysql-using-php-and-ajax/

Viewing 4 posts - 16 through 19 (of 19 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".