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 4 of 4
  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    91
    Thanks
    19
    Thanked 0 Times in 0 Posts

    Login shows white id and pass

    My ApacheFriends XAMPP version 1.7.7, and,

    Apache 2.2.21
    MySQL 5.5.16 (Community Server)
    PHP 5.3.8 (VC9 X86 32bit thread safe) + PEAR.

    1. the part to call "login_check.php"

    Code:
    <?
    if (!defined("_GNUBOARD_")) exit; 
    
    $url = '';
    if ($g4['https_url']) {
        if (preg_match("/^\./", $urlencode))
            $url = $g4[url];
        else
            $url = $g4[url].$urlencode;
    } else {
        $url = $urlencode;
    }
    ?>
    
    <table width="668" border="0" cellspacing="0" cellpadding="0">
    <form name="flogin" method="post" action="javascript:flogin_submit(document.flogin);" autocomplete="off">
    <input type="hidden" name="url" value='<?=$url?>'>
    <!-- <tr align="center"> 
        <td colspan="3"><img src="<?=$member_skin_path?>/img/login_title.gif" width="624" height="72"></td>
    </tr> -->
    <tr>
        <td height="26"></td>
        <td width="628"></td>
        <td width="20"></td>
    </tr>
    <tr>
        <td width="20" height="2"></td>
        <td width="628" bgcolor="#8F8F8F"></td>
        <td width="20"></td>
    </tr>
    <tr>
        <td width="20" height="48"></td>
        <td width="628" align="right" background="<?=$member_skin_path?>/img/login_table_bg_top.gif"><img src="<?=$member_skin_path?>/img/login_img.gif" width="344" height="48"></td>
        <td width="20"></td>
    </tr>
    <tr>
        <td width="20" height="223"></td>
        <td width="628" align="center" background="<?=$member_skin_path?>/img/login_table_bg.gif">
            <table width="460" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td width="460" height="223" align="center" bgcolor="#FFFFFF">
                    <table width="350" border="0" cellpadding="0" cellspacing="0">
                    <tr>
                        <td width="250">
                            <table width="250" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td width="10"><img src="<?=$member_skin_path?>/img/icon.gif" width="3" height="3"></td>
                                <td width="90" height="26"><b>id</b></td>
                                <td width="150"><INPUT class=box1 maxLength=20 size=15 name=mb_id itemname="아이디" required minlength="2"></td>
                            </tr>
                            <tr>
                                <td><img src="<?=$member_skin_path?>/img/icon.gif" width="3" height="3"></td>
                                <td height="26"><b>passwd</b></td>
                                <td><INPUT type=password class=box1 maxLength=20 size=15 name=mb_password itemname="패스워드" required></td>
                            </tr>
                            <tr>
                                <td><img src="<?=$member_skin_path?>/img/icon.gif" width="3" height="3"></td>
                                <td height="26"><b>auto login</b></td>
                                <td><INPUT onclick="if (this.checked) { if (confirm('no need passwd when auto login.\n\n\careful to use autologin.\n\nuse autlogin?')) { this.checked = true; } else { this.checked = false;} }" type=checkbox name=auto_login>
                                    <b>use</b></td>
                            </tr>
                            </table>
                        </td>
                        <td width="100" valign="top"><INPUT type=image width="65" height="52" src="<?=$member_skin_path?>/img/btn_login.gif" border=0></td>
                    </tr>
                    <tr>
                        <td height="5" colspan="2"></td>
                    </tr>
                    <tr>
                        <td height="1" background="<?=$member_skin_path?>/img/dot_line.gif" colspan="2"></td>
                    </tr>
                    <tr>
                        <td height="5" colspan="2"></td>
                    </tr>
                    <tr>
                        <td height="26" colspan="2"><img src="<?=$member_skin_path?>/img/icon.gif" width="3" height="3"> not member?&nbsp;&nbsp;&nbsp;&nbsp;<a href="./register.php"><img width="72" height="20" src="<?=$member_skin_path?>/img/btn_register.gif" border=0 align="absmiddle"></a></td>
                    </tr>
                    <tr>
                        <td height="26" colspan="2"><img src="<?=$member_skin_path?>/img/icon.gif" width="3" height="3"> forgot id/passwd?&nbsp;&nbsp;&nbsp;&nbsp;<a href="javascript:;" onclick="win_password_forget('./password_forget.php');"><img src="<?=$member_skin_path?>/img/btn_password_forget.gif" width="108" height="20" border=0 align="absmiddle"></td>
                    </tr>
                    </table></td>
            </tr>
            </table></td>
        <td width="20"></td>
    </tr>
    <tr>
        <td width="20" height="1"></td>
        <td width="628" bgcolor="#F0F0F0"></td>
        <td width="20"></td>
    </tr>
    <tr>
        <td height="20" colspan="3"></td>
    </tr>
    </form>
    </table>
    
    <script language='Javascript'>
    document.flogin.mb_id.focus();
    
    function flogin_submit(f)
    {
        f.action = "./login_check.php";
        f.submit();
    }
    </script>
    2. this is "login_check.php".

    Code:
    <?
    include_once("./_common.php");
    
    $mb_id       = $_POST[mb_id];
    $mb_password = $_POST[mb_password];
    
    if (!trim($mb_id) || !trim($mb_password))
        alert("id or passwd");
    
    $mb = get_member($mb_id);
    
    if (!$mb[mb_id] || (sql_password($mb_password) != $mb[mb_password]))
        alert("id or passwd\\n\\n capital");
    
    if ($mb[mb_intercept_date] && $mb[mb_intercept_date] <= date("Ymd", $g4[server_time])) {
        $date = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\1년 \\2월 \\3일", $mb[mb_intercept_date]); 
        alert("banned.\\n\\ndate : $date");
    }
    
    if ($mb[mb_leave_date] && $mb[mb_leave_date] <= date("Ymd", $g4[server_time])) {
        $date = preg_replace("/([0-9]{4})([0-9]{2})([0-9]{2})/", "\\1yr \\2mo \\3dy", $mb[mb_leave_date]); 
        alert("reject.\\n\\nrejected : $date");
    }
    
    if ($config[cf_use_email_certify] && !preg_match("/[1-9]/", $mb[mb_email_certify]))
        alert("mail auth.\\n\\n's mail add $mb[mb_email] .");
    
    $member_skin_path = "$g4[path]/skin/member/$config[cf_member_skin]";
    @include_once("$member_skin_path/login_check.skin.php");
    
    set_session('ss_mb_id', $mb[mb_id]);
    
    if ($auto_login) {
        $key = md5($_SERVER[SERVER_ADDR] . $_SERVER[REMOTE_ADDR] . $_SERVER[HTTP_USER_AGENT] . $mb[mb_password]);
        set_cookie('ck_mb_id', $mb[mb_id], 86400 * 31);
        set_cookie('ck_auto', $key, 86400 * 31);
    } else {
        set_cookie('ck_mb_id', '', 0);
        set_cookie('ck_auto', '', 0);
    }
    
    
    if ($url) 
    {
        $link = urldecode($url);
        if (preg_match("/\?/", $link))
            $split= "&"; 
        else
            $split= "?"; 
    
        foreach($_POST as $key=>$value) 
        {
            if ($key != "mb_id" && $key != "mb_password" && $key != "x" && $key != "y" && $key != "url") 
            {
                $link .= "$split$key=$value";
                $split = "&";
            }
        }
    } 
    else
        $link = $g4[path];
    
    goto_url($link);
    ?>
    When white space after login at the place of id and password, there is no error messages on internet explorer.

    Please let me know how to debug this problem, or let me know which part has problem.

    Thanks in advance.

  • #2
    Senior Coder
    Join Date
    Sep 2010
    Posts
    1,994
    Thanks
    15
    Thanked 233 Times in 233 Posts
    You use the trim(); function in php to remove white spaces at the beginning and end of text.
    Welcome to http://www.myphotowizard.net

    where you can edit images, make a photo calendar, add text to images, and do much more.


    When you know what you're doing it's called Engineering, when you don't know, it's called Research and Development. And you can always charge more for Research and Development.

  • #3
    New Coder
    Join Date
    Jun 2005
    Posts
    91
    Thanks
    19
    Thanked 0 Times in 0 Posts
    There is a misunderstanding because of my poor English.

    After typing id and password and press "Enter" key, my php program doesn't show "logged in" state but shows only blank spaces without any error messages or error or activities logs.



    Attached Thumbnails Attached Thumbnails Login shows white id and pass-2013-07-16-11-07-21_login.png   Login shows white id and pass-2013-07-16-11-07-21_login2.png  

  • #4
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,211
    Thanks
    23
    Thanked 605 Times in 604 Posts
    You have a table inside of a table inside of a table inside of a table. That's four tables. This kind of programming only slows down your page load time. Your posted code will not even display in my set up.
    All of your attributes for the table tag are deprecated:
    Code:
    <table width="350" border="1" cellpadding="0" cellspacing="0">
    The width, border, cellpadding, and cellspacing are to be set in the CSS.
    There is not type=image for the input tag:
    Code:
    <INPUT type=image width="65" height="52" src="<?php echo $member_skin_path?>/img/btn_login.gif" border=0>
    and again border=0 is wrong.

    You don't use HTML headers
    Code:
    <!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" xml:lang="en" lang="en">
    <head>.......
    Should be there after the php section or what ever doc your want to use.

    My suggestion to you is to learn how to use div's, Stop using tables. Learn CSS and code in HTML 4.01 Transitional or HTML5.

    A good place to start learning is http://www.w3schools.com/
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • Users who have thanked sunfighter for this post:

    hanpedro (07-16-2013)


  •  

    Posting Permissions

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