Results 1 to 2 of 2

Thread: Boolean Question

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2007
    Posts
    65

    Question Boolean Question

    Code:
    <?PHP
    If ($Success == True) {
    Header("Refresh: 2; Url=Panel.php");
    }
    ElseIf ($Success == False) {
    Header("Refresh: 2; Url=Index.php");
    }
    ?>
    <Html>
    
    <Head>
    <Title>Control Panel</Title>
    <Link Href="LGStyle.css" Rel="StyleSheet" Type="Text/Css" />
    <Meta Http-Equiv="Content-Type" Content="Text/Html; Charset=Utf-8" />
    </Head>
    
    <Body>
    <?PHP
    If (($_GET["User"] == "Admin") && ($_GET["Pass"] == "ADPass")) {
    Echo "<Center><P Class=LGStyle>Login Completed</P></Center>";
    $Success = True;
    }
    Else {
    Echo "<Center><P Class=LGStyle>Incorrect Login</P></Center>";
    $Success = False;
    }
    ?>
    </Body>
    
    </Html>
    I Think I Did Something Wrong
    It Redirects Only To Index.php I Don't Know What The Error Is

    Thnx

  2. #2
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Boolean Question

    At the start of your script, $Success does not exist. If you need to persist variables between scripts you should use a session.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width