e help me with my code? I am trying to get the user's full_name through the login info that was provided (email and password) but it shows an error. I want to show the user's name that corresponds to the email and password. For example, email: iya@gmail.com password: starlight-subtly-causal-dynamic then the welcome.php will show a message like this "Welcome, Iya Salvador!" login.php Pexzbook
e help me with my code? I am trying to get the user's full_name through the login info that was provided (email and password) but it shows an error. I want to show the user's name that corresponds to the email and password. For example, email: iya@gmail.com password: starlight-subtly-causal-dynamic then the welcome.php will show a message like this "Welcome, Iya Salvador!" login.php Pexzbook
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question
Hi! Please help me with my code? I am trying to get the user's full_name through the login info that was provided (email and password) but it shows an error. I want to show the user's name that corresponds to the email and password. For example, email: iya@gmail.com password: starlight-subtly-causal-dynamic then the welcome.php will show a message like this "Welcome, Iya Salvador!"
login.php
<!DOCTYPE html>
<html>
<head>
<title> Pexzbook </title>
<link rel="stylesheet" href="css\style.css" />
<style>
.footer{
margin-top: 173px;
background-color: #4f81bd;
padding: 35px;
}
.field{
margin-bottom: 15px;
margin-left: 33px;
}
.field2{
margin-bottom: 15px;
}
#email{
color: black;
margin-left:40px;
margin-bottom: 15px;
}
#form{
float: right;
margin-right: 80px;
margin-bottom: 80px;
}
div.col-1 img{
width: 699px;
padding-top: 80px;
padding-left: 50px;
}
.input {
color: black;
}
</style>
</head>
<body>
<div class="container">
<div class="navbar" style="background-color: #4f81bd;">
<img src="images\pexzbook.png" />
</div>
<div class="row">
<div class="col-1">
<img src="images\map.png" />
</div>
<div id="form">
<form action="login.php" method="post">
<p class="input">
<label><b>Email:</b></label>
<input type="text" class="field" id="email "name="email" size="35">
</p>
<p class="input">
<label><b>Password:</b></label>
<input type="password" class="field2" name="password" size="35">
</p>
<input type="submit" id="btn" name="login" value="Login" size="15">
</form>
</div>
</div>
<div class="footer"> </div>
<?php
require ("connection.php");
if (isset($_POST['login'])){
$email = $_POST['email'] ;
$password = $_POST['password'];
$result = mysqli_query($conn, "SELECT * FROM account WHERE email = '$email' AND password = '$password' ");
$row = mysqli_fetch_array($result);
if (is_array($row)){
$_SESSION["email"] = $row ['email'];
$_SESSION["password"] = $row ['[password]'];
} else{
echo '<script type = "text/javascript">';
echo 'alert("Incorrect Email or Password!");';
echo 'window.location.href = "login.php"';
echo '</script>';
}
}
if(isset($_SESSION["email"])){
header("Location:welcome.php");
}
?>
</body>
</html>
welcome.php
<?php
session_start();
?>
<!DOCTYPE html>
<html>
<head>
<title> Welcome</title>
</head>
<body>
<h3> Welcome </h3>
<?php echo $row ['full_name']; ?>
</body>
</body>
style.css
*{
margin: 0%;
padding: 0%;
font-family: 'Roboto', sans-serif;
box-sizing: border-box;
}
.navbar {
background-color: #4f81bd;
}
.navbar img{
width: 800px;
}
div.col-1{
width: 60%;
}
.container {
max-width: auto;
margin: auto;
}
#btn {
background-color: #71a8d8;
border: none;
color: white;
padding: 10px 20px;
text-align: center;
float: right;
text-decoration: none;
font-size: 17px;
}
![+ Options
account_ID
email
password
full_name
Edit 3i Copy
Delete
1 iya@gmail.com starlight-subtly-causal-dynamic lya Salvador
Edit 3i Copy
Delete
2 ivy@gmail.com durable-exhume-eggnog-recant Ivy Riego
O Check all
With selected:
Edit
i Copy
O Delete
Export](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1c5f6061-4612-4ab8-abf6-3abaf9955c16%2Fce62f267-84d7-4a7c-9692-8d66d9968a8a%2Fggv5nmq_processed.jpeg&w=3840&q=75)
Transcribed Image Text:+ Options
account_ID
email
password
full_name
Edit 3i Copy
Delete
1 iya@gmail.com starlight-subtly-causal-dynamic lya Salvador
Edit 3i Copy
Delete
2 ivy@gmail.com durable-exhume-eggnog-recant Ivy Riego
O Check all
With selected:
Edit
i Copy
O Delete
Export
![O localhost/pexzbook/welcome.php
Welcome
Warning: Undefined variable Srow in C:\xampp\htdocs\pexzbook\welcome.php on line 12
Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\pexzbook\welcome.php on line 12](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F1c5f6061-4612-4ab8-abf6-3abaf9955c16%2Fce62f267-84d7-4a7c-9692-8d66d9968a8a%2F3m1msj5_processed.jpeg&w=3840&q=75)
Transcribed Image Text:O localhost/pexzbook/welcome.php
Welcome
Warning: Undefined variable Srow in C:\xampp\htdocs\pexzbook\welcome.php on line 12
Warning: Trying to access array offset on value of type null in C:\xampp\htdocs\pexzbook\welcome.php on line 12
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Computer Networking: A Top-Down Approach (7th Edi…](https://www.bartleby.com/isbn_cover_images/9780133594140/9780133594140_smallCoverImage.gif)
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
![Computer Organization and Design MIPS Edition, Fi…](https://www.bartleby.com/isbn_cover_images/9780124077263/9780124077263_smallCoverImage.gif)
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
![Network+ Guide to Networks (MindTap Course List)](https://www.bartleby.com/isbn_cover_images/9781337569330/9781337569330_smallCoverImage.gif)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
![Concepts of Database Management](https://www.bartleby.com/isbn_cover_images/9781337093422/9781337093422_smallCoverImage.gif)
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
![Prelude to Programming](https://www.bartleby.com/isbn_cover_images/9780133750423/9780133750423_smallCoverImage.jpg)
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
![Sc Business Data Communications and Networking, T…](https://www.bartleby.com/isbn_cover_images/9781119368830/9781119368830_smallCoverImage.gif)
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY