Ok I am needing to create a simple function to change text submitted by a form.
I have a form with a drop down select. This form is posting to another page and I am getting the data using the <?php echo $_POST["frame"]; ?> function
This echo's the value that is set in the form. I am wanting to change the value that is being displayed only on this one page. I would like to data to stay the same, but show something different
Example:
I know this is not the correct code, using as example:
<form action="nextpage.php" method="post"> <select name="frame" id="frame"> <option value="#000000">Black Frame</option> <option value="#0000FF">Red Frame</option> <option value="#FFFFFF">White Frame</option> </select> <input type="submit"> </form>
The form has a drop down to select a frame color. I used a hex code as a value, so on the next page it is pulling the data using the above code and it is displaying the hex code.
What I would like for it to do is enter in the name of the color that is shown in the drop down menu.Such as "Black Frame" instead of "#000000"
I've been thinking about creating an external php file that will sort of "translate" the text. Like, if $frame #000000 then echo Black Frame , but as a newbie I am unsure how to do this correctly