Skip to main content
Stack Overflow
  1. About
  2. For Teams

Return to Question

Question Protected by Community Bot
edited title
Link
jondavidjohn
  • 62.5k
  • 21
  • 121
  • 159

HTML form select submit to PHP script

improved formatting
Source Link
Sled
  • 19.2k
  • 28
  • 125
  • 174

I am making an HTML form. I want the results to appear in the PHP script.

<form action="chk_kw.php" method="post"> <br />
 <select> name="website_string" 
 <option value="" selected="selected"></option>
 <option VALUE="abc"> ABC</option>
 <option VALUE="def"> def</option>
 <option VALUE="hij"> hij/option> 
 </select>
 <input type="submit" name="website_string" >
</form>

The problem is I cannot get the value passed to the PHP. if I use value:

<INPUT TYPE="submit" name="website_string" value="selected" >

It always passes the text in the quotes. In this case "selected". How do I pass one of the strings from the option?

I have been working many hours on this.

I am making an HTML form. I want the results to appear in the PHP script.

<form action="chk_kw.php" method="post"> <br />
 <select> name="website_string" 
 <option value="" selected="selected"></option>
 <option VALUE="abc"> ABC</option>
 <option VALUE="def"> def</option>
 <option VALUE="hij"> hij/option> 
 </select>
 <input type="submit" name="website_string" >
</form>

The problem is I cannot get the value passed to the PHP. if I use value:

<INPUT TYPE="submit" name="website_string" value="selected" >

It always passes the text in the quotes. In this case "selected". How do I pass one of the strings from the option?

I have been working many hours on this.

I am making an HTML form. I want the results to appear in the PHP script.

<form action="chk_kw.php" method="post"> <br />
 <select> name="website_string" 
 <option value="" selected="selected"></option>
 <option VALUE="abc"> ABC</option>
 <option VALUE="def"> def</option>
 <option VALUE="hij"> hij/option> 
 </select>
 <input type="submit" name="website_string" >
</form>

The problem is I cannot get the value passed to the PHP. if I use value:

<INPUT TYPE="submit" name="website_string" value="selected" >

It always passes the text in the quotes. In this case "selected". How do I pass one of the strings from the option?

I am making an HTML form. I want the results to appear in the PHP script.

<form action="chk_kw.php" method="post"> <br />
<select> name="website_string" 
<option value="" selected="selected"></option>
<option VALUE="abc"> ABC</option>
 <option VALUE="def"> def</option>
 <option VALUE="hij"> hij/option> 
 </select>
<INPUT TYPE="submit" <input type="submit" name="website_string" >
</form>
<body>
</html> 

The problem is I cannot get the value passed to the PHP. if I use value:

<INPUT TYPE="submit" name="website_string" value="selected" >

It always passes the text in the quotes. In this case "selected". How do I pass one of the strings from the option?

I have been working many hours on this.

I am making an HTML form. I want the results to appear in the PHP script.

<form action="chk_kw.php" method="post"> <br />
<select> name="website_string" 
<option value="" selected="selected"></option>
<option VALUE="abc"> ABC</option>
 <option VALUE="def"> def</option>
 <option VALUE="hij"> hij/option> 
 </select>
<INPUT TYPE="submit" name="website_string" >
</form>
<body>
</html> 

The problem is I cannot get the value passed to the PHP. if I use value:

<INPUT TYPE="submit" name="website_string" value="selected" >

It always passes the text in the quotes. In this case "selected". How do I pass one of the strings from the option?

I have been working many hours on this.

I am making an HTML form. I want the results to appear in the PHP script.

<form action="chk_kw.php" method="post"> <br />
<select> name="website_string" 
<option value="" selected="selected"></option>
<option VALUE="abc"> ABC</option>
 <option VALUE="def"> def</option>
 <option VALUE="hij"> hij/option> 
 </select>
  <input type="submit" name="website_string" >
</form>

The problem is I cannot get the value passed to the PHP. if I use value:

<INPUT TYPE="submit" name="website_string" value="selected" >

It always passes the text in the quotes. In this case "selected". How do I pass one of the strings from the option?

I have been working many hours on this.

added 1 characters in body; edited tags
Source Link
jondavidjohn
  • 62.5k
  • 21
  • 121
  • 159
Loading
Source Link
Joe
  • 335
  • 2
  • 4
  • 12
Loading
default

AltStyle によって変換されたページ (->オリジナル) /