Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    New Coder
    Join Date
    Apr 2007
    Posts
    37
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Need help with .TMP/Cache of script

    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)

  • #2
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,041
    Thanks
    2
    Thanked 316 Times in 308 Posts
    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.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #3
    New Coder
    Join Date
    Apr 2007
    Posts
    37
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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)

  • #4
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,041
    Thanks
    2
    Thanked 316 Times in 308 Posts
    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.
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • #5
    New Coder
    Join Date
    Apr 2007
    Posts
    37
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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:
    PHP Code:
    <?
    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>

  • #6
    Senior Coder CFMaBiSmAd's Avatar
    Join Date
    Oct 2006
    Location
    Denver, Colorado USA
    Posts
    3,041
    Thanks
    2
    Thanked 316 Times in 308 Posts
    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 -
    Code:
    php_value short_open_tag on
    php_value register_globals on
    It 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.
    Last edited by CFMaBiSmAd; 10-03-2007 at 03:34 AM. Reason: more info
    If you are learning PHP, developing PHP code, or debugging PHP code, do yourself a favor and check your web server log for errors and/or turn on full PHP error reporting in php.ini or in a .htaccess file to get PHP to help you.

  • Users who have thanked CFMaBiSmAd for this post:

    Ultima-X97 (10-04-2007)

  • #7
    New Coder
    Join Date
    Apr 2007
    Posts
    37
    Thanks
    3
    Thanked 0 Times in 0 Posts
    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!

  • #8
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

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

    Thanks,
    Ravi

  • #9
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Ultima-X97 View Post
    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

  • #10
    New to the CF scene
    Join Date
    Jun 2010
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    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,


    Quote Originally Posted by CFMaBiSmAd View Post
    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 -
    Code:
    php_value short_open_tag on
    php_value register_globals on
    It 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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •