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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:43:33+00:00 2026-06-13T02:43:33+00:00

<?php //index.php session_start(); if (isset($_SESSION[‘username’])) { header(‘Location: Pro_Lesson.php’); } if (isset($_POST[‘username’], $_POST[‘password’])){ if(empty($_POST[‘username’]) ||

  • 0
<?php
//index.php
session_start(); 
if (isset($_SESSION['username'])) {
header('Location: Pro_Lesson.php');
}
if (isset($_POST['username'], $_POST['password'])){
    if(empty($_POST['username']) || empty( $_POST['password'])){
        echo "username or password are empty";
    }else {
header('Location: login.php');
    }
}
?>
<html>
<head>
</head>
<body>
<h3>User Login</h3>
<table border="0">
<form method="POST" action="index.php">
<tr><td>Username</td><td>:</td><td><input type="text" name="username" size="20"></td></tr>
<tr><td>Password</td><td>:</td><td><input type="password" name="password" size="20"></td></tr>
<tr><td>&nbsp;</td><td>&nbsp;</td><td><input type="submit" value="Login"></td></tr>
</form>
</table>
</body> 
</html>

how can I post the form data to another php page after success validation for username and password ? and is it secure ?

  • 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-13T02:43:34+00:00Added an answer on June 13, 2026 at 2:43 am

    You could do it:

    $_SESSION['posted'] = $_POST;
    

    In other php page:

    print_r($_SESSION['posted']);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

index.php session_start(); if(!isset($_GET['n'])) { $_SESSION['foo'] = bar; header(Location: /index.php?n=D); } echo FOO: .$_SESSION['foo']; This
So I have the index.php page. <?php session_start(); if (!isset($_SESSION['var1'])) { echo session not
These are my first 5 lines in my index.php: <?php session_start(); if (!isset($_SESSION['cart'])) $_SESSION['cart']='';
index.php <?php require_once('fr.php'); header('Location:'.abspath().directory()); ?> fr.php <?php require_once('functions.php'); ?> functions.php function abspath() { return
langauage web. I set 3 links, Français... (href=changeLanguage.php?lang=fr,es,en) changLanguage.php session_start(); if(isset($_SESSION['bckTo']) && isset($_GET['lang'])){ $lang
Here is my PHP code: <?php session_start(); if ( !isset($_SESSION['index_visited']) ) { $_SESSION['page2_visited'] =
Here is my index.php <?php session_start(); if($_SESSION['authorizedreferral'] == false){ //login.php sets 'authorizedreferral' to false,
index.php <?php include_once 'lang.php'; ?> lang.php <?php session_start(); header('Cache-control: private'); // IE 6 FIX
In my web admin area I have using very simple logic: session_start(); ob_start(); if(!isset($_SESSION['user'])){
Index.php <?php session_start(); require_once('../inc/db/dbc.php'); include('login_helper.php'); ?> <!-- html form --> Login/Logout Links depending on

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.