[Solved] select what is being shown on index, Php [closed]


I’ll try to get you on the right way.
But you’ll have to try and update it yourself to suit your needs.

Below code could be your index page.

<?php
if(isset($_POST['submit']))
{
    $page = $_POST['page'];
}
else {
    $page="home";
}
?>
<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
   <select name="page">
        <option value="home">Home</option>
        <option value="something">Some other page</option>
    </select>
   <br><input type="submit" name="submit" value="Submit Form"><br>
</form>

<div id="content">
    <?php include($page.'.php'); ?>
</div>

So now you are able to include ‘what-ever-value-of-select’.php in the content div of the index.php page.

Note: you really should check if the post data has save value etc. I suggest googling the how-to-do-that.

2

solved select what is being shown on index, Php [closed]