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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:56:06+00:00 2026-06-06T23:56:06+00:00

Currently i have multiple select tags that have almost the same option choices, what

  • 0

Currently i have multiple select tags that have almost the same option choices, what i did now is used file_get_contents to get the value of option tags and assign them to the select tags. but i wanted to create a more efficient way of doing this since when i tried to add an if condition inside the file for the file_get_contents to filter out some extra option tags that should only be available to some select tags it did not work. so i was wondering what is the best approach for this?

basically i used file_get_contents to get the file that contains the basic option tags and assign them to the select tags.

thanks
-magician

Code for some:

some.php

<option>1</option>
<option>2</option>
... you get the picture

for other files.php

<select>
$hello = file_get_contents("some.php");
echo $hello;
</select>

now when i add a condition at some.php ie

if($right=1)
{
this is only for this page
}

//this does not work instead it displays it to all select tags.

  • 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-06T23:56:07+00:00Added an answer on June 6, 2026 at 11:56 pm

    in my opinion, file_get_contents is used to retrieve data from a static file (like a txt file), store it into a string and do further processing.

    To achieve what you are trying to do, you would need to use the include directive, since you obviously want variables from the first page to be available for the if statement in the second page

    As the manual states, “When a file is included, the code it contains inherits the variable scope of the line on which the include occurs. Any variables available at that line in the calling file will be available within the called file”

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

Sidebar

Related Questions

Currently we have dueling select lists where you can select multiple employees from Available
I currently have one project that currently contains multiple packages. These packages make up
I currently have an app that requires connection to a server in multiple activities.
I currently have multiple queries that query data from a few tables linked through
I currently have data that I am splitting into multiple sheets and allowing the
I have multiple linq queries that retrieve the same data just at different grouping
I am building an android application that reads text files. Now,i have multiple text
I have multiple selects: <select id=one> <option value=1>one</option> <option value=2>two</option> <option value=3>three</option> </select> <select
I have a form with multiple select dropdown menus that start with the id:
I currently have a single web server hosting multiple WordPress sites which use W3TC.

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.