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 8751143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:59:25+00:00 2026-06-13T12:59:25+00:00

Please help, i am trying to make it so that upon users or guests

  • 0

Please help, i am trying to make it so that upon users or guests visiting my webpage they will see a text area which is disabled and once they’ve logged in they can then click to edit this text area.

I have it pretty much set up how i want it but at the moment if a user logs in the text areas are switched from the disabled one to the editable one. but then all the other text areas of the other profiles disappear and i want these to stay so the logged in user can see other users ones but not edit them?

Hope i’ve explained that clearly enough. Hope this is possible?

<?php if (isset($_SESSION['user_id'])) { 
            if ($user['id'] == $_SESSION['user_id']){
 ?>                 

<textarea id="area"  rows="10" style="
    width: 456px; 
    margin-top:3px;
    text-align:left;
    margin-left:-2px;
    height: 122px;
    resize: none; 
    border: hidden;"><?php echo $profile['bio'] ?> </textarea>

<?
} 
}
?>

<?php
    if (!logged_in()) {
        ?>

<textarea id="area-read" disabled="yes" style="
    width: 456px;
    margin-top:3px;
    text-align:left;
    margin-left:-2px;
    height: 122px;
    resize: none; 
    border: hidden;"><?php echo $profile['bio'] ?> </textarea>
<?
} 
?>
  • 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-13T12:59:26+00:00Added an answer on June 13, 2026 at 12:59 pm

    You said for other profiles, the textarea disappears. That is because after the user logs in, his session is set. And only in profiles where id is equal to the session user_id, the textarea is printed. So you need to handle the else case for the if inside the first if block.

    <?php
    if (isset($_SESSION['user_id']))
    { 
        if ($user['id'] == $_SESSION['user_id'])
        {
    ?>                 
    
        <textarea id="area"  rows="10" style="
        width: 456px; 
        margin-top:3px;
        text-align:left;
        margin-left:-2px;
        height: 122px;
        resize: none; 
        border: hidden;"><?php echo $profile['bio'] ?> </textarea>
    
    <?php
        }
        else
        {
        //Printing the text area for other users/profiles. This is what you said was missing.
    ?>
    
        <textarea id="area-read" disabled="yes" style="
        width: 456px;
        margin-top:3px;
        text-align:left;
        margin-left:-2px;
        height: 122px;
        resize: none; 
        border: hidden;"><?php echo $profile['bio'] ?> </textarea>
    
    <?php
       }
    }
    ?>
    
    <?php
        if (!logged_in()) 
        {
    ?>              
        <textarea id="area-read" disabled="yes" style="
        width: 456px;
        margin-top:3px;
        text-align:left;
        margin-left:-2px;
        height: 122px;
        resize: none; 
        border: hidden;"><?php echo $profile['bio'] ?> </textarea>
    <?php
        } 
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make a Text Editor using Java Swing. In that I
I am trying to make an app that will display a bunch of different
I am trying to make my ASP:Listbox throw an event in javascript that will
so i am trying to make dynamic checkboxs that will show/hide certain content when
So Im trying to make an object dynamically, please see below code from my
Please help. As I have stated in the title I am trying to make
I am trying to make an script that will every second read string from
Please help with this issue, I'm going mad... I'm trying to make a client-server
I am trying to make a script that will let me download files outside
This is my first android project so please help I am trying to create

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.