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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T20:25:40+00:00 2026-06-09T20:25:40+00:00

I am working on a piece that allows user to create an article, but

  • 0

I am working on a piece that allows user to create an article, but there are some restricted for an admin, which i identify as SgroupId 1. Now when I log in with my admin code, i realize i still cant post everything, except for what I identified in loadTypeUsers. I know i get the value of Sgroup1 with me, since the admin panel loads in the bar below. Also when I echo the value I get the return of 1, which should be fine.

But when I try to load the dropdown in my popup, it wont give me the full list. Instead, it loads just the list I specified in the LoadTypeUsers. Can somebody help me out here?

Thanks in advance.

~Dorv

function MakeArticleTypeDropdown(){
        echo "<select name='ArticleTypeId'>";

        if($SgroupId == 1 || $SgroupId == 1){ 
            $results = LoadType();
        }
        else
        {
            $results = LoadTypeUsers();
        }

        while($row = mysql_fetch_array($results)){
            echo "<option value='".$row['ArticleTypeId']."'>"
                            .$row['ArticleTypeName']."</option>";
        }
        echo "</select>";
    }

This is tucked in the ArticleFunction.php file

function LoadTypeUsers(){
    $query = "SELECT * FROM Articletype limit 1,3;";
    $resultaat=SendQuery($query);
    return $resultaat;
}

    function LoadType(){
    $query = "SELECT * FROM Articletype;";
    $resultaat=SendQuery($query);
    return $resultaat;
}

This is tucked in the Sentry.php file

session_start();
$UserName = $_SESSION['username'];

$result = mysql_query("select * from user where username='".$UserName."'");
while($row = mysql_fetch_array($result)){
                $UserId = $row['UserId'];
                $CharacterName = $row['CharacterName'];
                $UserName = $row['UserName'];
                $SgroupId = $row['SgroupId'];
            };
  • 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-09T20:25:41+00:00Added an answer on June 9, 2026 at 8:25 pm

    $SgroupId is not defined in the function MakeArticleTypeDropdown() so it will always goes in else condition .Try something as follows

    MakeArticleTypeDropdown($SgroupId)
    {
    //-----------your code
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a piece of code at the moment that allows the user
I have some code (which I cannot change) that I need to get working
I'm working on a piece of code that I inherited and am trying to
I'm working on a piece of software that would work well with an iTunes
I am currently working on a project that is accessing a piece of hardware
I am working on a piece of code which uses regular expressions in c.
I'm working on a piece of C++ software which runs on all Windows versions
The following piece of code is working on Android devices and iPhone simulator but
I am working with the following piece; def index @user = User.find(params[:id]) rescue flash[:notice]
I am working on a piece of 3D software that has sometimes has to

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.