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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T20:03:58+00:00 2026-06-13T20:03:58+00:00

Ok so basically what I am trying to do is show a div if

  • 0

Ok so basically what I am trying to do is show a div if MySQL row data is equal to an entered value for example if the user type column says admin-full it needs to show some content.

I am quite new to PHP so I really appreciate your help on this my code is as follows.

<?php

$row_user['type'] = $user_type;

if ($user_type == admin_full)
{
    <!-- START DIV DROPDOWN BOX--> 
  <div class="dropbox">
            <a id="myHeader1" href="javascript:showonlyone('newboxes1');" >show this one only</a>
  </div>   
  <div class="newboxes" id="newboxes1">Div #1</div>
  <!-- END DIV DROPDOWN BOX-->
}
  ?> 
  • 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-13T20:03:59+00:00Added an answer on June 13, 2026 at 8:03 pm
    <?php
    

    Like this

    <?php
        // you probably have this line wrong. 
        //$row_user['type'] = $user_type; 
        // and you want
        $user_type = $row_user['type'];
    
        // I am assuming admin_full is not a constant, otherwise remove the single quotes 
        if ($user_type === 'admin_full') 
        {
        ?>
            <!-- START DIV DROPDOWN BOX--> 
                <div class="dropbox">
                    <a id="myHeader1" href="javascript:showonlyone('newboxes1');" >show this one only</a>
                </div>   
                <div class="newboxes" id="newboxes1">Div #1</div>
            <!-- END DIV DROPDOWN BOX-->
        <?php
        }
        else {
            ?>
    
            Oops, what the duce are you doing dude!
    
            <?php
        }
        ?> 
    

    I am assuming admin_full is not a constant and you wanted a string otherwise replace that line with

    if ($user_type == admin_full)

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

Sidebar

Related Questions

I'm basically trying to do a dropdown jquery plugin. HTML <script type='text/javascript' src='script.js'></script> <div
So basically I am trying to have div.show fade in on hover and then
Basically on .show() I've been trying to have all of the inputs convert to
I'm basically trying to create a url friendly query string with user input. The
What im basically trying to do is to confirm the identity of the user
I am basically trying to hide a DIV on the homepage but have it
Basically i'm trying to build a comment system. The user looks at a photo
Basically I am trying to show hide divs and links, but having some trouble.
basically what i am trying to do i have 2 div which are hidden
Basically I've been trying to use jQuery to show() and hide() a sub navigation

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.