Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6658473
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T01:55:04+00:00 2026-05-26T01:55:04+00:00

Okay so I have a script to check to see if someone has logged

  • 0

Okay so I have a script to check to see if someone has logged in. But the login it still displays the form to login. Here is the current script:

<?php
if(session_is_registered(myusername)){
echo $_SESSION['myusername'];
echo "<br /><a class='linkText' href='logout.php'>Logout!</a></div>";
}
else{
$login_form=<<<'LOGIN'
                    Login<br /><br /><div class="heading_02">
                    <form name="form2" method="post" action="checklogin.php" style="display:inline">
                            <input type="text" name="myusername" id="myusername" class="user" /><br />
                            <input type="password" name="mypassword" id="mypassword" class="pass" /><br />
                            <input type="submit" name="Submit" value="Login" class="green_login_02" />
                    </form>
                <a style="color: #A2FF00; text-decoration: none;" href="signup.php">Sign-up</a>

                </div>
LOGIN;
echo $login_form;
}
?>

Just as an extra side note this part of like a clamp figuratively speaking so this is inside the first half of a clamp. The clamp syntax goes like this:

<? include("clamp1.php"); ?>
content
<? include("clamp2.php"); ?>

This appears in the first half of the clamp if that is any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T01:55:05+00:00Added an answer on May 26, 2026 at 1:55 am
    session_start();
    $_SESSION['myusername']='Ka';
    
    
    function logged_in($session_name){
        if (isset($session_name) and !(empty($session_name))){
            return true;
        }else{
            return false;
        }
    }
    
    
    if(logged_in($_SESSION['myusername'])){
    echo $_SESSION['myusername'];
    echo "<br /><a class='linkText' href='logout.php'>Logout!</a></div>";
    }
    else{
    $login_form=<<<'LOGIN'
                        Login<br /><br /><div class="heading_02">
                        <form name="form2" method="post" action="checklogin.php" style="display:inline">
                                <input type="text" name="myusername" id="myusername" class="user" /><br />
                                <input type="password" name="mypassword" id="mypassword" class="pass" /><br />
                                <input type="submit" name="Submit" value="Login" class="green_login_02" />
                        </form>
                    <a style="color: #A2FF00; text-decoration: none;" href="signup.php">Sign-up</a>
    
                    </div>
    LOGIN;
    echo $login_form;
    }
    

    Works, the function session_is_registered is DEPRECATED (http://php.net/manual/en/function.session-is-registered.php). try making methods to check if a session variable is set. Don`t forget session_start()

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay I have updated my code a little, but I am still not exactly
Okay, so I already have a script to let users enter tags but I
Okay, so I have this script which works fine with IE but won't work
Okay - I have a dilemma. So far my script converts page titles into
Okay, I have this code: <script language=javascript type=text/javascript> <!-- function requestPage(page) { var request
Okay i have two models: posts and comments. as you can think comments has
Okay so I have this web site search script and I'm trying to count
Still a little gunshy about jQuery. Does this simple popup window script look okay?
I have the following problem: I have a form I need to serialize but
I have jquery script: $(#theid).fadeTo(1000,0.01).getxmo().fadeTo(1000,1); function getxmo(){ $('#output').append('okay!'); } It is not running the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.