I am trying to get my website to submit an email every time someone would message (right now I'm just working on getting my variables to work...). It's a learning process so I'm here for it all and just trying to teach myself. However non of the GLOBAL php commands like $_post
and $_get
are working. I even tried different ways but to no avail.
<?php
$person = $_Post['pName'];
echo "before";
echo $person;
echo "after";
echo $_Get['pName'];
?>
but this never submitted anything. My form has the method="post"
and the action="TestSend.php"
. Yes the file name is TestSend.php too. Also, the php DOES display the "beforeafter" in the browser after I click "Submit" on my website.
If you want to test it yourself it is on my website at www.turnedbrigade.com.
One last question, do I need the html tag and the body tag with my php file?
Here's the html coding.
<form action="TestSend.php" method="post">
Name: <input name="pName" type="text" placeholder="Name"/>
Email: <input name="pEmail" placeholder="Email"/><br/>
Message: <br/><textarea name="pMessage" rows="8" cols="60" placeholder="Message"></textarea><br/>
<input type="submit"/>
</form>
Edited:
<?php
$from = $_POST['pName'];
$email = $_POST['pEmail'];
$subject = "Forums";
$message = $_POST['pMessage'];
mail("email will go here", $subject, $message, $from);
?>
For this email part of it, my page just goes blank and I never get anything posted past it.
HTML
HTML http://img716.imageshack.us/img716/6872/c7a3.png PHP