PDA

View Full Version : Login on website?



AdamJ
June 10th, 2008, 06:32
Hi guys, I've got this "member Login" area on the template I am using for my new site, and wondered how can I add a login to either cPanel or vBulletin to it, instead of them visiting the respected areas to login there. The code for the login box goes as follows:



<div id="member">
<h2>Member Login</h2>
<form action="#" method="post" name="member_log_in" id="member_log_in">
<label>Name:</label>
<input type="text" name="name" class="txtBox" />
<label>Password:</label>
<input type="password" name="name2" class="txtBox" />
<a href="#">A registered member?</a>
<input type="submit" name="go" value="" class="go" />
<br class="spacer" />
</form>
<br class="spacer" />
</div>


If possible, could somebody try and get that so a member could login to the forum or cPanel from the main site, without having to visit the link itself? And when they login, if correct, they are redirected to that thing as normal.


Thanks,
Adam

Dynash
June 10th, 2008, 08:22
here is one for the cPanel, I've done something similar with SMF though, not with vB yet.

http://www.webmaster-talk.com/html-forum/24901-cpanel-login-script.html

inspiritnetworks
July 16th, 2008, 07:25
cpanels would be:

www.yourdomain.com:2082/login/?user=username&pass=password

There for you have to name the username field "user" and the password field "pass" and make sure the form method is by "GET". When the user enter their details correctly they should be transferred immediately to cpanel rather than the login.

e.g.


<div id="member">
<h2>Member Login</h2>
<form action="http://www.yourdomain.com:2082/login/" method="GET" name="member_log_in" id="member_log_in">
<label>Name:</label>
<input type="text" name="user" class="txtBox" />
<label>Password:</label>
<input type="password" name="pass" class="txtBox" />
<a href="#">A registered member?</a>
<input type="submit" name="go" value="" class="go" />
<br class="spacer" />
</form>
<br class="spacer" />
</div>

With VBulletin:

www.yourdomain.com/forum/login.php?do=login

e.g.


<div id="member">
<h2>Member Login</h2>
<form action="http://www.yourdomain.com/forum/login.php?do=login" method="POST" name="member_log_in" id="member_log_in" onsubmit="md5hash(vb_login_password, vb_login_md5password, vb_login_md5password_utf, 0)">
<script type="text/javascript" src="http://www.yourdomain.com/forum/clientscript/vbulletin_md5.js?v=372c"></script>
<label>Name:</label>
<input type="text" name="vb_login_username" class="txtBox" />
<input type="hidden" name="cookieuser" value="1" tabindex="103" id="cb_cookieuser_navbar" accesskey="c" />
<label>Password:</label>
<input type="password" name="vb_login_password" class="txtBox" />
<a href="#">A registered member?</a>
<input type="submit" name="go" value="" class="go" />
<br class="spacer" />
</form>
<br class="spacer" />
</div>

There's some things you will need to edit through the code but these should all work.

AdamJ
July 18th, 2008, 13:52
Even though its a old'ish thread, and its not needed anymore, cheers inspiritnetworks for that. Very helpful!