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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:00:31+00:00 2026-06-01T23:00:31+00:00

I have a variable holding the structure of a table, I want to add

  • 0

I have a variable holding the structure of a table, I want to add php code inside the table. I’ve tried adding the code statement to a variable and then fetching the variable data inside the table but I Think is not possible, what is the right way of doing it.

$table='<table border="1" cellspacing="0" cellpadding="0"><tr>
        <td width="638" valign="top">**ADD CODE HERE**</td></tr>
        </table>';
echo $table;

Here is the code i want to add inside the column:

if($_SESSION['Mmsg']['Mreg-err'])
    {
        echo '<div class="err">'.$_SESSION['Mmsg']['Mreg-err'].'</div>';
        unset($_SESSION['Mmsg']['Mreg-err']);
    }       
if($_SESSION['Mmsg']['Mreg-success'])
    {
        echo '<div class="success">'.$_SESSION['Mmsg']['Mreg-success'].'</div>';
        unset($_SESSION['Mmsg']['Mreg-success']);
    }

I’ve tried adding the code inside $notification and then adding

$notification='if($_SESSION['Mmsg']['Mreg-err'])
    {
    echo '<div class="err">'.$_SESSION['Mmsg']['Mreg-err'].'</div>';
        unset($_SESSION['Mmsg']['Mreg-err']);
    }       
    if($_SESSION['Mmsg']['Mreg-success'])
        {
        echo '<div class="success">'.$_SESSION['Mmsg']['Mreg-success'].'</div>';
        unset($_SESSION['Mmsg']['Mreg-success']);
        }';

‘ . $notification . ‘

Inside the table like:

$table='<table border="1" cellspacing="0" cellpadding="0"><tr>
            <td width="638" valign="top">' . $notification . '</td></tr>
            </table>';
echo $table;

But is not possible, is there a way to achieve this? i am a newbie

  • 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-01T23:00:34+00:00Added an answer on June 1, 2026 at 11:00 pm

    EDIT added your unsets…

    if($_SESSION['Mmsg']['Mreg-err'])
        $notification = '<div class="err">'.$_SESSION['Mmsg']['Mreg-err'].'</div>';
    if($_SESSION['Mmsg']['Mreg-success'])
        $notification = '<div class="success">'.$_SESSION['Mmsg']['Mreg-success'].'</div>';
    
    unset($_SESSION['Mmsg']['Mreg-err']);
    unset($_SESSION['Mmsg']['Mreg-success']);
    
    $table='<table border="1" cellspacing="0" cellpadding="0"><tr>
            <td width="638" valign="top">' . $notification . '</td></tr>
            </table>';
    echo $table;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a variable holding the column name. I want to do a select
I have a variable holding values separated by a comma (Implode), and I'm trying
I have 20 different variable-length arrays, each holding a unique value, and I need
I have variable in the parent document eg. $var = 'blah'; Then a div
I have the following query within inside a select if in my code and
hi have a code structure like this public static $userId; public static $checkUserId; public
I have an array of type string which I want to re-use inside a
My iframe has a variable. I want to access document holding the iframe and
How do I print the variable name holding my object? For example, I have:
I have tried to make a webservice interface to a state-holding COM component. 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.