Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default Login Redirect

    Hi, all

    I have this login script that calls on itself to authenticate the username
    and the password. It redisplays the login page if there is an error. My
    question is how do I redirect it to a different page, when the user is
    authenticated (i.e. the address in the address box changes to a new name,
    for example, if the login page is called login.php, then I want to redirect
    the logged in user to home.php without any clicking from the user). I
    realize that there is a header function available, but I've heard that any
    information related to the current session is lost upon using this function.
    Is there any better way?


    cheers

    ==James==


    James Jiao Guest

  2. Similar Questions and Discussions

    1. Cookie not set after login and redirect
      Hello I have setup a forms authentication login page and use custom principal and identity. When authenticate everything goes well. But when I set...
    2. login redirect doesn't work
      Hello, I'm working on a asp.net/C# project, but I haven't got a lot of experience with programming with C# and the dotnet framework. I've build...
    3. best way to redirect asp to login htm page?
      Hello, I need users to access a data entry asp page via a login page. If they bookmark the data entry asp I want to redirect them to the login...
    4. How to set redirect default on login?
      Sorry, FormsAuthentication is hard set to "default.aspx" when doing the RedirectFromLoginPage and/or GetRedirectUrl Just execute SetAuthCookie...
    5. User Login to Redirect using PHP
      I've read many posts about redirecting a user by specifying the directin url in the database, but have had very little luck. I'm using Dreamweaver's...
  3. #2

    Default Re: Login Redirect

    Same here. Just implemented the same thing using the same process. Where di
    you read that as it may explain a problem I am having (in the post above
    this one).


    "Ian.H [dS]" <ian@WINDOZEdigiserv.net> wrote in message
    news:20030816180933.2da509e1.ian@WINDOZEdigiserv.n et...
    > On Sun, 17 Aug 2003 04:43:40 +1200 in
    > <message-id:2bt%a.11852$9f7.1364003@news02.tsnz.net>
    > "James Jiao" <jamesjiao@paradise.net.nz> wrote:
    >
    > > I want to redirect
    > > the logged in user to home.php without any clicking from the user). I
    > > realize that there is a header function available, but I've heard
    > > that any information related to the current session is lost upon
    > > using this function. Is there any better way?
    >
    >
    > Hmm, don't know where you heard that, but I've just implemented this
    > exact same idea.
    >
    > What results did you get when you tried it?
    >
    >
    >
    > Regards,
    >
    > Ian
    >
    > --
    > Ian.H [Design & Development]
    > digiServ Network - Web solutions
    > [url]www.digiserv.net[/url] | irc.digiserv.net | forum.digiserv.net
    > Programming, Web design, development & hosting.

    Paul Guest

  4. #3

    Default Login redirect

    I would like to know what is the best way to redirect the user to the last page
    he visited after they login.

    right now I have the cflocation to a hardcode page, but I need to send the
    user to the last page he came from.

    enniobozzetti Guest

  5. #4

    Default Re: Login redirect

    put this Javascript somewhere
    window.history.back()
    Dan Bracuk Guest

  6. #5

    Default Re: Login redirect

    That doesn't work.... for example... I have a folder where only members can
    see, but if you try to go to [url]www.mysite.com/members/[/url] and you are not logged in
    you will go to the login page, but using the java script it will not send me
    back top the [url]www.mysite.com/members/[/url] that will take me back to the login
    page... so I would like to know if there is a way like in the cferror where you
    can get the ERROR.HTTPReferer and you will get the last page.

    ;)

    enniobozzetti Guest

  7. #6

    Default Re: Login redirect

    Try this
    window.history.back(2)


    Originally posted by: enniobozzetti
    That doesn't work.... for example... I have a folder where only members can
    see, but if you try to go to [url]www.mysite.com/members/[/url] and you are not logged in
    you will go to the login page, but using the java script it will not send me
    back top the [url]www.mysite.com/members/[/url] that will take me back to the login
    page... so I would like to know if there is a way like in the cferror where you
    can get the ERROR.HTTPReferer and you will get the last page.

    ;)



    Dan Bracuk Guest

  8. #7

    Default Re: Login redirect

    window.history.back() does not take an argument. Perhaps you meant window.history.go(-2).


    backprop Guest

  9. #8

    Default Re: Login redirect

    Well, http referer is available in any cf script (if not, how do we get it in application.log ?)
    zvince Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139