...

View Full Version : Need help with .TMP/Cache of script



Ultima-X97
10-02-2007, 11:20 PM
Okay will this is the problem: I have a script and it is installed and configured correctly. But when I go to the admin login panel and type the correct pass/user name (i am 100% sure they are right, I checked the SQL) the admin login page reloads and doesn't take me anywhere. On my previous host (bryansoft.com) it worked perfectly, when I moved to other hosts it didn't work.

I heard somewhere that the problem is that

"session_save_path"

is not working correctly. So then I went on creating a .tmp folder in my home dir and it still didnt work. I also learned that this is a common problem among scripts.

Here read it here
http://www.subdreamer.com/forum/showthread.php?t=1885

He is having the same problem as me. Please help someone, there has to be a way.

(and yes, I cleared cache, cookies, disabled firewall/av, and tested it on 2 pcs)

CFMaBiSmAd
10-02-2007, 11:46 PM
You may or may not have the exact same problem. Check your web server log for errors and/or turn on full php error reporting to find out if there are any errors that identify what is causing the problem.

If the issue is that sessions are not working due to an improper or missing setting, it is best to make the change globally using a .htaccess file.

Just creating a tmp folder won't necessarily correct anything if php is not told to use that folder. But first, find out why it is not working. There are many things that can cause the same symptom. It is highly unlikely that a web host would not have setup php with sessions in working order.

Also, please provide the type of operating system, web server type and version, and php version.

Ultima-X97
10-03-2007, 12:07 AM
Alright here well the settings are

Unix
Apache 1.3.37
PHP Version 4.44
MySQL 5
phpMyAdmin

My error log (cpanel) doesn't say anything about the script that isn't working. (its an SMS script in a dir called /sms and I couldnt find anything like that in the error log)

CFMaBiSmAd
10-03-2007, 12:47 AM
Without some specific information as to what it is doing, it is not going to be possible to do more than guess what the problem is.

My current guess would be that the script is dependent on register globals. If the script has a list of server requirements/settings, check those against your current server/php settings.

Is the domain that it is on now the same and are the web folder paths the same as what they where when it was working? You might check if there is a configuration file or a configuration table in the database and see if there is an absolute file system path setting that would be different now that you are on a different server.

You should probably contact the author of the script or visit the support forum for that script. If the problem you are experiencing is a common one, there is likely a posted solution.

For anyone here to be able to begin to help, you would need to post the code responsible for the admin login page.

Ultima-X97
10-03-2007, 02:20 AM
Well let me give you more of a ho-down towards what is going down. It believe it has something to do with the mySQL because the admin login page is not the only thing that isnt working. When you login to the regular panel, many varaibles (such as usernames, amount of sms credits) is not showing up

ex: "Welcome ! You currently have sms credits left!"

I dont have the option of going to the designer and requirements do match. When I moved, I moved everything acessable by webbrowser. (ex. everything in public_html and cpanel database backups)

The admin page login code is:

<?
if ($login == "yes")
{
include "mysql.php";
$password = mysql_real_escape_string($_POST[password]);
$username = mysql_real_escape_string($_POST[username]);
$username = strtolower($username);


$check = mysql_query("SELECT username FROM superior WHERE username = '$username'");
if(mysql_num_rows($check) == 0) {$error[] = 'Login failed'; };

if (!$error){
$check = mysql_query("SELECT password FROM superior WHERE username = '$username'");
$row = mysql_fetch_row($check);
if ($password != $row[0]) {$error[] = 'Login failed'; };
}


// login process
if (!$error){
session_start();
$_SESSION['admin'] = $username;
$dt = date("F j, Y, g:i a");
mysql_query("UPDATE superior SET lastlogin = '$dt' WHERE username = '$username'");
header("Location: index.php");
}
else
{
echo "Login error, your IP has been logged!";
}
exit;
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Administrator Login</title>
<style type="text/css" media="all">
@import "main.css";
</style>

</head>

<body>

<form method="POST" action="login.php?login=yes">
<p align="center">&nbsp;</p>
<p align="center"><span class="o">Username:</span>
<input name="username" type="text" class="o" size="20">
</p>
<p align="center"><span class="o">Password:</span>
<input name="password" type="password" class="o" size="20">
</p>
<p align="center"><input name="B1" type="submit" class="o" value="Submit">
<input name="B2" type="reset" class="o" value="Reset">
</p>
</form>
<p align="center">&nbsp;</p>

</body>

</html>

CFMaBiSmAd
10-03-2007, 03:27 AM
The posted code has at least two problems that makes it non-portable between different server settings. It is dependent on register globals being on and it uses short open tags. (Had it been properly written using full opening php tags and no dependency on register globals, it would work on any combination of those two settings. No new code written after 2002 should have relied on register globals being on.)

If you don't want to take the time now to correct the code (when PHP6 comes out, this code will stop working all together if the register globals dependency is not fixed by that time) in the short term, you can use a .htaccess file to turn on register globals and enable short open tags. Place the following two lines into a .htaccess file that is in the starting folder where this script is installed -

php_value short_open_tag on
php_value register_globals onIt is possible that the web host has prevented these settings from being made in a .htaccess file. If so, you are SOL unless you re-write portions of the code that are not working.

You might have a database issue as well.

Ultima-X97
10-04-2007, 01:14 AM
You are a true coding genius my friend. All I did was create the .htaccess just as you said and boom it worked. Thank you!

ravichandrar
06-22-2010, 02:16 PM
Hi,

I have the same issue, unable to login admin area. could you please let me know how to fix it.

Thanks,
Ravi

ravichandrar
06-22-2010, 02:34 PM
You are a true coding genius my friend. All I did was create the .htaccess just as you said and boom it worked. Thank you!
Hi,

I am having the same login issues. could you please help me to fix it.

Thanks,
Ravi

ravichandrar
06-22-2010, 03:00 PM
Hi CFMaBiSmAd,

I dont know even how to code, i am having the same login issues, after reading your post. I have just tried, its working fine....Thank you so much for sharing the idea,



The posted code has at least two problems that makes it non-portable between different server settings. It is dependent on register globals being on and it uses short open tags. (Had it been properly written using full opening php tags and no dependency on register globals, it would work on any combination of those two settings. No new code written after 2002 should have relied on register globals being on.)

If you don't want to take the time now to correct the code (when PHP6 comes out, this code will stop working all together if the register globals dependency is not fixed by that time) in the short term, you can use a .htaccess file to turn on register globals and enable short open tags. Place the following two lines into a .htaccess file that is in the starting folder where this script is installed -

php_value short_open_tag on
php_value register_globals onIt is possible that the web host has prevented these settings from being made in a .htaccess file. If so, you are SOL unless you re-write portions of the code that are not working.

You might have a database issue as well.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum