Re: question about displaying select and radio button

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



the PHP code I write... WRITEs the HTML... so I would do the 'select' as follows:

<?php
$pcontactnumber = isset ( $_POST["pcontactnumber"] ) ? $_POST["pcontactnumber"] : 0 ;
echo '<select name="pcontactnumber">'."\n";
echo '<option value="'.$pcontactnumber.'">'.$pcontactnumber.'</option>'."\n";
echo '</select>'."\n";
?>

In this manner (above)... you present only the value that they chose... and do not ALLOW 
them to change the value, without going BACK to the previous page.


ALSO a STYLE COMMENT - to everyone:  ADD SPACES to your code.  It makes it a LOT easier 
to read.


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Soap]     [Kernel Newbies]     [Yosemite]     [Yosemite Campsites]

  Powered by Linux