php - Changing word printed depending on selected value from dropdown
Get the solution ↓↓↓<form id="category" method="post">
<?php
$option = null;
?>
<label for="query1"> Please choose a category: </label>
<select name="query1" onchange= <?php $option == $_POST['query1']; echo "<p> poop </p>" ?>>
<option value="Youtubers"> Youtubers </option>
<option value="Channels"> Channels </option>
</select>
</br>
<label for="query2"> Please choose a sort method for <?php if(isset($_POST['query1'])){
if($option == "Youtubers"){
echo "<p> Youtubers </p>";
}
if($option == "Channels"){
echo "<p> Channels </p>";
}
}?>: </label>
<select id="query2">
<option value="Sub Count"> Sub Count </option>
<option value="Origin"> Origin </option>
<option value=""> Origin </option>
</select>
</form>
I am trying to change the last word of my second query to be whatever option is selected from the first query. I am storing the input in $option but it seems to not be working.
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: trying to access array offset on value of type bool in
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.