Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 22

Thread: password redirect to page

  1. #11
    Join Date
    Mar 2008
    Posts
    14
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    I got a little time and gave it a try. It worked great and I'll save it in case I need something more robust down the road. The current project just calls for something simple though so I'll probably just use the other code that was proposed. It's a little simpler to work with.

    The only thing I still need to figure out is where to put the error message on the code:

    PHP Code:
    @session_start(); 
    if (
    $_SESSION["logged_in"] !== 1) { 
         exit();  
    // or output an error message of your choice, then exit() 

    Last edited by Snookerman; 04-22-2009 at 09:01 AM. Reason: added [php] tags

  2. #12
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    I don't understand you. But also, there was a huge security whole that I did not fix on the page you dowloaded, fix it at http://www.dynamicdrive.com/forums/s...0&postcount=27.

    (I'm fixing this on the downloadable version now.
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    claass (04-10-2009)

  4. #13
    Join Date
    Mar 2008
    Posts
    14
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Thanks. I downloaded the new script.

  5. #14
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Great, glad to help! Now, what was that thing about an error? You wanted to have an error if something?
    Jeremy | jfein.net

  6. #15
    Join Date
    Mar 2008
    Posts
    14
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    There was another person that gave some code before you logged in. I was looking at both your code and his and was just wondering how to add an error message to the php code on the destination page of the code he sent me. The code is below.
    PHP Code:
    @session_start(); 
    if (
    $_SESSION["logged_in"] !== 1) { 
    exit(); 
    // or output an error message of your choice, then exit() 

    Last edited by Snookerman; 04-22-2009 at 09:00 AM. Reason: added [php] tags

  7. #16
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    So, you want it if the user isn't logged in it gives them an error message? My code already has that installed. Is there something else I forgot?
    Jeremy | jfein.net

  8. #17
    Join Date
    Mar 2008
    Posts
    14
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    No, your code was great and worked perfectly.

    I was just playing with his code at the same time as yours and was trying to figure it all out. I've been designing web pages for quite awhile but the is my first time actually writing php. I was trying to break down the code to see how it all worked and was just curious what it would take to add in an error message when people tried to log in without going through the proper sequence.

    Your code was a little bigger bite then I felt I could chew all at once so I was playing with the other code since it was quite a bit smaller.

    I really appreciate all your help on this.

  9. #18
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Glad to help you! Your welcome!

    It seems your topic is solved... Please set the status to resolved.. To do this:
    Go to your first post ->
    Edit your first post ->
    Click "Go Advanced" ->
    Then in the drop down next to the title, select "RESOLVED"
    Jeremy | jfein.net

  10. #19
    Join Date
    Mar 2008
    Posts
    14
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    I am still curious about what I need to do to add an the error message to that code. I tried several things and thought I had but it never worked. If you have time could you show me what I need to add so I can get a better idea of how it works? I just want to change it so that people accessing the code will get an error message rather then just a blank screen.

    Here's the code:

    PHP Code:
    @session_start(); 
    if (
    $_SESSION["logged_in"] !== 1) { 
    exit(); 

    I just hate to walk away from it without having it figured out. Thanks again for all your help.
    Last edited by Snookerman; 04-22-2009 at 09:00 AM. Reason: added [php] tags

  11. #20
    Join Date
    Jan 2008
    Posts
    4,167
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    When you go to a page that you have no permissions to, it just directs you to the login. Can you be more descriptive please?
    Jeremy | jfein.net

Tags for this Thread

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
  •