SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Need help getting form to work

    Hello,

    I purchased a login script and set it up with no problems.

    The problem I am having is that I have an image for a login button and the new script is based on php and java.

    When you look at the home page you can see on the top left there is a login section. If someone can view the source code, can you please tell me how I can get the top left login to work with the main login section? Obviously I do not want the top left login area to be on the page, but I do need to keep the same look and feel of the current login form that I have.

    Here is a link to the homepage.

    Thank you in advance!!

  2. #2
    SitePoint Guru
    Join Date
    Feb 2008
    Posts
    655
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It is not totally clear what you are asking. Are you just trying to get rid of the login box in the top left corner?

  3. #3
    SitePoint Member
    Join Date
    Jun 2009
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Lightbulb

    I think you want to move this line into the form section
    Code HTML4Strict:
    <script language="javascript" src="/memberlogin/load.php"></script>

    if you want to change the login view go to "/memberlogin/load.php" and replace the appropriate code with yours
    Code HTML4Strict:
    <label>
      <span class="style3">Login</span>
      <span class="small">Login name provided to you</span>
    </label>
    <input type="text" name="username" id="name" />
    <label>
      <span class="style3">Password</span>
      <span class="small">Password provided to you</span>
    </label>
    <input type="password" name="password" id="email" />

    remember to match the id and name attribute to the same id and name on original "/memberlogin/load.php"

    hope that help
    eYeew! Founder and Developer

    Madipta

  4. #4
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by pipisdicelana View Post
    I think you want to move this line into the form section
    Code HTML4Strict:
    <script language="javascript" src="/memberlogin/load.php"></script>

    if you want to change the login view go to "/memberlogin/load.php" and replace the appropriate code with yours
    Code HTML4Strict:
    <label>
      <span class="style3">Login</span>
      <span class="small">Login name provided to you</span>
    </label>
    <input type="text" name="username" id="name" />
    <label>
      <span class="style3">Password</span>
      <span class="small">Password provided to you</span>
    </label>
    <input type="password" name="password" id="email" />

    remember to match the id and name attribute to the same id and name on original "/memberlogin/load.php"

    hope that help
    Thank you. Here is the load.php file.

    Can you explain to me where I should put my code?

    PHP Code:
    <?php
    error_reporting
    (0);
    include(
    "options.php");

    $sql "SELECT * FROM ".$TABLES["Options"]." WHERE id = '1'";
    $sql_result mysql_query ($sql$connection ) or die ('request "Could not execute SQL query" '.$sql);
    $Option mysql_fetch_assoc($sql_result);
        
    $loadCalendar '
    <div id="loginBox"></div>

    <script language="javascript">
        ajaxpage("'
    .$SETTINGS["installFolder"].'login.php","loginBox","get");
    </script>
    '
    ;

    $loadCalendar preg_replace("/\n/","",$loadCalendar);
    $loadCalendar preg_replace("/\r/","",$loadCalendar);

    ?>
    var bustcachevar=1; //bust potential caching of external pages after initial request? (1=yes, 0=no)
    var bustcacheparameter="";

    function createRequestObject(){
        try    {
            xmlhttp = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("Microsoft.XMLHTTP");
        }    catch(e)    {
            alert('Sorry, but your browser doesn\'t support XMLHttpRequest.');
        };
        return xmlhttp;
    };

    function ajaxpage(url, containerid, requesttype){
        var page_request = createRequestObject();

        if (bustcachevar) bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
        page_request.open('GET', url+bustcacheparameter, true)
        page_request.send(null)

        page_request.onreadystatechange=function(){
            loadpage(page_request, containerid)
        }

    }

    function loadpage(page_request, containerid){
        if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)) {
            document.getElementById(containerid).innerHTML = page_request.responseText;
        };
    }



    function loginPage(path){
        loginAjax(path + '?username='+ document.frm.username.value + '&pass=' + document.frm.pass.value,'loginStatus','get');
    }

    function loginAjax(url, containerid, requesttype){
        var page_request = createRequestObject();

        if (bustcachevar) bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
        page_request.open('GET', url+bustcacheparameter, true)
        page_request.send(null)

        page_request.onreadystatechange=function(){
            loginRedirect(page_request, containerid)
        }

    }

    function loginRedirect(page_request, containerid){
        if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)) {
            if(page_request.responseText == '1'){
                window.location.href = "<?php echo stripslashes($Option["welcome_page"]); ?>";
            } else {
                document.getElementById(containerid).innerHTML = "<strong style='color:#FF0000'>Incorrect login details.</strong>";
            }    
        };
    }

    loadCalendar = '<?php echo $loadCalendar?>';
    document.writeln(loadCalendar);

  5. #5
    SitePoint Zealot
    Join Date
    Mar 2008
    Posts
    135
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It actually goes to login.php.

    Right now I just added in my section.

    Can someone tell me what I need to do to make mine work? My portion that I want to incorporate is the bottom "form".

    Thanks!

    PHP Code:
    <style type="text/css">
    <!--


    <!-- FORM STYLES START -->

    body{
    font-family:"Lucida Grande", "Lucida Sans Unicode", Verdana, Arial, Helvetica, sans-serif;
    font-size:12px;
    }
    p, h1, form, button{border:0; margin:0; padding:0;}
    .spacer{clear:both; height:1px;}
    /* ----------- My Form ----------- */
    .myform{
    margin:0 auto;
    width:350px;
    padding:14px;
    float:right
    }

    .myform2{
    margin: 0 auto;
    width: 200px;
    padding: 14px;
    float: left;
    }

    /* ----------- stylized ----------- */
    #stylized{
    background:#FAD4DC;
    padding-left: 5px;
    text-align: center;
    width: 350px;
    margin: 0 auto;
    }
    #stylized h1 {
    font-size:14px;
    font-weight:bold;
    margin-bottom:8px;
    }
    #stylized p{
    font-size:11px;
    color:#AA2CB9;
    margin-bottom:20px;
    padding-bottom:10px;
    }
    #stylized label{
    display:block;
    font-weight:bold;
    width:350px;
    float:left;
    }
    #stylized .small{
    color:#AA2CB9;
    display:block;
    font-size:11px;
    font-weight:normal;
    width:350px;
    }
    #stylized input{
    float:left;
    font-size:12px;
    padding:4px 2px;
    border:solid 1px #aacfe4;
    width:200px;
    margin:2px 0 20px 70px;
    }
    #stylized button{
    clear:both;
    width:125px;
    height:31px;
    background:#666666 url(images/button.gif) no-repeat;
    text-align:center;
    line-height:30px;
    color:#AA2CB9;
    font-size:11px;
    font-weight:bold;
    }

    <!-- FORM STYLES END -->
    -->
    </style>
    <style type="text/css">
    <!--
    a:link {
        color: #AA2CB9;
    }
    a:visited {
        color: #AA2CB9;
    }
    a:hover {
        color: #AA2CB9;
    }
    a:active {
        color: #AA2CB9;
    }
    .style3 {color: #aa2cb9}
    body {
        background-color: #92298f;
    }
    .style4 {color: #CCCCCC}
    -->
    </style>

    <?php
    error_reporting
    (0);
    session_start();
    include(
    "options.php");
    ?>
    <form name="frm" onsubmit="return false;">
        <table cellpadding="2" cellspacing="0">
            <tr>
                <td align="left" colspan="2"><div id="loginStatus"></div></td>
            </tr>    
            <tr>
                <td width="30%" align="right" >username:</td>
                <td width="70%" align="left"><input type="text" name="username" style="width:70px" /></td>
            </tr>    
            <tr>
                <td align="right">password:</td>
                <td align="left"><input type="password" name="pass" style="width:70px" /></td>
            </tr>
            <tr>
                <td align="center" >&nbsp;</td>
              <td align="left" ><input type="button" value="Login" onClick="loginPage('<?php echo $SETTINGS["installFolder"].'checkuser.php'?>')" /></td>
            </tr>            
        </table>    
    </form>

    <form name="frm" onsumbit="return false;">
        <h1 class="style3">Login</h1>
        <p>For assistance, please contact customer service at <a href="mailto:support@jewelsforschools.net">support@jewelsforschools.net</a>.</p>
        <br />

        <label><span class="style3">Login</span>    <span class="small">Login name provided to you</span>    </label>
        <input type="text" name="username" id="name" />

        <label><span class="style3">Password</span>    <span class="small">Password provided to you</span>    </label>
        <input type="password" name="password" id="email" />
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <button type="submit" value="Login" onClick="loginPage('<?php echo $SETTINGS["installFolder"].'checkuser.php'?>')"
        <p style="color: #cccccc">Login</p>
        </button>
        <div class="spacer"></div>
        </form>


Bookmarks

Posting Permissions

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