Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
| Search | Today's Posts | Mark Forums Read
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 28th, 2004, 07:06 PM
Registered User
 
Join Date: Dec 2003
Location: Falls Church, VA, USA.
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default Help with require_once...

:(

Hi guys, I need help with the following problem please...
<?php
require_once("../config.inc");
if((ereg("^[[:alnum:]]+$", $HTTP_POST_VARS[username]))AND(eregi
("^[[:alnum:]]{8,8}$", $HTTP_POST_VARS[password])))
{
$query="SELECT user_id, first_name, password FROM users WHERE username='$HTTP_POST_VARS[username]'";
$query_result=mysql_query($query, $db_connection)or die(mysql_error());
$result=@mysql_fetch_array($query_result);
if((crypt($password, $result[password]))==$result[password]){
session_start();
$user_id=$result[0];
$first_name=$result[1];
session_register('user_id');
session_register('first_name');
header("Location:index.php");
exit;
}else{
$message=urlencode("The username and password submitted do not match those on file. Please try again.");
}
}else{
$message=urlencode("Please enter your username and password to log in.");
}
header("Location:index.php?error_message=$message" );
exit;
?>

...that's the code.
The problem is everytime I tried to open my code with http://localhost, it always gives me an error code saying:
FATAL error include path(';c:\php4\pear'), but I already change the php.ini.dist to my folder, which is d:\php\pear but apparently it still won't work. I also shut down the apache and mysql service before I changed the php.ini...but the result remain the same.

Please help...and thank you in advance...



 
Old March 1st, 2004, 01:57 PM
Friend of Wrox
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Sorry, I don't know the answer to your problem, but $HTTP_WHATEVER_VARS is depreciated and should be replaced with $_WHATEVER, for example $HTTP_POST_VARS is $_POST. This is all unless you are using an older version of PHP, and if so I would look into a newer version...

Hope you find a solution to your problem.

----------
---Snib---
----------
 
Old March 1st, 2004, 09:44 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your include path looks screwy. Also, the error message you posted doesn't look complete. Please post the entire error message.


Take care,

Nik
http://www.bigaction.org/




Similar Threads
Thread Thread Starter Forum Replies Last Post
nusoap and require_once garbiner PHP How-To 1 May 29th, 2005 04:20 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.