The forum of the forums
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Redirect after Login code

2 posters

Go down

Redirect after Login code Empty Redirect after Login code

Post by skyman101 July 5th 2014, 10:02 pm

1. So I've got this code for the login box, however I want to make it so after the user clicks login, it takes them to a different page. If they login successfully, it would take them to a page. If it's unsuccessful, it would take them to a different page.

2. Does anyone have a code which shows whether a user is logged in? So it could show 'logout' maybe?



Login box code:

<form action="http://website.forumotion.com/login.forum" method="post"><table cellspacing="1" cellpadding="3" border="0" bgColor="#66cccc" border="0" style="border: 3px solid #7c766b; background-image: url('URL_OF_BACKGROUND_IMAGE'); background-repeat: repeat; background-attachment: fixed;"><tbody><tr><td width="45%" align="right"> Username:</td><td><input type="text" name="username" size="25" maxlength="40" style="BACKGROUND-COLOR: #c6c5af"/></td></tr><tr><td align="right">Password:</td><td><input type="password" name="password" size="25" maxlength="32" style="BACKGROUND-COLOR: #c6c5af"/></td></tr><tr align="center"><td colspan="2">Log me on automatically each visit: <input type="checkbox" name="autologin" checked="true" /></td></tr><tr align="center"><td colspan="2"><input type="submit" class="mainoption" name="login" value="Log in" /></td></tr></tbody></table></form>
avatar
skyman101
New Member

Posts : 17
Reputation : 1
Language : English

http://89hello@live.co.uk

Back to top Go down

Redirect after Login code Empty Re: Redirect after Login code

Post by SSYT July 6th 2014, 9:40 pm

Try my edit your login box codes Smile
Code:
<form action="/login" method="post" name="login">
   <table cellspacing="1" cellpadding="3" border="0" bgColor="#66cccc" border="0" style="border: 3px solid #7c766b; background-image: url('URL_OF_BACKGROUND_IMAGE'); background-repeat: repeat; background-attachment: fixed;">
      <tbody>
         <tr>
            <td width="45%" align="right"> Username:</td>
            <td><input type="text" name="username" size="25" maxlength="40" style="BACKGROUND-COLOR: #c6c5af"/></td>
         </tr>
         <tr>
            <td align="right">Password:</td>
            <td><input type="password" name="password" size="25" maxlength="32" style="BACKGROUND-COLOR: #c6c5af"/></td>
         </tr>
         <tr align="center">
            <td colspan="2">Log me on automatically each visit: <input type="checkbox" name="autologin" checked="true" /></td>
         </tr>
         <tr align="center">
            <td colspan="2">
            <input type="hidden" name="redirect" value="Your url for redirect" />
            <input type="hidden" name="query" value="" />
            <input type="submit" class="mainoption" name="login" value="Log in" /></td>
         </tr>
      </tbody>
   </table>
</form>

And "Your url for redirect" replace with "/, /forum or /f1-your-forum".
SSYT
SSYT
Forumember

Male Posts : 77
Reputation : 15
Language : RO-10, EN-3, FR-1
Location : Romania

http://help.forumgratuit.ro/forum

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum