php - Why the fields from the form do not get printed? -


When the data from the following form is submitted to action.php , then this second variables Prints the form's date but returns an error for the first and third fields, why is it so?

HTML:

  & lt; form method = "post" action = ". / Action.php" & gt; & Lt; Span id = "type_tweet" & gt; Write your tweet & lt; / Span & gt; & Lt; Period & gt; & Lt; textarea rows = "4" cols = "80" id = "tweet_entered" & gt; & Lt; / Text field & gt; & Lt; / Span & gt; & Lt; Hour / & gt; & Lt; Span & gt; When to Tweet & lt; / Span & gt; & Lt; Span id = "date" & gt; & Lt ;! - Date - & gt; & Lt; Input type = "text" name = "selected date" id = "selected date" just click to read = "GetDate (this);" & Gt; & Lt; / Span & gt; & Lt; Span id = "at" & gt; @ & Lt; / Span & gt; & Lt; Span id = "time" & gt; & Lt ;! - time - & gt; & Lt; input type = "text" class = "timepicker" name = "selected time" id = "timepicker" /> & Lt; / Span & gt; & Lt; Period & gt; & Lt; Input type = "submit" value = "submit" id = "schedule_button" /> & Lt; / Span & gt; & Lt; / Form & gt;   

PHP: (action.php)

  & lt ;? Php echo $ _POST ["tweet_entered"]; Echo "
"; Copy $ _POST ["Selected Date"]; Echo "
"; Echo $ _POST ["timepicker"]; Echo "
"; ? & Gt;

Errors when run action.php :

  Notice: Undefined index: tweet_entered in E: \ Installed_Apps \ xampp \ Htdocs \ twibuffer \ action.php on line 2 4/29/2014 Notice: Undefined Index: Timepicker E: \ Installed_Apps \ xampp \ htdocs \ twibuffer \ action.php on line 6   < / Div> 

You have to change it

textarea rows = "4" cols = "80" id = "Tweet_entered" & gt; & Lt; / Textarea & gt;

& lt; Textarea rows = "4" cols = "80" id = "tweet_entered" name = "tweet_entered" & gt; & Lt; / Textarea & gt;

and

input type = "text" class = "timepark" name = "selected time" id = "timepicker" / & gt;

& lt; Input type = "text" class = "timepaper" name = "timepacker" id = "timepicker" /> ;

is a name attribute that loads in the $ _POST variable

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -