Page 1 of 1
Advanced PHP Protection - Password script
Posted: Wed Jun 01, 2011 4:01 pm
by pbasu
I bought this PHP script on Code Canyon :
http://codecanyon.net/item/advanced-php ... tion/99823
It works great on one of my websites, but on another site with a different server, I get the following error after I enter the login credentials:
Fatal error: Call to a member function brute_force_protect() on a non-object in /usr/local/pem/vhosts/263173/webspace/httpdocs/index.php on line 8
Does anyone have any suggestions?
Thanks a lot!
Re: Advanced PHP Protection - Password script
Posted: Wed Jun 01, 2011 4:06 pm
by EcazS
It's hard to see where you made a mistake when you don't even post the code you're using.
Re: Advanced PHP Protection - Password script
Posted: Wed Jun 01, 2011 4:18 pm
by pbasu
Sorry about that! Meant to paste it at the bottom:
<?php
include('secure/security.class.inc.php');
$pass = new secure;
$pass->set_credentials('admin', 'lemon');
$pass->custom_session_keys('name', 'pass');
$pass->brute_force_protect();
$pass->protect();
if (isset($_GET['logout'])){
$pass->logout();
header('Location: index.php');
die();
}
?>
<!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=utf-8" />
<title>Advanced PHP Protect Example</title>
</head>
<body>
<a href="?logout=1">Logout</a> | <a href="readme.php">Documentation</a>
<br />
<hr />
<br />
<?php
highlight_file('index.php');
?>
</body>
</html>
Re: Advanced PHP Protection - Password script
Posted: Wed Jun 01, 2011 4:22 pm
by Kamal
thats weird o.O no typos or such thing.. make sure the function name is correct as i havent seen the source of seucrity.class.inc.php

Re: Advanced PHP Protection - Password script
Posted: Wed Jun 01, 2011 4:25 pm
by jacek
Kamal wrote:make sure the function name is correct as i havent seen the source of seucrity.class.inc.php

That would be call to undefined method I think. Either way it is correct

It does seem weird though
Well the code looks okay, in fact it looks like the example code that comes with the item
What php version are you using ? And are you using the most recent version of the script ?
It may be worth trying
$pass = new secure();
with the (), but that should not be the problem.
Re: Advanced PHP Protection - Password script
Posted: Wed Jun 01, 2011 4:29 pm
by Kamal
I wasn't requesting that you post it, just don't do that again. I just said I wouldn't know the problem because I didn't buy it.
Btw jacek you may feel ok that I didn't save it or something

Re: Advanced PHP Protection - Password script
Posted: Wed Jun 01, 2011 4:46 pm
by pbasu
jacek, i figured i messed something up so i went back to the example

But, I was able to get it working in single line mode, which is fine for my purposes.
thanks everyone for helping out with this!
Re: Advanced PHP Protection - Password script
Posted: Wed Jun 01, 2011 4:52 pm
by jacek
strange, but that's good news, glad you got it working
