PDA

View Full Version : Login



lillizzierae
September 11th, 2007, 12:42 AM
I'm building a login and getting errors. I'm using dreamweaver 8 to build it. Whenever I go to the page I get this error:

Warning: require_once(Connections/personalsite.php) [function.require-once (http://lizzienichols.com/function.require-once)]: failed to open stream: No such file or directory in /home/lizzieni/public_html/work.php on line 1

Fatal error: require_once() [function.require (http://lizzienichols.com/function.require)]: Failed opening required 'Connections/personalsite.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/lizzieni/public_html/work.php on line 1


What confuses me is it's saying "personalsite.php" personalsite is only what I named my connection for MySQL Connection. The database is "website" and the table is "newmember" And "work.php" is where the login is located. What am I doing wrong? as of now, this is the code:


<?php require_once('Connections/personalsite.php'); ?>
<?php
// *** Validate request to login to this site.
if (!isset($_SESSION)) {
session_start();
}

$loginFormAction = $_SERVER['PHP_SELF'];
if (isset($_GET['accesscheck'])) {
$_SESSION['PrevUrl'] = $_GET['accesscheck'];
}

if (isset($_POST['reemail'])) {
$loginUsername=$_POST['reemail'];
$password=$_POST['password'];
$MM_fldUserAuthorization = "";
$MM_redirectLoginSuccess = "index.php";
$MM_redirectLoginFailed = "index.php";
$MM_redirecttoReferrer = false;
mysql_select_db($database_personalsite, $personalsite);

$LoginRS__query=sprintf("SELECT reemail, password FROM newmember WHERE reemail='%s' AND password='%s'",
get_magic_quotes_gpc() ? $loginUsername : addslashes($loginUsername), get_magic_quotes_gpc() ? $password : addslashes($password));

$LoginRS = mysql_query($LoginRS__query, $personalsite) or die(mysql_error());
$loginFoundUser = mysql_num_rows($LoginRS);
if ($loginFoundUser) {
$loginStrGroup = "";

//declare two session variables and assign them
$_SESSION['MM_Username'] = $loginUsername;
$_SESSION['MM_UserGroup'] = $loginStrGroup;

if (isset($_SESSION['PrevUrl']) && false) {
$MM_redirectLoginSuccess = $_SESSION['PrevUrl'];
}
header("Location: " . $MM_redirectLoginSuccess );
}
else {
header("Location: ". $MM_redirectLoginFailed );
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Elizabeth Nichols - Portfolio</title>

<link href="css.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="css/lightbox.css" type="text/css" media="screen" />

<script type="text/javascript" src="js/prototype.js"></script>
<script type="text/javascript" src="js/scriptaculous.js?load=effects"></script>
<script type="text/javascript" src="js/lightbox.js"></script>

<style type="text/css">

#container1 {
font-family: "Times New Roman", Times, serif;
font-size: 14px;
color: #FFFFFF;
margin-right: 70px;
margin-left: 80px;
padding: 3px;
background-color: #000000;
background-image: url(images/nichols_back.png);
background-repeat: no-repeat;
background-position: top center;
height: 1300px;
width: 800px;
}

#footer_container1 {
margin-top: 10px;
margin-bottom: 10px;
position:absolute;
left:108px;
top:1270px;
font-size: 10px;
width: 258px;
height: 21px;
}

#body3 {
position:absolute;
left:266px;
top:672px;
text-align: left;
float: left;
height: 486px;
width: 479px;
background-color: #333333;
}

a:link {
color: #000000;
text-decoration: none;
}
a:visited {
color: #000000;
text-decoration: none;
}
a:hover {
color: #000000;
text-decoration: none;
}
a:active {
color: #000000;
text-decoration: none;
}
</style>
</head>

<body id="body">
<div id="container1">
<div id="login">
<form action="<?php echo $loginFormAction; ?>" method="POST" name="login">
Email Address:<br />
<input name="reemail" type="text" size="18" maxlength="30" />
<br />
Password:<br />
<input name="password" type="password" size="18" maxlength="30" />
</form>
<br />
<p align="center"><a href="newmembers.php"><input name="new" type="button" value="New" /></a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input name="submit" type="submit" value="Login" />
</p>
</div>

kaykays
September 11th, 2007, 12:55 AM
Do you have a Folder named work.php or a file named work.php?

If work.php is the name of a Folder, change it to work-php or something like that.

lillizzierae
September 11th, 2007, 12:58 AM
work.php is the file (the webpage) that the login is located.

hl
September 11th, 2007, 01:54 AM
Eh. That name had nothing to do with anything. It was just the file being run.

What you want to check is that the directory Connections exists in the folder the file is being run in and personalsite.php is in that folder. Connections might have to be case sensitive, depends on your setup.

If that's all dandy, try using require_once("./Connections/personalsite.php");