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

  • SEARCH
  • Home
  • 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 8403745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T22:25:34+00:00 2026-06-09T22:25:34+00:00

I am newbie using jquery mobile with php. I have a little problem on

  • 0

I am newbie using jquery mobile with php. I have a little problem on my login form with submit button after I submited, it head to ‘home.php’ page but url didn’t go to home.php too. (it’s still /login.php) . how can i fix this?

<?php

include 'core/config.init.php';     //include all sql connect,function etc.
if(logged_in() === true)
{
    header('Location: home.php');   
}

if(empty($_POST) === false)
{

    $check_user = true;
    $check_pass = true;
    $username = $_POST['username'];
    $password = $_POST['password']; 

    if(empty($username) === true || empty($password) === true)
    {
        $error = 'You need to enter username and password!';
        $check_user = false;
        $check_pass = false;
    }
    else if(user_exists($username) === false )
    {
        $check_user = false;
    }

    $login = login($username, $password);

    if($login === false)
    {
        $error = 'Username/password is incorrect!'; 
        $check_pass = false;
    }
    else
    {
        setcookie("username", "$username", time()+1720000); 
        header('Location: home.php');
    }
}
//print_r($error);

?>

<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1" />

    <link rel="stylesheet" href="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.1/jquery.mobile-1.1.1.min.css" />
    <link rel="stylesheet" href="core/css/login.css" />

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
    <script src="https://ajax.aspnetcdn.com/ajax/jquery.mobile/1.1.1/jquery.mobile-1.1.1.min.js"></script> 
    <script type="text/javascript" src="core/jquery/jquery-latest.js"></script>  
    <script src="core/jquery/login.js"></script>
</head>
<body>
        <div data-role="page" data-theme="a">
            <div id = "header-text-area">
                <span id= "header-text">Login</span>
            </div>
            <div data-role="content" style="padding: 15px">
                <form action="login.php" method="POST">
                    <div data-role="fieldcontain" class="ui-hide-label">
                        <input name="username" id="textinput1" placeholder="Username" value="test" type="text" />
                    </div>
                    <div data-role="fieldcontain" class="ui-hide-label">
                        <input name="password" id="textinput2" placeholder="Password" value="test" type="password" />
                    </div>
                    <div id = "submit-area">
                        <input type="submit" data-theme="b" value="Submit" id = "sub1"/>
                    </div>
                </form>

            </div>
        </div>
</body>

  • 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-09T22:25:35+00:00Added an answer on June 9, 2026 at 10:25 pm

    You need to add data-ajax="false" to the form tag. This will submit the form to your action URL without using Ajax navigation that is built into jquery mobile. Also, you should use the full URL in the form action. (jquery mobile sometimes gets confused)

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

Sidebar

Related Questions

i'm newbie at web developing. i have some input form.i'm using jquery 1.4.2 inside
I was newbie in using sqlite database android. and now I have a problem
I'm a jquery/rails newbie and I'm having trouble using .sortable(). I have expandable rows
am newbie to jquery..I have a three steps registration form in which the user
I'm a jQuery newbie. I have a simple form with n lines (although I'm
I'm a newbie using jquery and js either, so maybe thats the reason why
I am using jquery(newbie for jquery) in my application. In short what I am
I have just started using jQuery in the past couple of weeks and am
I'm trying to figure out why this is a problem when using jQuery 1.4.2
I'm a jQuery newbie, so be gentle! I have a loop that outputs extra

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.