Simple (for you!) email query

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Richking
Forum Newbie
Posts: 12
Joined: Thu Mar 09, 2006 8:14 am

Simple (for you!) email query

Post by Richking »

feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]


Hi there, bit of a php newbie....

I'm trying to sort out just a simple  form to be emailed.....

an excerpt from the form is here:

Code: Select all

<form action="booking.php" method="post">
  <table width="700" border="0">
    <tr>
      <td width="93">Name </td>
      <td width="237"><input type="text" name="username" size="35"/></td>
      <td width="23">&nbsp;</td>
      <td>Email </td>
      <td><input type="text" name="usermail" size="35"/></td>
      <td>&nbsp;</td>
      <td>Address</td>
      <td><input type="text" name="useraddr" size="35"/></td>
      <td>&nbsp;</td>
In booking.php the code i have is here....

Code: Select all

<?
$to="X@XXXX.XXX";
$subject=" Booking Form";
$message=$username,$usermail,$useraddr;
mail($to,$subject,$message);
?>
Question is, mail is being sent all works fine but the $message part isn't working.....Any ideas why?

Thanks in advance


feyd | Please use

Code: Select all

and

Code: Select all

tags where appropriate when posting code. Read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

$message=$_POST['username'] . "\n" . $_POST['usermail'] . "\n" . $_POST['useraddr'];
Richking
Forum Newbie
Posts: 12
Joined: Thu Mar 09, 2006 8:14 am

Thanks

Post by Richking »

Thats great thanks and comments noted!
Post Reply