Jump to content

Display Section


Dysan

Recommended Posts

Whats the easiest way to display the selected option within a drop down menu on a different page, in order to confirm what was selected?

 

<form name="form1" method="post" action="">
  <select name="select">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
  </select>
</form>

Link to comment
https://forums.phpfreaks.com/topic/109739-display-section/
Share on other sites

Add the page name you want to go to in the form

<form name="form1" method="post" action="newpage.php">
  <select name="select">
    <option>1</option>
    <option>2</option>
    <option>3</option>
    <option>4</option>
  </select>
</form>

 

on newpage.php

<?php
$drop_value = $_POST['select'];
echo "You have selected $drop_value as your option";
?>

 

Ray

Link to comment
https://forums.phpfreaks.com/topic/109739-display-section/#findComment-563132
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.