Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.