php:
if(isset($_POST['submit_']))
{
if(isset($_POST['textEditor']) && !empty($_POST['textEditor']))
{
echo 'hello';
$msg = $_POST['textEditor'];
echo ($msg);
}
}
html:
<input type="submit" name="submit_" value="Add" />
<textarea name="textEditor" rows="20" cols="60" > </textarea>
I want to print the content of the text area when submit button is clicked. But even when the textarea is non-empty, it prints nothing.
For testing, I printed 'hello', but it still prints nothing that is the second ' if ' statement is not satisfied. I do not understand why does the second ' if ' statement fail !
And if I remove the second if statement, then I get an error:
Notice: Undefined index: textEditor in...