Professional Web Applications Themes

Login Redirect - PHP Development

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 ...

  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. #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]" <ianWINDOZEdigiserv.net> wrote in message
    news:20030816180933.2da509e1.ianWINDOZEdigiserv.n et...
    > On Sun, 17 Aug 2003 04:43:40 +1200 in
    > <message-id:2bt%a.11852$9f7.1364003news02.tsnz.net>
    > "James Jiao" <jamesjiaoparadise.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

  3. #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

  4. #4

    Default Re: Login redirect

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

  5. #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

  6. #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

  7. #7

    Default Re: Login redirect

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


    backprop Guest

  8. #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

Similar Threads

  1. Question redirect on login
    By Kirkman in forum Brainstorming Area
    Replies: 0
    Last Post: June 27th, 08:47 PM
  2. How to set redirect default on login?
    By Eric Newton in forum ASP.NET Security
    Replies: 4
    Last Post: June 10th, 01:23 AM
  3. Cookie not set after login and redirect
    By Faassen, B. in forum ASP.NET Security
    Replies: 0
    Last Post: August 3rd, 02:35 PM
  4. Replies: 6
    Last Post: September 10th, 04:22 AM
  5. User Login to Redirect using PHP
    By SpeedRacer21 webforumsuser@macromedia.com in forum Macromedia Dreamweaver
    Replies: 3
    Last Post: July 9th, 05:40 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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