php - Select option not passing values -


My selection options are not passing I do not know why this is not working, it will be appreciated, but I do not know what's going on.

HTML / PHP

  if (isset $ _POST ['submit'])) {$ name = release ($ _ POST ['name'])? Trim ($ _ POST ['name']): '';   date  gt; & lt; l & gt; LHA & lt; / th & gt; & lt; th & gt; ax & lt; / th & gt; & lt; Lt; th & gt; ls  gt; update & lt; / th> & lt; / tr & gt;;; $ Sql ​​= "SELECT * data from where name = '$ name' date from date"; "; $ Sth = $ pdo- & gt; Query ($ sql); While ($ line = $ sth-> fetch ()) {$ car = $ line ['car']; Echo "& lt; form action = '' method = 'post' & gt;"; Echo "& lt; tr & gt;"; Echo "& lt; td & gt;" . $ Line ['name'] "& Lt; / td & gt;"; Echo "& lt; td & gt; & lt; input type = 'text' name = 'car' placeholder = '' $ line ['car']. '' Value = '' & gt; & lt; / td & Gt; "; Echo "& lt; td & gt; & lt; input type = 'text' name = 'car' placeholder = '' $ line ['night']. '' Value = '' & gt; & lt; / td & Gt; "; Echo "& lt; td & gt; & lt; input type = 'text' name = 'car' placeholder = ''. $ Line ['citid']. '' Value = '' & gt; & lt; / td & Gt; "; Echo "& lt; td & gt; & lt; input type = 'text' name = 'car' placeholder = ''. $ Line ['date']. '' Value = '' & gt; & lt; / td & Gt; "; In this example, " & lt; input type = 'text' name = 'car' placeholder = '' $ line ['LH']. '' Value = '' & gt; & lt; / td & Gt; "; Echo "& lt; td & gt; & lt; input type = 'text' name = 'car' placeholder = ''. $ Line ['AAS']. '' Value = '' & gt; & lt; / td & Gt; "; Echo "& lt; td & gt; & lt; input type = 'text' name = 'car' placeholder = '' $ line ['ls']. '' Value = '' & gt; & lt; / td & Gt; "; Echo "& lt; input type = 'hidden' name = 'pid' value = ''. $ Line ['PID']. "'/ / Gt;"; Copy "& lt; td & gt; & lt; input type = 'submit' name = 'submit' value = ''. $ Line ['PID']. ' '/ / Gt; & Lt; / Td> "; Echo" & lt; / Tr & gt; "; echo" & lt; / Form & gt; ";} resonates" & lt; / Table> "; $ Pdo = NuLL;} Then {echo" Choose a user ";}? & Gt;   

HTML form

  
Select name = "name" id = "name">

Due to this, you have no value in your option tag

try it

   action = "" method = "Post" & gt; Select name = "name" id = "name" & gt; & lt ;? php foreach ($ line as $ data):? & Gt; & lt; option value = "& Lt ;? Php = $ row ["user_name"]? & Gt; "& gt; Php echo $ row [" user_name "]? & Gt; & lt; / option & gt; & lt ;? php endforeach? & Gt; & lt; / select & gt; & Lt; input type = "submit" value = "submit" & gt; & lt; / form & gt;   

and use it php tags in its better manner, its Instead of what you are using at this time

  $ name = isset ($ _ POST ['name'])? Trim ($ _ POST ['name']): ''; < Lt ;? Php echo $ row ["user_name"]? & Gt; // I do not know why you have this line here   

to display more results

  & lt ;? php echo $ name; & gt;    

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -