pls share ur worthfull ideas

Discussion in 'PHP' started by cool_saran, Dec 10, 2007.

  1. #1
    im having an unknown problem. that , i used url rewriting method to redirect a logged user as domain/members/contactus.php, if he is not logged in i automatically redirect him to domain/contactus.php. The problem is, its working in local and test server.but it doesnt work in live server. i dont know the server settings. client only has. should i change any server settings to fix this problem. pls help me anybody.....
     
    cool_saran, Dec 10, 2007 IP
  2. Paul Starsky

    Paul Starsky Peon

    Messages:
    10
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Probably mod_rewrite doesn't work on your server. You need to edit apache's config file to turn it on.
     
    Paul Starsky, Dec 10, 2007 IP
  3. Gawk

    Gawk Peon

    Messages:
    427
    Likes Received:
    36
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If you are using sessions just check a session exists or actually contains what you set it to, if not redirect...

    On successful login you set the $_SESSION["logged_in"] to be 1

    At the top of each page...
    
    if ($_SESSION["logged_in"] != 1) { # User not logged in
    header("Location: domain/contactus.php");
    exit();
    }
    
    PHP:
     
    Gawk, Dec 10, 2007 IP
  4. cool_saran

    cool_saran Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    hi, thanks for ur reply. mod_rewrite is working for other functionality like , if we type url 'domain/contactus/ it will parse domain/contactUs.php. that type of functionalities working.......then how it should be....
     
    cool_saran, Dec 10, 2007 IP