kylesite
10-21-2003, 01:03 AM
This is one of my first PHP scripts:
<?php
$to = "webmaster@kylesite.port5.com";
echo "
<center>
<form action=\".$_SERVER[$PHP_SELF].\" method=\"post\">\n
<input name=\"a\" value=\"Name\">\n
<br>\n
<input type=\"submit\" value=\"send\">\n
</center>
";
if (isset($_POST['a'])){
$_SESSION['a'] = $_POST['a'];
echo "Hello $_SESSION['a']. Message to $to has been sent.";
mail($to,"Name","$_POST['a'] used the form", "From:$to<Kyle>");
} else {
echo "You didn't fill out the form!";
}Would it work?
<?php
$to = "webmaster@kylesite.port5.com";
echo "
<center>
<form action=\".$_SERVER[$PHP_SELF].\" method=\"post\">\n
<input name=\"a\" value=\"Name\">\n
<br>\n
<input type=\"submit\" value=\"send\">\n
</center>
";
if (isset($_POST['a'])){
$_SESSION['a'] = $_POST['a'];
echo "Hello $_SESSION['a']. Message to $to has been sent.";
mail($to,"Name","$_POST['a'] used the form", "From:$to<Kyle>");
} else {
echo "You didn't fill out the form!";
}Would it work?