Login Form Help

Discussion in 'HTML & Website Design' started by WXM Matty, Apr 11, 2008.

  1. #1
    I have just coded a login form on my website to log users into my vBulletin forum from the main page. I have managed this fine sofar and the code I have used Is below.

    My problem is that it logs the users in and then takes them back to the index page. Once back at the index page they are loged into the forum however the login box still appears the same at the top. Meaning the user does not know if they are still loged in.

    You can see the login form in action on the top right of THIS PAGE



    <form action="http://www.xninelivesx.com/forums/login.php" method="post" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)">
    <script type="text/javascript" src="http://www.xninelivesx.com/forums/clientscript/vbulletin_md5.js"></script>
    <table border="0" cellpadding="0" cellspacing="3">
    
    <tbody><tr>
    
    <td><input class="text-inp" style="font-size: 11px;" name="vb_login_username" size="10" accesskey="u" tabindex="101" value="USERNAME" onfocus="if (this.value == 'User Name') this.value = '';" type="text"></td>
    <td colspan="2" nowrap="nowrap"><label for="cb_cookieuser_navbar">
    </tr>
    <tr>
    
    
    <td><input style="font-size: 11px;" name="vb_login_password" size="10" accesskey="p" tabindex="102" type="password" class="text-inp" value="PASSWORD"></td>
    <td><input value="Log in" tabindex="104" accesskey="s" TYPE="IMAGE" SRC="images/butup.gif" ALT="Submit button"></td>
    </tr>
    </tbody></table>
    <input name="s" value="" type="hidden">
    <input name="do" value="login" type="hidden">
    <input name="vb_login_md5password" type="hidden">
    <input name="vb_login_md5password_utf" type="hidden">
    </form>
    
    Code (markup):

    If you could tell me how to replace the box with you are loged in text that would be great. Or if you could let me know of any other solutions.

    Thanks,

    WXM Matty
     
    WXM Matty, Apr 11, 2008 IP
  2. kashfun

    kashfun Peon

    Messages:
    54
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Matt, I'm not sure if you can do that with html only but you surely can with PHP, asp etc. Try those. It will work.
     
    kashfun, Apr 12, 2008 IP
  3. WXM Matty

    WXM Matty Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I need to look into php, I have no PHP knowledge. If anyone could help me do this in php that would be great.
     
    WXM Matty, Apr 12, 2008 IP
  4. Agent_Smith

    Agent_Smith Well-Known Member

    Messages:
    890
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    145
    #4
    Agent_Smith, Apr 12, 2008 IP
  5. WXM Matty

    WXM Matty Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I cant make a new page as my website is quite large. So I will need to look into this. Do you know any websites that might help?
     
    WXM Matty, Apr 12, 2008 IP
  6. wd_2k6

    wd_2k6 Peon

    Messages:
    1,740
    Likes Received:
    54
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I'm not to good with my PHP but I think it would be something along the lines of using an if statement, for example

    <? php if (loggedin=1) ?> then display this otherwise..
    <? php else : ?> display the login form.

    However i don't know the specifics of V Bullitien, i'm sure they'll have a tutorial of this on their site somehwere as its v.frequently needed.

    Edit i did a quick Google search on your behalf this might be what you are looking for i'm not too sure: http://www.vbulletin.com/forum/showthread.php?t=23524
     
    wd_2k6, Apr 12, 2008 IP
  7. WXM Matty

    WXM Matty Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Ok thanks for your reply i'll keep searching

    Edit: Whalst Im looking into this can anyone tell me how in HTML could i stop the login redirecting back to the website and just take the user to the forums loged in after they have entered their data on the main website?
     
    WXM Matty, Apr 12, 2008 IP
  8. Agent_Smith

    Agent_Smith Well-Known Member

    Messages:
    890
    Likes Received:
    43
    Best Answers:
    0
    Trophy Points:
    145
    #8

    You can do that inside http://www.xninelivesx.com/forums/login.php

    If your form makes it check within the vb login, doesn't it redirect them to the forum?
     
    Agent_Smith, Apr 12, 2008 IP
  9. WXM Matty

    WXM Matty Peon

    Messages:
    30
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Yes it says loged in in the forum then redirects back to my website. So what do I do?
     
    WXM Matty, Apr 12, 2008 IP