Click here to Skip to main content
15,888,121 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
PHP
   <select class="form-control" id="oid">
         <option>--Select--</option>
        <?php
        while($row=mysqli_fetch_array($run))
        {
        ?>
        <option value="<?= $row['id'];?>"><?= $row['first_name'];?> #<?= $row['mobileno']; ?></option>
        <?php
        }
        ?>
   </select>




<?php
 echo $row['id'];

 ?>


What I have tried:

i want to echo this select option value in php , it will catch easily in javascript but cant echo in php
Posted
Updated 19-Nov-18 3:49am
v2

1 solution

PHP is server side
JAVASCRIPT is client side

PHP has no idea what the client does on their system unless the data is sent to the server. Via form, AJAX, link, or whatever you can devise.

JavaScript may help you build the 'launcher' to get the data to the server.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900