Web Hosting Talk







View Full Version : script not functionning properly after being encoded with ionCube


latheesan
10-03-2007, 12:05 AM
Hello,

I used ionCube online encoder to encode my project files. It seems, the script is not functionning propely after encoding it.

I have a login form which checks; if entered username/pass is correct (matching it against db records), if so set session variables like this:

$_SESSION[session_id()."_user"] = $_POST["user"];
$_SESSION[session_id()."_pass"] = $_POST["pass"];

Note, the above session variables only get set if it was a successfull login. Then later in my php file, where user have to be logged in, i did a check like this:

$query = sprintf("SELECT * FROM `login_table` WHERE `user` = '%s' AND `pass` = '%s' LIMIT 1",
mysql_real_escape_string($_SESSION[session_id()."_user"]),
mysql_real_escape_string(md5($_SESSION[session_id()."_pass"])));

$results = mysql_query($query);
if(mysql_num_rows($results) == 0) {

// login error here

} else {

// show the contents of the protected page

}

You see, the above setup worked fine on the locahost (my laptop with XAMPP suite installed) when i was developing the script. After encoding the script, i uploaded it to my linux server and i logged into the script and clicked on the admin page for example, it gave me the login error, which is wrong.

Why is the script acting up like this? Did the script screw up somehow because i encoded it with ionCube? Please help...

Jatinder
10-03-2007, 05:02 AM
Does the un-encoded script fine on your server? Are you sure the script stops working only after encoding?

I would suggest that you first upload the un-encoded version of the script to your server to check whether the problem lies with your script or ioncube.

latheesan
10-03-2007, 12:40 PM
Oh my! me and my stupid typos. In the login script, i accidently md5'ed the password twice.

For some wierd reason, XAMPP is not bothered by it and it works fine >_>