Returning a value to a certain location using PHP

Posted on 2011-04-28
Last Modified: 2012-05-11
Hey guys,

I have a PHP based site. On account.php where there is a button for logging in thats calls php/login.php on click. When clicking login in validates your details, then echos to a blank page whether login was successful or not.

What im wanting to do is have the php/login.php send data back to the account.php form to the location under the login button. How would I do this?
Question by:Letsgetcoding
    LVL 107

    Accepted Solution

    LVL 3

    Expert Comment

    in php/login.php make function:
    function CheckLogin($username, $password)
           // Check username and password code.
          return $CheckResult;

    Open in new window

    in  account.php insert commands:
    // You code here
    $checkResultVariable = CheckLogin($username, $password);
    //Your code here

    Open in new window

    LVL 12

    Expert Comment

    by:Mohamed Abowarda
    LVL 107

    Expert Comment

    by:Ray Paseur
    Thanks for the points.  If you want a good learning resource for PHP and MySQL, this book is excellent:

    Best regards, ~Ray

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
    Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
    The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
    The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now