html - form php not working [array] -


i need show var_dump 'selected country' , can't , because problem in $res (array) $id

<?php if(isset ($_post['submit'])) {     $id = $_post['cata'];      $api = new soapclient ( 'http://www.webservicex.com/globalweather.asmx?wsdl' );     $res = $api->getcitiesbycountry(array( 'countryname' =>"$id"));      var_dump($res); } ?>   <form action="" name="cata">     <select>         <option>israel</option>         <option>egypt</option>     </select>     <br>     <input id='sumbit' name='submit' type='submit' value='tim'> </form> 

still not working , think problem in

  $res = $api->getcitiesbycountry(array( 'countryname' =>"$id"));

define cata select name not form name

so define form below

<form action="" method="post"> //<--- set method retrieving data in php    <select name="cata"> //<--here name field       <option>israel</option>       <option>egypt</option>   </select>   <br>   <input id='sumbit' name='submit' type='submit' value='tim'> </form> 

and set in php

$id = $_post['cata'] 

Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -