Author Topic: How can I have a Login box outside the 4images gallery  (Read 9084 times)

0 Members and 1 Guest are viewing this topic.

Offline mightyaf

  • Newbie
  • *
  • Posts: 24
    • View Profile
How can I have a Login box outside the 4images gallery
« 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.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How can I have a Login box outside the 4images gallery
« Reply #1 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?
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline mightyaf

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: How can I have a Login box outside the 4images gallery
« Reply #2 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.

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How can I have a Login box outside the 4images gallery
« Reply #3 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.
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline mightyaf

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: How can I have a Login box outside the 4images gallery
« Reply #4 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

Offline mightyaf

  • Newbie
  • *
  • Posts: 24
    • View Profile
Re: How can I have a Login box outside the 4images gallery
« Reply #5 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.

Offline ocdotcom

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: How can I have a Login box outside the 4images gallery
« Reply #6 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;
?>

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How can I have a Login box outside the 4images gallery
« Reply #7 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...
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)