Any error countered here?

|
Gaurav Adhikari 2022-01-12 15:25:50
yes bro solve thanks
Gaurav Adhikari 2022-01-12 18:55:31
codeslide-56092.jpg

ecargsid_eht 2022-01-12 18:56:33
Gaurav Adhikari 2022-01-12 18:55:31

any error countered here?

Gaurav Adhikari 2022-01-12 18:56:41
not Redirect to user dashboard page
Gaurav Adhikari 2022-01-12 18:57:33
only value are post not redirected to dashboard page
ecargsid_eht 2022-01-12 18:59:01
Gaurav Adhikari 2022-01-12 18:57:33
only value are post not redirected to dashboard page

i cannot see the sign in form in ur code

ecargsid_eht 2022-01-12 18:59:15
can u tell me on which page is it?
Gaurav Adhikari 2022-01-12 19:00:06
this one
Gaurav Adhikari 2022-01-12 19:03:45
codeslide-56101.jpg

ecargsid_eht 2022-01-12 19:04:37
Gaurav Adhikari 2022-01-12 19:03:45

The L should be in lowercase in location

Gaurav Adhikari 2022-01-12 19:05:03
ecargsid_eht 2022-01-12 18:59:01
i cannot see the sign in form in ur code

in which line

ecargsid_eht 2022-01-12 19:05:05
Check if this works.. if not, u can also use script tag
ecargsid_eht 2022-01-12 19:05:15
Gaurav Adhikari 2022-01-12 19:05:03
in which line

42

Gaurav Adhikari 2022-01-12 19:06:36
codeslide-56106.jpg

Gaurav Adhikari 2022-01-12 19:06:50
not redirect to dashboard
Gaurav Adhikari 2022-01-12 19:07:10
codeslide-56108.jpg

Vashees 2022-01-12 19:08:08
Gaurav Adhikari 2022-01-12 19:06:50
not redirect to dashboard

Once Check with Java script window.location

ecargsid_eht 2022-01-12 19:08:49
Gaurav Adhikari 2022-01-12 19:07:10

Replace ur header() code in line 42 with

Vashees 2022-01-12 19:11:49
echo ‘<script>window.location=””;</script>’
Vashees 2022-01-12 19:12:25
Location me url daal do
2022-01-12 19:15:38
if($rows>0) on line 39
2022-01-12 19:16:22
if($rows)
ecargsid_eht 2022-01-12 19:16:30
2022-01-12 19:15:38
if($rows>0) on line 39

Ohh.. I missed that oneπŸ˜‚

2022-01-12 19:16:45
Then it will work definatly
ecargsid_eht 2022-01-12 19:16:49
2022-01-12 19:15:38
if($rows>0) on line 39

Gaurav

2022-01-12 19:16:56
Definitely*
Gaurav Adhikari 2022-01-12 19:18:15
codeslide-56121.jpg
if header code remove then how page redirect
Gaurav Adhikari 2022-01-12 19:18:33
not redirect to dashboard page
Santosh Gautam 2022-01-12 19:18:37
Gaurav Adhikari 2022-01-12 19:07:10

Line no 38 use while loop

Santosh Gautam 2022-01-12 19:19:23
Line no. 38 use this query
ecargsid_eht 2022-01-12 19:19:25
Gaurav Adhikari 2022-01-12 19:18:15
if header code remove then how page redirect

Script does the same thing

Gaurav Adhikari 2022-01-12 19:19:52
<?php
require(‘db.php’);
session_start();
// When form submitted, check and create user session.
if (isset($_POST[‘username’])) {
$username = stripslashes($_REQUEST[‘username’]); // removes backslashes
$username = mysqli_real_escape_string($con, $username);
$password = stripslashes($_REQUEST[‘password’]);
$password = mysqli_real_escape_string($con, $password);
// Check user is exist in the database
$query = “SELECT * FROM users WHERE username=’$username’
AND password='” . md5($password) . “‘”;
$result = mysqli_query($con, $query) or die(mysql_error());
$rows = mysqli_num_rows($result);
if ($rows>0) {
$_SESSION[‘username’] = $username;
// Redirect to user dashboard page
header(“location: dashboard.php”);
} else {
echo “<div class=’form’>
<h3>Incorrect Username/password.</h3><br/>
<p class=’link’>Click here to <a href=’login.php’>Login</a> again.</p>
</div>”;
}
}
?>
Gaurav Adhikari 2022-01-12 19:20:13
help me to redirect to dashboard page
2022-01-12 19:20:20
Still it’s not redirecting?
Vashees 2022-01-12 19:22:09
First check with echo if ist echo somthing then confirm reduction issue
|