note 8069 added to Strings
| From: | ryan at america dot com | Date: | Fri, 25 Aug 2000 23:34:12 +0000 |
| Subject: | note 8069 added to Strings | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-3263@lists.php.net to get a copy of this message | ||
what is wrong with this code? I am making a form to post to itself (like $PHP_SELF).. i am using
the vars i have defined in the php in the html as well, help, if you need a better example of this,
check out
http://www.underways.net/webmail/devel/sendmail.phps
Thanks for your help; Please email me back soon!
<?php
header("Window-target: _top");
#The Sendmail code.
var $sender;
var $mailhello = "HELO underways.net\r\n\r";
var $mailfrom = "MAILFROM: $sender\r\n\r";
var $sendto = "RCPT TO: $sendto\r\n\r";
var $mailhdr = "To: <$sendto>\r\nFrom: $sender\r\nSubject: $subject\r\nMIME-Version:
1.0\r\nX-Mailer:utis-webmail v1.0\r\n\r";
$connect = pfsockopen("underways.net", 25, &$errno, &$errstr, 120);
if(!$connect) {
echo "Could not connect to mailserver<br>\n";
echo "$errstr ($errno)<br>\n";
} else {
fputs ($connect, $mailhello, strlen($mailhello));
fputs ($connect, $mailfrom, strlen($mailfrom));
fputs ($connect, $sendto, strlen($sendto));
fputs ($connect, "DATA:\r");
fputs ($connect, $mailhdr, strlen($mailhdr));
fputs ($connect, $message, strlen($message));
fputs ($connect, ".\r");
#Generate HTML Page to confirm mailing.
echo "yeah this shit worked..\n";
}
close($connect);
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\">";
echo "<HTML>";
echo "<TITLE>Underways: Webmail</TITLE>";
echo "<BODY BACKGROUND=\"\" BGCOLOR=\"Black\" TEXT=\"#999999\"
LINK=\"#A58475\" VLINK=\"#755E53\">";
echo "<center>";
echo "<table border=\"0\" width=\"400\"><tr><td>";
echo "<table border=\"0\" bgcolor=\"#999999\"
width=\"400\">";
echo "<tr><td><b>";
echo "<font face=\"Verdana, Arial\" color=\"black\"
size=\"2\">";
echo "Underways Tunnell Internet Services - Sendmail ";
echo "</tr><td></b></font>";
echo "</td></tr></table>";
echo "</table><br>";
echo "</center>";
echo "<!--code for html form-->";
echo "<FORM ACTION=\"sendmail.php3\" METHOD=\"POST\">";
echo "sender: <INPUT TYPE=\"TEXT\" NAME=\"sender\"
SIZE=\"20\"><br>";
echo "send to: <INPUT TYPE=\"TEXT\" NAME=\"sendto\"
SIZE=\"20\"><br>";
echo "subject: <INPUT TYPE=\"TEXT\" NAME=\"subject\"
SIZE=\"20\"><br>";
echo "<TEXTAREA NAME=\"message\" ROWS=\"8\"
COLS=\"40\">";
echo "</TEXTAREA>";
echo "<INPUT TYPE=\"submit\" NAME=\"submit\" VALUE=\"Send
Mail\"><br>";
echo "</form>";
echo "</center>";
echo "<!--end of html form code-->";
echo "</HTML>";
?>
http://www.php.net/manual/language.types.string.php