fattal error

fashionassb

New member
Joined
Dec 27, 2019
Messages
10
Points
1
Greetings to everyone,

I have a php webiste which its change password page is displaying blank / white page and i got this in the error log :

Failed opening required 'lib/config.php' (include_path='.:/opt/cpanel/ea-php56/root/usr/share/pear')

The page code is below :

<?php
/**
* index.php
*
* Main user page after login
*/

require_once 'lib/config.php';
require_once 'lib/functions.php';
require_once 'lib/opendb.php';
require_once 'lib/checkUser.php';

$errorMessage = '';
if (isset($_POST['btnModify'])) {
$userId = $_SESSION['userId'];
$oldPassword = $_POST['txtOldPassword'];
$newPassword = $_POST['txtNewPassword1'];

$sql = "SELECT userId FROM tbl_user WHERE userId = $userId AND password = PASSWORD('$oldPassword')";
$result = mysql_query($sql) or die(mysql_error());
if (mysql_num_rows($result) != 1) {
$errorMessage = 'Old password is incorrect';
} else {
$sql = "UPDATE tbl_user
SET password = PASSWORD('$newPassword')
WHERE userId = $userId";
mysql_query($sql) or die('Modify failed. ' . mysql_error());
header('Location: index.php');
exit;
}
}

$pageTitle = 'Change Password';
require_once 'lib/header1.php';
?>
<p align="center"><strong><font color="#660000"><?php echo $errorMessage; ?></font></strong></p>
<form action="<?php echo $_SERVER['REQUEST_URI']; ?>" method="post" name="frmPassword" id="frmPassword">
<table width="550" border="0" align="center" cellpadding="2" cellspacing="1" class="whiteTable">
<tr>
<td width="150" align="left" valign="top">Old Password</td>
<td width="10" align="left" valign="top">:</td>
<td align="left" valign="top">
<input name="txtOldPassword" type="password" class="box" id="txtOldPassword" size="20" maxlength="20"></td>
</tr>
<tr>
<td width="150" align="left" valign="top">New Password</td>
<td width="10" align="left" valign="top">:</td>
<td align="left" valign="top"><input name="txtNewPassword1" type="password" class="box" id="txtNewPassword1" size="20" maxlength="20"></td>
</tr>
<tr>
<td width="150" align="left" valign="top">Repeat New Password</td>
<td width="10" align="left" valign="top">:</td>
<td align="left" valign="top">
<input name="txtNewPassword2" type="password" class="box" id="txtNewPassword2" size="20" maxlength="20">
<small> </small></td>
</tr>
<tr>
<td width="150"> </td>
<td width="10"> </td>
<td> </td>
</tr>
<tr>
<td colspan="3"><div align="center">
<input name="btnModify" type="submit" class="bluebox" id="btnModify" value="Submit" onClick="return checkPassword();">
  
<input name="btnCancel" type="button" class="bluebox" id="btnCancel" onClick="window.location.href='listUser.php';" value="Cancel">
</div></td>
</tr>
<tr>
<td colspan="3"> </td>
</tr>
</table>
</form>
<script language="JavaScript" type="text/javascript">
function checkPassword()
{
theForm = window.document.frmPassword;

if (theForm.txtOldPassword.value == '') {
alert('Enter current password');
theForm.txtOldPassword.focus();
return false;
} else if (theForm.txtNewPassword1.value == '') {
alert('Enter new password');
theForm.txtNewPassword1.focus();
return false;
} else if (theForm.txtNewPassword2.value == '') {
alert('Repeat new password');
theForm.txtNewPassword2.focus();
return false;
} else if (theForm.txtNewPassword1.value != theForm.txtNewPassword2.value) {
alert('New password don\'t match');
theForm.txtNewPassword2.focus();
return false;
} else {
return true;
}
}
</script>
<?php
require_once 'lib/footer1.php';
?>



==================================


Please help me with solution. Thank you I apreciate
 

Rob Whisonant

Moderator
Joined
May 24, 2016
Messages
2,481
Points
113
The error is telling you the problem. The config.php file is not in the lib folder above the running script.

Navigate to the directory the script is running in.

1. Is there a lib folder in that directory?
2. If so, is there a config.php file in the lib folder?
 

BillEssley

WMS Marketplace Seller
Joined
Feb 19, 2013
Messages
195
Points
18
Have you check file lib/config.php ?
or the problem can come from PHP version, I would suggest you to change to PHP 7 and retry your web script.
 

fashionassb

New member
Joined
Dec 27, 2019
Messages
10
Points
1
Thank you the problem came from the PHP version and also had to create a "lib" folder . Thank you very much appreciated

Thank you. I create a lib folder and updated the php version and that solved it
 
Newer threads
Replies
10
Views
4,425
Replies
2
Views
2,029
Replies
6
Views
2,771
Replies
5
Views
1,918
Latest threads
Replies
2
Views
95
Replies
1
Views
181
Replies
5
Views
390
Replies
11
Views
540
Replies
2
Views
232

Latest postsNew threads

Referral contests

Referral link for :

Sponsors

Popular tags

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.

Top