Jump to content

Header Error


ryanfilard

Recommended Posts

I have been trying to fix this for a really long time. It does not show an error on my local server but on my demo server it does.'

What am I doing wrong?

 

I have tried changing the location of the default.php file. I even tried require_once and require. Nothing worked.

 

try logging in with random details with this link. You will see the error.

http://goo.gl/3IetJ

 

default.php

<?php
$hostname_default = "localhost";
$database_default = "mypass";
$username_default = "my_user";
$password_default = "my_pass";
$default = mysql_pconnect($hostname_default, $username_default, $password_default) or trigger_error(mysql_error(),E_USER_ERROR); 
?>

login.php

<?php
if (!isset($_SESSION))
{
   session_start();
}
if (!empty($_REQUEST['password']))
{
     include("../Connections/default.php");
     $username = $_REQUEST['username'];
     $password = md5(md5($_REQUEST['password'])+salt);
     mysql_select_db($database_default, $default);
     $login_check = "SELECT * FROM users WHERE username = '$username' AND password = '$password'";
     $login = mysql_query($login_check, $default) or die(mysql_error());
 $row_login = mysql_fetch_assoc($login);
 $val_login = mysql_num_rows($login);
 if ($val_login == '1')
 {
	 $_SESSION['E_User'] = $row_login['username'];
	 header('Location: index.php');
 }
 else
 {
	 header('Location: login.php?error=1&username='.$username.'');
 }
}
?>

Link to comment
https://forums.phpfreaks.com/topic/259017-header-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.