Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dataSelect = [3,5,10,15,20];
- $select = '';
- for($i=0; $i < count($dataSelect); $i++) {
- $select .= '<option>'.$dataSelect[$i].'</option>';
- }
- if(isset($_POST['submit'])) {
- echo $_POST['pilih'];
- }
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <title>Select Data</title>
- </head>
- <body>
- <form action="tes.php" method="POST" enctype="multipart/form-data">
- <select name="pilih"> <?php echo $select;?> </select>
- <button type="submit" name="submit">Send Data</button>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement