4images Forum & Community

4images Modifications / Modifikationen => Templates & Styles (Requests & Discussions) => Topic started by: mightyaf on March 29, 2005, 10:53:35 PM

Title: How can I have a Login box outside the 4images gallery
Post by: mightyaf on March 29, 2005, 10:53:35 PM
 :oops:I have created a php page for my website. 4images gallery is just part of the site. I would like my visitors to see a login box on the very first page of my website example www.mysite.com instead of logging in at www.mysite.com/4images. I want to have the capability of copying this user login box to any page outside the 4images gallery. I tried to use
Quote
<?php require('http://www.mysite.com/4images/index.php?template=user_loginform'); ?>
but when I click on login it gives me a page like
Quote
http://www.mysite.com/login.php?sessionid=8d4f4a38e80fdaa44d80c2a6199e644b
which is missing the gallery name between mysite.com/ and login.php This code is assuming that you are in the gallery. How can I make it work? All the help is appreciated.
Title: Re: How can I have a Login box outside the 4images gallery
Post by: V@no on March 29, 2005, 11:07:08 PM
why not just use the same login form from 4images and change action of the form to point to login.php of 4images?
Title: Re: How can I have a Login box outside the 4images gallery
Post by: mightyaf on March 29, 2005, 11:15:39 PM
I tried that but when you enter the username and password then hit enter, it will give you a blank (404) error "this page cannot be displayed" type of page BUT when you refresh the page, you are logged in. It is very weird but I tried that. I don't want to tell my visitors to hit refresh if they get a blank page.
Title: Re: How can I have a Login box outside the 4images gallery
Post by: V@no on March 29, 2005, 11:28:24 PM
so where do u want your visitors to be redirect to after login?
perhaps u could try add in your login form:
Code: [Select]
<input type="hidden" name="url" value="[url]">replace [url] with url where u want your visitors to redirect to after login.
Title: Re: How can I have a Login box outside the 4images gallery
Post by: mightyaf on March 29, 2005, 11:32:46 PM
After successful login visitors should be redirected to the usual 4images category selection area which is index.php 4images/index.php
Thanks
Title: Re: How can I have a Login box outside the 4images gallery
Post by: mightyaf on March 30, 2005, 05:34:04 PM
 :lol:I tried that and it worked V@no. Here is the code I used on my website.
Quote
<form action=http://www.mysite.com/4images/login.php method=post>
        <input type="text" size="18" name="user_name" class="blackCopy" value="Username" onFocus="if(this.value=='Username')this.value='';">
          <br />
        Password:<br />
        <input type="password" size="18" name="user_password" class="blackCopy" />       
       
        <table border="0" cellspacing="0" cellpadding="0">
        <tr valign="top">
            <td height="20">
              <input type="checkbox" name="auto_login" value="1" />            </td>
            <td><span class="smalltext">Log me on automatically next visit?</span></td>
          </tr>
        </table>
      <input type="hidden" name="url" value="http://www.www.mysite.com/4images/index.php">
        <input type="submit" value="Log In" class="blackCopy" />
      </form>
I made very slight changes but you can make yours too.
Something you may want to keep in mind, I did not test the security of the form.
Title: Re: How can I have a Login box outside the 4images gallery
Post by: ocdotcom on August 24, 2006, 11:36:14 PM
I tried this also and got a 404 from the login.php. Not sure but I really want this so Ive got to get it figured out.
<?php

$main_template = 0;

$nozip = 1;
require('http://www.mysite.com/4images/index.php?template=user_loginform');

if ($site_sess->login($user_name, $user_password, $auto_login)) {
redirect("www.mysite.com/4images/index.php");
}

exit;
?>
Title: Re: How can I have a Login box outside the 4images gallery
Post by: V@no on August 25, 2006, 01:03:22 AM
omg...what is this...
all you need to have is a html page with "action" inside your loginform pointed to login.php at your 4images site and hidden "url" input with link to redirect to...