Help with mail...

From: Date: Mon, 23 Sep 2002 03:40:52 +0000
Subject: Help with mail...
Groups: php.general 
Request: Send a blank email to php-general+get-117231@lists.php.net to get a copy of this message
Hi, Well after read php.net and my copy php 4 bible. I am lost with mail. I can get it to work if I do this... Mail ('payne@magidesign.com', 'Data Added', $fname, $lname .); But I can't get this to work...I know someone going to call me stupid but I am really having people with mail(), Is there a special place to put it? Here example of my code....any way I trying to hammer it out and using google to see where the error of my way is. Chuck Payne ------------------------------------------------------- <HTML> <HEAD> <TITLE>Killers Added</TITLE> </HEAD> <BODY TOPMARGIN="50"> <?php if ($fname=="") { echo "You did not supply a first name. Please hit the 'Back' button on your browser and fill in a name.\n"; exit; } if ($lname=="") { echo "You did not supply a Last Name. Please hit the 'Back' button on your browser and fill in a name.\n"; exit; } if ($title=="") { echo "You did not supply a Movie Title. Please hit the 'Back' button on your browser and fill in a name.\n"; exit; } $dbh = mysql_connect("deathtoasp", "zombieuser", "eatmsbrains") or die ("Unable to connect to database"); mysql_select_db("slashers", $dbh) or die ("An error was reported"); $table_name = "deathmovies"; $statement = "INSERT INTO $table_name (fname, lname, title) VALUES (\"$fname\", \"$lname\", \"$title\")"; $result = mysql_query($statement, $dbh); if ($result) { echo "<H3>Adding the following record</H3>"; echo "<hr>"; echo "<p><strong>Actor/Actress:</strong>&nbsp;&nbsp; $fname $lname </p>"; echo "<br>"; echo "<p><strong>Movie:</strong>&nbsp;&nbsp;$title</p>"; echo "<a href='addactormovie.html'>Add more Actor/Actress and Movie which they stared in</a>"; echo "<hr>"; $address = "payne@magidesign.com"; $Subject = "The new movie and actor added to phpMovie Library"; $body = "Adding the following record Actor/Actress: '$fname $lname' Movie: '$title'"; mail('$address', '$Subject', '$body .'); } else { echo "There was an error saving your entry. Please try back in a little while."; } ?> </BODY> </HTML>

« previous php.general (#117231) next »