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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T09:52:15+00:00 2026-06-18T09:52:15+00:00

I need help on 2 things since I’m not savy in PHP: Content that

  • 0

I need help on 2 things since I’m not savy in PHP:
Content that changes depending on the:

<select>
    <option>Option 1</option>
    <option>Option 2</option>
</select>

I think this can be done using PHP, by giving names to the options, having PHP get the names, creating variables depending on those names and putting an “include” that shows the changing content.

Here’s the model for the script:

READ Select
IF User selects “variable1, varialbe2,etc”
THEN Display “page1,page2,page3”
*The page changes within the page so that if the user wants to change it again they dont have to go back…Maybe this can be done by using:

<?php include 'page1.php'; ?>

That content will include a button, and depending on that button, I want a text box to be filled with certain text.

<input type="button" value="">

Then Depending on the value of that button the PHP will put text into a textbox.
From what I’ve read this will be using $request and $post …
(This of course is separate PHP)

  • 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-18T09:52:16+00:00Added an answer on June 18, 2026 at 9:52 am

    There may be a couple of different ways to accomplish your goal. If we stick to using PHP as you’ve requested then something like this is probably best. I’ve used a case/switch here for security purposes and a POST instead of a GET to prevent URL manipulation although with the case/switch you have addressed a lot of URL manipulation anyway so it becomes a matter of preference for you.

    <?php
    $page = null;
    if(isset($_POST['page'])){
        $page = $_POST['page'];
    }
    switch($page){
        case 'page3': include_once('/path/to/page3content.php'); break;
        case 'page2': include_once('/path/to/page2content.php'); break;
        case 'page1': include_once('/path/to/page1content.php'); break;
        default: include_once('/path/to/defaultcontent.php'); break;
    }
    ?>
    <form name="myform" action="" method="post">
        <select name="page" onchange="this.form.submit()">
            <option value="page1"<?php if($page == "page1"){ echo " selected"; }?>>Page 1</option>
            <option value="page2"<?php if($page == "page2"){ echo " selected"; }?>>Page 2</option>
            <option value="page3"<?php if($page == "page3"){ echo " selected"; }?>>Page 3</option>
        </select>
    </form>
    

    However, depending on your file structure, you can accomplish something similar even easer with just a little basic Javascript and HTML.

    <select name="page" onchange="window.location=this.value">
        <option value="/path/to/page1.php">Page 1</option>
        <option value="/path/to/page2.php">Page 2</option>
        <option value="/path/to/page3.php">Page 3</option>
    </select>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Since I am new to Java, I need some help about some basic things
Two things I'm trying to achieve and need help with 1) Click a link
Need help with a query that I wrote: I have three tables Company id
need help/guide for sql select query, I have 2 table stock and stock_history, in
I need some help. I'm looking to have a sidebar that toggles when a
I need help with this since I just can't figure it out by myself
Once again I need some help. I'm working with a table that contains 3
Im a javascript newbie and would need some help with this simple thing... I
I'm quite new to this Git thing and need a little help. I recently
Need help, function getFamily() { FB.api('/me/family', function(response) { alert(JSON.stringify(response)); }); } With the above

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.