Variables are not evaluated within single quotes. You are trying to send
an email to $address, literally. If you just have a single variable,
lose the quotes entirely.

Mail($address,$subject,$body);

---John Holmes...

> -----Original Message-----
> From: Chuck "PUP" Payne [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, September 22, 2002 11:41 PM
> To: PHP General
> Subject: [PHP] Help with mail...
> 
> 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 ('[EMAIL PROTECTED]', '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 = "[EMAIL PROTECTED]";
>    $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>
> 
> 
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to