Saturday, 15 March 2014

Trying to Echo a value from a select drop down in PHP -


I am in school for web development, so I do not know very clearly I have a price I'm trying to catch up, and I'm outputting it in the paragraph. I know it's about Brown, but everything else works, but I can not get anything on stack overflow, or how Google can get that work I get the following error:

Notice: Undefined variable: D in draft: \ wamp \ www \ lab5 \ process.php at line 42

This error is in my paragraph, which I think is I'm gaining value , But is it not output correctly? I am using a variable to show how I want to output that value in the paragraph.

This is my html:

  & lt; Li & gt; & Lt; Select id = "UDraft" & lt; Select & gt; & Lt; Option value = "draft offs" & gt; Draft Offense & lt; / Value & gt; & Lt; Option value = "draft defense" & gt; Draft Defense & lt; / Value & gt; & Lt; Option value = "Do business with them, we can not do any good" & gt; Do business with them, we can not do any good anymore & lt; / Value & gt; & Lt; / Select & gt; & Lt; / Li & gt;  

This is my process.php code:

  if (isset ($ _gET ["uDraft"])) {$ draft = $ _GET [" UDraft "]; } Echo "I want to produce ** $ draft var ** for the price they choose, so it shows a preference in a paragraph that is already written";  

All my text boxes work, I can not get the value from choosing, so that I can say in the paragraph text. I also had a choice to win, but when I could not understand how to capture the value I know that I can use the radio button, but I am trying to learn how to drop the value from the drop down Hold on Any help will be very much appreciated.

You should name your dropdown:

HTML :

  & lt; Li & gt; & Lt; Select name = "uDraft" & gt; & Lt; Option value = "draft offs" & gt; Draft Offense & lt; / Option & gt; & Lt; Option value = "draft defense" & gt; Draft Defense & lt; / Option & gt; & Lt; Option value = "Do business them, we can not afford any good" & gt; Do business with them, we can not do any good anymore & lt; / Option & gt; & Lt; / Select & gt; & Lt; / Li & gt;  

PHP:

  if (isset ($ _gET ["uDraft"])) {$ draft = $ _GET ["uDraft"]; Echo $ draft; }  

No comments:

Post a Comment