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

  • Home
  • SEARCH
  • 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 7876789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:13:25+00:00 2026-06-03T03:13:25+00:00

Please i need your help with my script. I’m trying to post comments to

  • 0

Please i need your help with my script. I’m trying to post comments to news items on sections on my website only for users who are logged in. If they are not, they are shown a link to Login or Register, and the “Post A Comment” inputbox does not display.
Then when they login the form should display.

The form does not display, when they are not logged in, but it does not also show the form when they are logged in.

Please where could the broblem be.. Thank you for your time and patience. I apppreciate it.

 <?php 

if (!isset($_SESSION['username']))  {

echo "<a href=\"login.php\">Login</a>     OR <a href=\"register.php\">Register</      a> to make a comment" ; 
             }
             exit();
 ?>






  <?php

  if (isset($_POST['submit'])) {

     //process form

             }

           ?>
     Post A Comment <br/>  
      <form action="<?php echo $_SERVER       ['PHP_SELF']; ?>" method="post"> 
                    <textarea type="text"  name                  = "comment_body" title='Post A      Comment'  class='OpenInput_Text'  ></       textarea><br/> 
 <input type="submit" name="submit"      value="Post Comment"> 
 </form>  
 </div> 
 </div> 
  • 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-06-03T03:13:26+00:00Added an answer on June 3, 2026 at 3:13 am

    You will need to start your sessions.

    Replace

    <?php 
    
    if (!isset($_SESSION['username']))  {
    

    With

    <?php 
    session_start();
    if (!isset($_SESSION['username']))  {
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Please I need your help with my script. I'm trying to insert values into
please i need you help with my script.. I'm trying to echo some content
Please i need your help with my script. Whenever i include AND maintable.semester_name =
Please I need your help with my script. I'm puting a link to old
Please i need your help with how to include INDEXES in my tables, i've
I need some help! Please. I am trying to develop a very very simple
please I need your help with a Linq expression: I have nested objects with
I'm new to this ExpandableListView and I desperately need your help please. I'm using
Please your opinion on the following code. I need to calculate the diff in
Please help! I need to produce a Crystal Report with multiple data columns, but

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.