Как из javascript передать значение переменной в php?
Код |
<script type="text/javascript"> ... var string = "Privert"; <?php $string = ???; ?> ... |
HTML |
<form onsubmit="showLocation(); return false;" method="post" action=""> <table cellpadding="5"> <tr> <TD>Bundesland : </TD> <td><select name="Bundesland"> <option>All</option> <option>A</option> <option>B</option> </select> </select> </td> <td><input type="submit" name="find" value="Suche" /></td> </tr> </table> </form> <?php $string = $_POST["Bundesland"]; ?> |
HTML |
<form method="post" name="forms"> <table cellpadding="5"> <tr> <TD>Bundesland : </TD> <td><select id="Bundesland" name="Bundesland"> <option>All</option> <option>Baden-Württemberg</option> <option>Bayern</option> </select> </td> <td><span onclick="showLocation()"><input type="submit" name="find" value="Suche" /></span></td> </tr> </table> </form> |
PHP |
<?php |