(Simple) How to integrate login form into your website using only forms (Simple) How to integrate login form into your website using only forms
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

(Simple) How to integrate login form into your website using only forms

Started by skullz, August 17, 2007, 11:23:58 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

skullz

OK, so I kept trying to find out how I could integrate login process of coppermine into my website without installing mods, plugins etc... allowing me to do so.

here is what I came up with...

when you click login on your gallery you can view the source and hunt for the login box form and stuff...

to get things to work with your website ( not gallery but your root site or where ever you want to display it on.... )

it goes something like;
                    <form action="login.php?referer=index.php" method="post" name="loginbox">
<!-- Start standard table -->
<table align="center" width="600" cellspacing="1" cellpadding="0" class="maintable">
        <tr>
                <td class="tableh1" colspan="2">Enter your username and password to login</td>
        </tr>
                 
                 
                  <tr>
                        <td class="tableb" width="40%">Username</td>

                        <td class="tableb" width="60%"><input type="text" class="textinput" name="username" style="width: 100%" tabindex="1" /></td>
                  </tr>
                  <tr>
                          <td class="tableb">Password</td>
                        <td class="tableb"><input type="password" class="textinput" name="password" style="width: 100%" tabindex="2" /></td>
                  </tr>
                  <tr>
                    <td colspan="2" align="center" class="tableb">Remember me <input name="remember_me" type="checkbox" class="checkbox" value="1" tabindex="3" /></td>

                  </tr>
                  <tr>
                    <td align="center" class="tablef"><a href="forgot_passwd.php" class="topmenu">I forgot my password</a></td>
                    <td align="left" class="tablef"><input name="submitted" type="submit" class="button" value="Login" tabindex="4" /></td>
                  </tr>
</table>
<!-- End standard table -->

</form>


The above code isn't modified part... this is the one that login form uses within coppermine gallery itself..^


here is what I did to include it into my main site;

<form action="[folder you installed coppermine to goes here]/login.php?referer=index.php" method="post" name="loginbox"><input type="text" class="textinput" name="username" size="13" />
  <input type="password" class="textinput" name="password" size="13" />
  <input name="submitted" type="submit" class="button" value="Login" />
            </center></td>
</form>

You can add or modify it as you see fit, I've yet to find out how captcha works, once I find that out I may try to implement it as well...
Then find a way to output if you are logged in already or not on the main site...

chris.h

Works a treat!

Many thnakd for this, was searching for anoter problem but this was something I wanted to do also.

Did notice theres some code form a table in the script that most people might not need, I think it should read...

<form action="login.php?referer=index.php" method="post" name="loginbox"><input type="text" class="textinput" name="username" size="13" />
  <input type="password" class="textinput" name="password" size="13" />
  <input name="submitted" type="submit" class="button" value="Login" />           
</form>


Thanks

Joachim Müller

1) Not related to bridging
2) How to come up with a custom login form on non-coppermine-driven pages has been discussed many times over
3) Main drawback: the login form will display even if the user is already logged in. Not recommended.

Moving from bridging sub-board.

chris.h