Hello all,
Recently i uploaded the website which worked just fine on localhost. I changed the dbconfig and uploaded the files in the exact order they were on localhost. First, i had no index.php page, so i went ahead and renamed the pages a bit and changed the directions. The way i have it set up now is that what used to be a login.php page is now index.php so that page could load properly. After successful login, it should redirect the user to schedule.php page which is located in the same folder. Each time the form is submitted, i get redirected to 404 error, regardless of the credentials being correct or false.
At first i had issues where the login page was named login.php and after successful login it would just reload the login.php page. If there were wrong credentials, it would actually pop up the wrong credentials error. Not sure how to get around this, please assist. Let me know if i should gather any more information.
Thanks in advance!
@Bukovski said:
Hello all,
Recently i uploaded the website which worked just fine on localhost. I changed the dbconfig and uploaded the files in the exact order they were on localhost. First, i had no index.php page, so i went ahead and renamed the pages a bit and changed the directions. The way i have it set up now is that what used to be a login.php page is now index.php so that page could load properly. After successful login, it should redirect the user to schedule.php page which is located in the same folder. Each time the form is submitted, i get redirected to 404 error, regardless of the credentials being correct or false.
At first i had issues where the login page was named login.php and after successful login it would just reload the login.php page. If there were wrong credentials, it would actually pop up the wrong credentials error. Not sure how to get around this, please assist. Let me know if i should gather any more information.
Thanks in advance!
Can you give a link to your website, so that we can check?
Hello Chris,
Of course, the link would be http://susupport.epizy.com/index.php
Thank you very much !
@Bukovski said:
Hello Chris,
Of course, the link would be http://susupport.epizy.com/index.php
Thank you very much !
I found your problem.
Right now, you code sends users to login.php after putting credentials, and of course login.php no longer exists so it doesn’t work.
<form action="**login.php**" method="POST">
Change that to schedule.php and you are set to go!
Sorry for late answer but I am busy. I put the stars to emphasize. I copied the string from your code.
Good Luck :smiley:
@ChrisPAR said:
I found your problem.
Right now, you code sends users to login.php after putting credentials, and of course login.php no longer exists so it doesn’t work.
<form action="**login.php**" method="POST">
Change that to schedule.php and you are set to go!
Sorry for late answer but I am busy. I put the stars to emphasize. I copied the string from your code.
Good Luck :smiley:
Thank you for that, that was a rookie mistake haha
However, it did fix the issue with the form submission, but now i am back at the same problem where the wrong credentials error pops up if the credentials are wrong, and if t hey are all good, it goes to a non-existing page. This is the php code from the login form (index.php page)
<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
include("config.php");
***** if(isset($_SESSION['login_user_id']) && $_SESSION['login_user_id'] > 0) {
header('location: schedule.php');
die();
}******
if($_SERVER["REQUEST_METHOD"] == "POST") {
$username = mysqli_real_escape_string($db, $_POST['username']);
$password = md5($_POST['password']);
$sql = "SELECT * FROM users WHERE Username = '$username' AND password = '$password' LIMIT 0,1";
$result = mysqli_query($db, $sql);
$row = mysqli_fetch_array($result, MYSQLI_ASSOC);
$active = $row['is_active'] == 0;
$count = mysqli_num_rows($result);
if($count == 1) {
if(!$active) {
$error = "Your account is suspended.";
}
$_SESSION['login_user_id'] = $row['Id'];
****** header("location: schedule.php"); ********
die();
} else {
$error = "Invalid Credentials";
}
}
?>
It’s still an issue with the redirection there, if i try to access susupport.epizy.com/schedule.php directly from the url browser, it will recognize from my session that i am logged in and allow me to operate through the site
@Bukovski said:
It’s still an issue with the redirection there, if i try to access susupport.epizy.com/schedule.php directly from the url browser, it will recognize from my session that i am logged in and allow me to operate through the site
OK, can you create an account for me there so that I can check the error myself?
@ChrisPAR said:
OK, can you create an account for me there so that I can check the error myself?
I would love to, but i don’t know how would i do that. Is there any related topic about having multiple accounts accessing the same cpanel ? Sorry if i’m giving you frustrations, i’m pretty new to everything 
@Bukovski said:
@ChrisPAR said:
OK, can you create an account for me there so that I can check the error myself?
I would love to, but i don’t know how would i do that. Is there any related topic about having multiple accounts accessing the same cpanel ? Sorry if i’m giving you frustrations, i’m pretty new to everything 
I mean create an account on your website, SU support, with credentials for me!
Send at [email protected]
@ChrisPAR said:
I mean create an account on your website, SU support, with credentials for me!
Send at [email protected]
Oh, i see, thank you, i’ve created and sent the e-mail
@ChrisPAR said:
I mean create an account on your website, SU support, with credentials for me!
Send at [email protected]
Chris, thank you for all the help, i finally found what was the issue…it was an uppercase letter in my session php file…hahaha i can’t believe it hahaha
Sorry for wasting your time, honeslty
@Bukovski said:
@ChrisPAR said:
I mean create an account on your website, SU support, with credentials for me!
Send at [email protected]
Chris, thank you for all the help, i finally found what was the issue…it was an uppercase letter in my session php file…hahaha i can’t believe it hahaha
Sorry for wasting your time, honeslty
No problem, I’m glad I could help you on this even for a bit and that now your problem is resolved.
Good Luck with your site 