I'm trying to read a text file to use for a message in and email. This way the user can just edit a text file when ever they want the message changed. However I need to be able to insert form variables into the file at points indicated in the file. I can open the file and read it into a vairialbe to send the text, but I can't figure out how to get the variables into the message in the correct places. This works to get the text file and send the message, but how would I get the $name variable into the text.file at a paticular point in the file.
<?php
$name = "bill";
$addr = "snow hill";
$fp = fopen("test.php3", "r");
$data = "";
while(!feof($fp))
{
$data .= fgets($fp, 4096);
}
mail('rob@test.com', 'test', $data)
?>
text file:
Thanks you $name,
Your order has been shipped to $addr.
Thanks for the help.