SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Location
    Mumbai- India
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    conditional redirect

    Please help

    I am using following code to check whether login user id and password is ok

    If ok or fail -> I want to redirect to a file ...but code is not working please help

    Thanks in advance

    if(isset($_POST['login'])){
    if (($_POST['loginid'] == $uid) and ($_POST['password'] == $pas))
    {


    header("Location: http://prajaktasoftware.com/INTROL.html/");
    exit;
    }
    else
    {

    header("Location: http://prajaktasoftware.com/index.html/");
    exit;
    }

  2. #2
    Theoretical Physics Student bronze trophy Jake Arkinstall's Avatar
    Join Date
    May 2006
    Location
    Lancaster University, UK
    Posts
    7,062
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Try this::
    PHP Code:
    if(isset($_POST['login'])){
      if (
    $_POST['loginid'] == $uid && $_POST['password'] == $pas){
        
    header("Location: http://prajaktasoftware.com/INTROL.html");
      }else{
        
    header("Location: http://prajaktasoftware.com/index.html");
      }

    Jake Arkinstall
    "Sometimes you don't need to reinvent the wheel;
    Sometimes its enough to make that wheel more rounded"-Molona

  3. #3
    SitePoint Member Aaron P Rivera's Avatar
    Join Date
    Mar 2007
    Posts
    23
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking

    Quote Originally Posted by arkinstall View Post
    Try this::
    PHP Code:
    if(isset($_POST['login'])){
      if (
    $_POST['loginid'] == $uid && $_POST['password'] == $pas){
        
    header("Location: http://prajaktasoftware.com/INTROL.html");
      }else{
        
    header("Location: http://prajaktasoftware.com/index.html");
      }

    I agree with above?

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Location
    Mumbai- India
    Posts
    42
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    thanks thanks ..but still one more problem

    It works well indeed
    thanks

    one more problem

    the values accepted are not initialised hence when i type this inurl in adress linbe it just re-directs ...


    the values stored in $_POST['loginid']
    and $_POST['password'] are stored in memory
    hence when i try the url for aceepting user id and password it re-directs automatically .insted of asking the user id and password

    How do i initialise so as to avoid this


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
  •