i have a form in my index.php page where users fill in name, phone and email. how do i format the mailer.php page, ie the page recieving the form? i've tried everything i can think of but no luck...
i want the result to be that whatever the users filled into the form, it will show up in an email sent to me.
this is my form:
PHP Code:
<form action="mailer.php" method="post">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="5" class="link">1. Please fill in your info and I will contact you as soon as possible.</td>
</tr>
<tr>
<td colspan="5" class="link"><img src="http://', $rooturl,'_images/blank.gif" width="1" height="10" border="0"></td>
</tr>
<tr>
<td valign="top" class="link">Name:<br>
<input type="text" id="name" value="Name" size="10" style="width: 140px; height: 10;"></td>
<td valign="top"><img src="http://', $rooturl,'_images/blank.gif" width="30" height="1" border="0"></td>
<td valign="top" class="link">Phone:<br>
<input type="text" id="phone" value="Phone" size="10" style="width: 140px; height: 10;"></td>
<td valign="top"><img src="http://', $rooturl,'_images/blank.gif" width="30" height="1" border="0"></td>
<td valign="top" class="link">Email:<br>
<input type="text" id="email" value="Email" size="10" style="width: 140px; height: 10;"></td>
</tr>
<tr>
<td colspan="5" class="link" align="left"><img src="http://', $rooturl,'_images/blank.gif" width="1" height="15" border="0"></td>
</tr>
<tr>
<td colspan="3" class="link">2. Check the tracks you like</td>
<td colspan="2" class="link" align="right"><input type="submit" id="Submit" value="Send your info"></td>
</tr>
<tr>
<td colspan="5" class="link" align="left"><img src="http://', $rooturl,'_images/blank.gif" width="1" height="5" border="0"></td>
</tr>
</table>
<input type="hidden" id="Who" value="', $who,'"><input type="hidden" id="Page" value="', $page,'">
Very simple idea here. I'm not a pro php programmer, but this is how I've been doing my forms. First, you call in your form variables from a POST statement. Then, select your TO address and SUBJECT line.
I format messages via HTML. If you don't do formatting, you end up with just plain text. Depends on how you want to receive it. I'd do a plain text version here in a second.
Then my script adds the headers so the email comes as an HTML email.
Upon successful send (the last line / if statement) then it redirects to a confirmation page. I put index.php just cause.
i tried both of your scrips, copy and pasted into mailer.php - no luck!
the emails we're sent with bizzar's script but no information from my form was passed on to the email. eclipse, i couldn't get your script working at all.
now, i'm sure both scrippts are just fine, maybe i'm soing something wrong...
i had another script that was emailing me but without content from my form..:
i'm just looiking for something reall reall ysimple that will carry the info from my form on the index.php page over to the mailer.php page. this mailer.php page should email me a result of the form, looking something like this: