How to Create Welcome Page in php – mysql Database

Spread the love

How to Create Welcome Page in php: When we create an account system website, we need a welcome page. This means that the user can go directly to the welcome page after logging in.

On that welcome page we have to display different information of our users. There must be a welcome page on an account system website.

We can publish all the information of a welcome page user through PHP. Since the welcome page is the main page of a user account, it is very important to display all the user information on this page.

For example Username Full name, Date of Birth, Gender, Email ID, Mobile Number, Address, Profile Photo etc.

In today’s article we will learn how to create HTML Welcome Page. Using php codes and MySQL databases, how to display all user information on the welcome page.

The phpmyadmin database is essential for creating a php welcome page. This is because all my user information is stored in this mysql database. We can use it elsewhere as needed. In the same way we will use the stored data on the welcome page.

What is a website welcome page?

Friends is a welcome page, where the user can see all his details or information on the welcome page after logging in to his account.

The welcome page needs to be logged in with the correct password and username. Therefore, the details of each user’s welcome page cannot be seen by any other user.

How to Create Welcome Page in php

Friends, Welcome page can be easily created using PHP. When the user login with his username and password, a session will be started from there and redirected to the welcome page.

One thing to keep in mind is,A session starts when the user is logging in using his username and password. In that session you have to start with a specific data.

Welcome page

This means that using the data we will search everything that the user. If you can start the session using that date, you will get the best results.

For example, we can start a session with all this data when the session starts while logging in after giving username and password – Registration Number, Mobile Number, Email ID, Unique ID etc.

Details coding of login page and welcome page –

Session Start using Email ID –


$emailid = $_POST['emailid'];

    session_start();
	$_SESSION['emailid'] = $emailid;
	echo"<font color='green'>Login Sucessfully...</font>";	
	echo "<script>location='welcome.php'</script>";
	//exit();

Session Start using Mobile no –


$mobileno = $_POST['mobileno'];

    session_start();
	$_SESSION['mobileno'] = $mobileno;
	echo"<font color='green'>Login Sucessfully...</font>";	
	echo "<script>location='welcome.php'</script>";
	//exit();

Session Start using Reg No –


$regno = $_POST['regno'];

    session_start();
	$_SESSION['regno'] = $regno;
	echo"<font color='green'>Login Sucessfully...</font>";	
	echo "<script>location='welcome.php'</script>";
	//exit();

This way, if you can start the session from the login page and send it to the welcome page, all the details of the user can be easily displayed on the welcome page.

Welcome page

The PHP code of the welcome page where we can start the session with different data and take it to the welcome page is described below.

Code for getting data from mysql database in welcome page phpmyadmin. With Email id Session start

<?php  session_start(); ?>

<?php
error_reporting(0);
include('dbconfig.php');
			
$_SESSION = $_SESSION['emailid']; // session start using emailid

$sql = ("SELECT * FROM user_details WHERE emailid='$_SESSION'");
$result = mysqli_query($conn, $sql);
    while($row = mysqli_fetch_assoc($result)) 
    {   
    echo $row['fullname']; echo"<br>";
    echo $row['dateofbirth']; echo"<br>";
    echo $row['gender']; echo"<br>";
    echo $row['address']; echo"<br>";
    }
?>

Code for getting data from mysql database in welcome page phpmyadmin. With Mobile Number Session start

<?php  session_start(); ?>

<?php
error_reporting(0);
include('dbconfig.php');
			
$_SESSION = $_SESSION['mobileno']; // session start using mobile number

$sql = ("SELECT * FROM user_details WHERE mobileno='$_SESSION'");
$result = mysqli_query($conn, $sql);
    while($row = mysqli_fetch_assoc($result)) 
    {   
    echo $row['fullname']; echo"<br>";
    echo $row['dateofbirth']; echo"<br>";
    echo $row['gender']; echo"<br>";
    echo $row['address']; echo"<br>";
    }
?>

Code for getting data from mysql database in welcome page phpmyadmin. With Registration Number Session start

<?php  session_start(); ?>

<?php
error_reporting(0);
include('dbconfig.php');
			
$_SESSION = $_SESSION['regno']; // session start using Registration Number

$sql = ("SELECT * FROM user_details WHERE regno='$_SESSION'");
$result = mysqli_query($conn, $sql);
    while($row = mysqli_fetch_assoc($result)) 
    {   
    echo $row['fullname']; echo"<br>";
    echo $row['dateofbirth']; echo"<br>";
    echo $row['gender']; echo"<br>";
    echo $row['address']; echo"<br>";
    }
?>

So friends, we can start the session in this way and display all the details of the user on the welcome page and we can arrange these codes as per our requirement. This is actually the basic rule that a welcome page is created using php.

Can I create welcome page using HTML?

Yes you can, Friends, The basic structure of the Welcome Page can only be created using the HTML . But no data can be Call or Display from the database.

If you do not have any details displayed on the user’s welcome page. Then you can create a welcome page with HTML.

How do I create a welcome page for my website?

If your website is to be an accounting system then of course your website needs a welcome page.

In this article we have discussed in detail how to create a welcome page using php. But before creating a welcome page, you need to learn how to create a How to Create a Secure php Login Page with MySQL Database and how to create a php Registration Form with Database Code – Signup Form in php.

What should a welcome page include?

Friends, you can add any topic to the welcome page. It all depends on you and your website. If you create an ecommerce website, Then you can add all your products to the welcome page.

You can add all the details of the user with it. It depends on you and your website, There are no rules for this, you can’t add this subject and you can add this subject.

The last few words

Through this short article today I have explained to you how to create a welcome page and how it works. Hope you like today’s article.

If you have any questions about the welcome page, please let us know in the comment box. We will try to resolve your comment as soon as possible.


Spread the love

Leave a Comment