fattal error

fashionassb

New member
Joined
Dec 27, 2019
Messages
8
Points
0
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
 

BillEssley

Member
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
8
Points
0
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
2,576
Replies
2
Views
1,005
Replies
6
Views
1,325
Replies
5
Views
1,044
Latest threads
Replies
0
Views
10
Replies
0
Views
25
Replies
1
Views
44

Referral contests

Referral link for :

Sponsors

Latest Blog ArticlesMost Viewed Threads

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