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 7665577
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T14:36:24+00:00 2026-05-31T14:36:24+00:00

I have a question about login and accessing database for mobile web applications. Namely,

  • 0

I have a question about login and accessing database for mobile web applications.

  1. Namely, the fact that all the pages are usually in one page separated by ids, how do you send form data using PHP? There are no separate files to send data to.

  2. Doesn’t opening a connection at the top of the HTML file without logging in cause a security problem? If they do not login successfully, you are essentially redirecting to the same HTML file.

If someone could redirect to a tutorial (which I can’t seem to find online) or give an overview, that would be awesome.

<?php 
//1. Open connection
//2. Select database
?>

<html>
<body>
<section id="page1">
<form action="page2" method="POST"><!-- since the data needs to be send to #page2, do I just POST to the same html file? -->
</form>
</section>

<section id="page2">
<?php 
//3.query database
//4. display results 
?>
</section>

<section id="page3">
</section>

</body>
</html>
<?php //5. close connection?>
  • 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-05-31T14:36:25+00:00Added an answer on May 31, 2026 at 2:36 pm

    1) You can keep separate files in PHP, they don’t have to be in the same page. For example, you have a file named login.php.

    <?php ?>
    <html>
        <form action="index.php" method="post>
        <input type="text" name="username"/>
        <input type="password" name="pasword"/>
       </form>
     </html>
    

    Then in your index.php file you would have something like this.

    <?php
    if($_POST['username']=="admin" && $_POST['password']=="admin")
    //query database
    //display results 
    ?>
    

    So you don’t have just one file containing different pages.

    2) You can include a main.php file in all your pages and check if user is logged in, if not, redirect him to some other page. In adition you could learn a little bit about session variables.

    <?php
    include("main.php");
    ?>
    

    In your main.php

    <?php
    session_start();
    if(!$_SESSION['islogged'])
    header("location: otherpage.php";)
    ?>
    

    So if the user is logged in there will be no redirection but other way it will.

    Hope this helps you.

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

Sidebar

Related Questions

I have question about normalization. Suppose I have an applications dealing with songs. First
I have a question about the login control of asp.net. I defined on my
I have a question about my database. I try to delete my database but
I'm looking to deploy a web app and I have a simple question about
I have a question about facebook login on my website. What I have now
I made my own login system in nodejs and I have couple question about
I have read many questions about the facebook login but until not I didnt
I have question about interpreting strings as packed binary data in C++. In python,
i have question about YAJLiOS parser... I have next json data : {{ body
I have a question about whether or not a specific way of applying of

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.