Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8226669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:51:16+00:00 2026-06-07T15:51:16+00:00

I want that when I press login button I get the response back in

  • 0

I want that when I press login button I get the response back in the same page e.g. if user name doesn’t exist or is duplicate it should show the error message on the same page, one more thing this data goes to another page and after some database action it returns the value, I got the value in the page where I use that database query, but how to get it back to the very first page from where I actually submitted it

this is the scenario login->function selector->controller(database query page)
what I need to do is to get value from controller to login after a successful query generation here is a glimpse of code

<form method="post" action="selector.php?type=login" id="login" id="loginForm">
                <div class="row">
                    <div class="offset1 span1">            

                        <div class="lbel"><label class="control-label" for ="loginName">Username/Email</label></div>
                        <div class="lbl_inpuCnt"><input type="text" class="input-xlarge" id="loginName" name="loginName" maxlength="50"/></div>
                        <div id="usernameError" style="font-size: 10px; color: red;">&nbsp;</div>
                        <div class="lbel"><label class="control-label" for="loginPassword">Password</label></div>
                        <div class="controls">
                            <input type="password" class="input-xlarge" id="loginPassword" name="loginPassword" maxlength="50"/>
                        </div>
                        <div id="passwordError" style="font-size: 10px; color: red;">&nbsp;</div><br/>
                    </div>
                </div>
                <div style="margin-left: 55px;">
                    <input class="btn" style="width: 80px;" type="reset" name="reset" value="Reset" onclick="clearFields()"/>
                    <input class="btn" style="width: 80px;" type="submit" name="submit" value="Login" onclick="return validateForm();"/>
                </div>
            </form>

then comes the selector page

<?php
include_once 'classes/controller.php';
$controller = new controller();
switch ($_GET['type']) {
case 'signup':
    $registerStatus = $controller->register($_POST);
    $_POST['username'] = $registerStatus;
    break;
case 'login':{
    $result= $controller->login($_POST);
    echo $result; //here i get the value from next page after process, i need it back to   login page to show error there!
    }
    break;
case 'uploadSongs':
    $controller->uploadSongs();
    break;
case "delete":
    echo "Function Called";
    break;

}
?>

and this is the controller function in controller.php

public function login($request = array()) {
    $login = $request['loginName'];
    $password = ($request['loginPassword']);
    $query = "select * from user where (user_name = '" . $login . "' OR email = '" . $login . "') AND (password  = '" . $password . "')";
    $user = $this->model->select($query);

    if (is_array($user) && isset($user[0]['user_id'])) {
        $_SESSION['uid'] = $user[0]['user_id'];
        echo $_SESSION['name'] = $user[0]['first_name'];
        $this->redirect("userArea.php");
    } else {
        echo "-1";
        return $login;
    }
    exit;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T15:51:17+00:00Added an answer on June 7, 2026 at 3:51 pm

    Login page can submit to itself, and on a successful login, you redirect to member area. On a failed login, you simply display a message.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a login button in wpf login form. I want that user has
I want to make a button that will redirect me to another page. the
i am working on android. i am creating a login button. i want that
hi all i want to know that if in my login.aspx page there is
I want that whenever the user types http://localhost:8280/services/Facebook/sea the actual request should be http://localhost:8280/services/Facebook/search?q=jack
I want that the user shouldn't be able to resize the window form. I
I want that user/attacker to encrypt the data and send to server. Now I
i have a problem with a WP7 app. I want that a user can
I do have a page that has a TextBox a Button and a Datagrid.
I have a page by name BranchMap that uses GoogleMap to show some building

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.