redirecting a login page to a url from server variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rlm51
    New Member
    • Mar 2007
    • 29

    redirecting a login page to a url from server variable

    Hey everyone, hope all are fine ...

    Dreamweaver uses a login_user server behavior to send the user to a specified page on a successful login. Normally you would provide a url, but I would like to use the server variable that holds the url of the last page visited so I can use the same login form for different sections of the website.

    $MM_redirectLog inSuccess = $_SERVER['HTTP_REFERER'];
    doesn't work. The command doesn't recognize it as a pathname.


    Is there a way to do this successfully within a PHP command structure?

    Thanks for any help ...

    Robert
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    $_SERVER['HTTP_REFERER'] points to the page in which a viewer used a link that pointed to the new page.

    $_SERVER['HTTP_REFERER'] can be faked!

    Not reliable!

    Anyways, is the page last visited going to be on your site?

    If so, on every page you could have a SESSION that holds the uri of the page.

    Also: dreamweaver is not a recommened dev tool!

    Comment

    • Atli
      Recognized Expert Expert
      • Nov 2006
      • 5062

      #3
      Originally posted by markusn00b
      Also: dreamweaver is not a recommened dev tool!
      Dreamweaver is a decent enough editor, but avoid using it's special tools and wizards to generate your code. You don't want to be dependent on a single tool to be able to "write" your code.

      You could use sessions or cookies to save the last page a visitor was on. Just add code to the bottom of the code that sets a cookie or session value to the name of the current page. That way the entire code would be able to use the value set by the last page.

      Comment

      • rlm51
        New Member
        • Mar 2007
        • 29

        #4
        Hey ... Thanks for the $_SESSION['variablename']; idea, that worked.

        I am a graphic designer, trained in art and computer science beginning a long time ago (1968). In my business I am forced into painful deadlines and stress. I appreciate any tool that can help me do my job.

        I have seen Photoshop go from v1.5 to today. I have been a beta site for Adobe, Macromedia, AutoCad and others through the years. The thing I like about Dreamweaver is that in most instances, it generates the code for you, and then by studying that code, you can learn to write your own. In the going on 2 years I have been doing web design, I have found this very helpful. I think that it is wrong to discourage anyone from using whatever tool they can to be more proficient and successful.

        Thanks again for the help.

        Robert

        Comment

        • Markus
          Recognized Expert Expert
          • Jun 2007
          • 6092

          #5
          Originally posted by rlm51
          I think that it is wrong to discourage anyone from using whatever tool they can to be more proficient and successful.
          You're welcome, bro.

          And I apologise. I should have stated this is just preference, to be honest. I have heard that DW produces inconsistent code.. and very ugly looking code, at that.

          Whatever floats your boat! Water, I think?

          See ya around!

          Comment

          • dlite922
            Recognized Expert Top Contributor
            • Dec 2007
            • 1586

            #6
            Originally posted by rlm51
            I am a graphic designer, trained in art and computer science beginning a long time ago (1968).
            *jaw drops*

            Use *whatever* tool you need sir. If i were you, i'd barely function, much less produce code.

            Cheers to ya and good health for years to come!

            Dan

            Comment

            • Atli
              Recognized Expert Expert
              • Nov 2006
              • 5062

              #7
              Originally posted by rlm51
              ...
              I think that it is wrong to discourage anyone from using whatever tool they can to be more proficient and successful.
              ...
              I quite agree with you there. There are many excellent tools that can be very useful, and there is absolutely nothing wrong with taking advantage of that.

              For those who are new to PHP, however, I would encourage learning how to write the code by hand first, before they start using such tools. Otherwise they can become dependent on proprietary tools, which is obviously not a good thing.

              Comment

              Working...