PHP Not Getting Text From Textbox
Whenever I enter text into the textbox, it is not properly transferring to PHP. PHP reads the input as null, when in reality, there is text in there. PHP code. //Two Email Line
Solution 1:
The line:
$email_form = $_POST['email_text'];
needs to match the name of the text in the form which in your case is name="e3text" so you should use:
$email_form = $_POST['e3text'];
Solution 2:
Its because your form doesn't actually contain an input element named email_text which is referenced in your PHP code. You need to structure your HTML form code to at least look like this or change your PHP code to require $_POST['e3text'].
<div id="form">
<form method="post" action="Email_Form_Script.php" enctype="text/plain" onsubmit="window.open('FormPopUp.html','popup','width=500,height=500,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0');" >
<div>
<input type="text" class="text" name="email_text" id="emailForm" value="Enter your e-mail address" onfocus="if(this.value=='Enter your e-mail address') { this.value = '' }" onblur="if(this.value=='') { this.value = 'Enter your e-mail address' }" />
<input type="hidden" value="" name="email2"/>
<input type="hidden" name="loc" value="en_US"/><input type="submit" class="submit" value="" />
</div>
</form>
</div>
Solution 3:
try this in your php code
$email_form = $_POST['e3text'];
"e3text" is the name of your text box so in php use this name
Solution 4:
When you hit the submit button of your form, values are passed as:
name of the input field = value of the input field
Your field is name e3text - please refer to such field in your script, i.e. $_POST['e3text'].
Post a Comment for "PHP Not Getting Text From Textbox"