Jump to content

Warning: include() [function.include]: failed to open stream


atrum

Recommended Posts

Hello all,

 

I have been tinkering around with building my own dynamic website using php, and I have run into a very odd error.

 

Basically I am attempting to place my functions into a config file, and call that file using an includes statement.

I am really stumped as to why this is breaking :(.

Any assistance is appreciated.

The URL is

[ http://electissimus.com/index.php?section=auth&page=login ]

 

Here are the errors I get when I try to use includes.

 

Warning: include(/auth/inc/config.auth.php) [function.include]: failed to open stream: No such file or directory in /home/cdorris/www/electissimus.com/auth/login.php on line 2

Warning: include() [function.include]: Failed opening '/auth/inc/config.auth.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/cdorris/www/electissimus.com/auth/login.php on line 2

Here is my code for the login script.

 

<?php
session_start();
/*
config file contains functions vital to security

*/
include("/inc/config.auth.php");

$uname=$_POST['txt_uname'];
$passwd=sha1($_POST['txt_passwd']);

if($uname&&$passwd)
{
	$dbu = "dbuser";
	$dbp = "*********";
	$dbh = "localhost";
	$dbd = "db_test";
	$dbt = "ts_membership";

	$sqlconn=mysql_connect($dbh,$dbu,$dbp);
	if(!$sqlconn)
		{
			die('Could not conect: '.mysql_error());
		}
		else
		{
			mysql_select_db($dbd,$sqlconn);
			$query=mysql_query("SELECT * FROM ".$dbt." WHERE mUserName='".$uname."'");
			$numrows=mysql_num_rows($query);

			if($numrows!=0)
			{
				while($rows = mysql_fetch_assoc($query))
				{
					$dbmUID = $rows['mUID'];
					$dbuname = $rows['mUserName'];
					$dbpasswd = $rows['mPassword'];
				}
				if($uname==$dbuname&&$passwd==$dbpasswd)
				{
					$_SESSION['Uname']=$dbuname;
					$_SESSION['UID']=$dbmUID;
					ck_role();
				}
				else
				{
					header('Location: /index.php?section=auth&page=login&err=err1');
				}
			}
			else
			{
				header('location: /index.php?section=auth&page=login&err=err2');
			}
		}

}
else
{ 
	header('Location: /index.php?section=auth&page=login&err=err1');
} 
/*end of if($uname&&$passwd)*/
?>

 

Thanks,

Atrum

Link to comment
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.