 |  | | 
09-10-2005, 01:44 PM
|  | | | Join Date: Mar 2005 Location: Dallas Age: 37
Posts: 6,939
Chips: 37,259 | | | Need help with Feedback code I am starting to get a lot of feedbacks a day from users that didn't get their activation email. This is not the problem I want to fix, that's just a symptom of the site growing and that's ok.
The problem is that when I get the feedback in my inbox the "From:" field is populated with "greg@chiptalk.net" but I want it populated with whatever the user enters into the "Your E-mail" field of the form. I just want to hit reply when I get an email from this form. As it is now I have to remove my email and copy/paste the person's email from the emailbody. It's getting annoying now that the daily emails have stepped up.
So I need help with what I should change in the mailform.php to make this happen.
Here's the code for the feedback form:
Here is the code from the feedback page that sends the data to mailform.php: Code: <form name="contact" method="post" action="mailform.php">
<tr>
<td width="0%" class="mainboxLefttop"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
<td width="100%" class="mainboxTop"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
<td width="0%" class="mainboxRighttop"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
</tr>
<tr>
<td width="0%" class="mainboxLeft"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
<td width="100%" class="cBoxStart">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="genBox">
<table width="100%" border="0" cellspacing="0">
<tr>
<th colspan="2" class="thTop">Feedback for Chip Talk Administrators</th>
</tr>
</table>
</td>
</tr>
</table>
</td>
<td width="0%" class="mainboxRight"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
</tr>
<tr>
<td width="0%" class="mainboxLeft"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
<td width="100%" class="genBox">
<table class="forumline" width="100%" cellspacing="1" cellpadding="4" border="0">
<!--<tr>
<th height="" class="thHead"><div align="center"> <strong>Feedback for Chip Talk Administrators</strong></div></th>
</tr>-->
<tr>
<td class="row1" align="center">Please Provide us your feedback and feel free to ask any questions. We will get back to you as soon as possible.</br> </br>
<table border="0" align="center" cellpadding="2" width="650">
<tr>
<td width="120" valign="top">Your Username:</td>
<td><input type="text" name="Username"></td>
</tr>
<tr>
<td valign="top">Who referred you? (optional):</td>
<td><input type="text" name="Referrer"></td>
</tr>
<tr>
<td valign="top">Your E-mail (double check):</td>
<td><input type="text" name="e-mail"></td>
</tr>
<tr>
<td valign="top">Comments/Feedback/Question:</td>
<td><textarea name="comments" rows="7" cols="70"> </textarea></td>
</tr>
<!--<tr>
<td colspan="2" class="catBottom" align="center"><input type="submit" name="submit" value="Send!"></td>
</tr> -->
</table>
</td>
</tr>
</table>
</td>
<td width="0%" class="mainboxRight"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
<tr>
<td width="0%" class="mainboxLeft"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
<td width="100%" class="mainboxBottom"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
<td width="0%" class="mainboxRight"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
</tr>
<tr>
<td width="0%" class="mainboxLeft"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
<td width="100%" class="catBottom" align="center"><input type="submit" name="submit" value="Send!"></td>
<td width="0%" class="mainboxRight"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
</tr>
<tr>
<td width="0%" class="mainboxLeftbottom"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
<td width="100%" class="mainboxBottom"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
<td width="0%" class="mainboxRightbottom"><img src="templates/Cobalt/images/spacer.gif" width="6" height="6"></td>
</tr>
</form> And here is mailform.php: Code: <?
$from = 'greg@chiptalk.net'; //Email address you want it to 'appear' to come from
$to = 'greg@thecagles.com'; //Where it is to be sent to
$subject = "Contact from site on " . date("m/d/Y"); //Subject Line
// Leave the rest of the stuff below //
$mailheader = "From: $from\r\n";
$mailheader .= "Reply-To: $from\r\n";
if (isset($HTTP_POST_VARS)){
$mailbody = '';
while (list($key, $value) = each($HTTP_POST_VARS))
{
$mailbody .= $key . ' = ' . $value . "\r\n";
}
}
$mailforms = mail($to, $subject, $mailbody, $mailheader);
if($mailforms)
{
include("done.php"); //Load page to go to if mailing is successful
}
else
{
include("error.php"); //Load error page
}
?> | 
09-10-2005, 04:28 PM
|  | Banned | | Join Date: Mar 2005 Location: Los Angeles, CA, USA
Posts: 858
Chips: 684 | | Not 100% positive, but I think if you change the mailform.php line: Code: $from = 'greg@chiptalk.net'; to be: that should fix the problem.
Is the feedback page the only page that uses the mailform.php script? | 
09-10-2005, 05:44 PM
|  | | | Join Date: Mar 2005 Location: Dallas Age: 37
Posts: 6,939
Chips: 37,259 | | Quote: |
Originally Posted by Kalimba
Is the feedback page the only page that uses the mailform.php script? | yes | 
09-10-2005, 05:54 PM
|  | | | Join Date: Mar 2005 Location: Dallas Age: 37
Posts: 6,939
Chips: 37,259 | | Quote: |
Originally Posted by Kalimba Not 100% positive, but I think if you change the mailform.php line: Code: $from = 'greg@chiptalk.net'; to be: that should fix the problem. | Didnt work. | 
09-10-2005, 06:36 PM
|  | World Series Final Table | | Join Date: Mar 2005
Posts: 2,834
Chips: 29,466 | | Quote: |
Originally Posted by TenPercenter Quote: |
Originally Posted by Kalimba Not 100% positive, but I think if you change the mailform.php line: Code: $from = 'greg@chiptalk.net'; to be: that should fix the problem. | Didnt work. | I'm not sure of the syntax, but it seems something like
$from = $HTTP_POST_VARS.e-mail
should work
__________________
[URL=http://imageshack.us][IMG]http://img125.imageshack.us/img125/8584/captlego402ji.jpg[/IMG][/URL] Currently Working on the [url=http://chiptalk.net/forum/showthread.php?t=12490] Chip Breakdown Calculator [COLOR="Yellow"]V0.6 Now Available![/COLOR] [/url]
| 
09-10-2005, 07:04 PM
| | Chief Architect/Admin | | Join Date: Mar 2005 Location: Reston, VA Age: 40
Posts: 2,816
Chips: 1,832 | | | I made a change to the code and have not heard back from Ten if it worked.
__________________ "Life is what happens when you're busy making other plans." ~John Lennon
"You drank the water now there's nothing we can do, there's no one we can call." ~Tony Carey
"You joined ChipTalk now there's nothing we can do, there's no one we can call." ~X-Files
Will work for chips! CHIPTALK POKER CHIP FACTORY | 
09-10-2005, 07:19 PM
|  | Banned | | Join Date: Mar 2005 Location: Los Angeles, CA, USA
Posts: 858
Chips: 684 | | Quote: |
Originally Posted by TenPercenter Quote: |
Originally Posted by Kalimba Not 100% positive, but I think if you change the mailform.php line: Code: $from = 'greg@chiptalk.net'; to be: that should fix the problem. | Didnt work. | Hmm... OK, I'll have you try one more thing and I'll shut up and leave it to the next PHP expert that comes along...
Looking again through my PHP reference, I noticed that the rules for PHP variables don't allow for the dash character. So, I would change the "e-mail" in the PHP script to just plain "email" (or "e_mail", with an underscore, which PHP does allow). This means that in the HTML form, you'll also need to change the line: Code: <td><input type="text" name="e-mail"></td> to: Code: <td><input type="text" name="email"></td> or: Code: <td><input type="text" name="e_mail"></td> to match whatever variable you used in the mailform script. According to my reference, when the form is posted to the PHP script, the data in each form field can be accessed in the script by prepending a "$" to the field's "name" property.
Sorry I can't be more helpful. I only dabbled in PHP for a little while about a year ago and never did any form processing. | 
09-10-2005, 07:33 PM
| | Chief Architect/Admin | | Join Date: Mar 2005 Location: Reston, VA Age: 40
Posts: 2,816
Chips: 1,832 | | This Code: $mailheader .= "Reply-To: $from\r\n"; To This Code: $mailheader .= "Reply-To: $e-mail\r\n"; I think this will fix and I have changed the code on the site already. Just waiting to here back from Ten.
__________________ "Life is what happens when you're busy making other plans." ~John Lennon
"You drank the water now there's nothing we can do, there's no one we can call." ~Tony Carey
"You joined ChipTalk now there's nothing we can do, there's no one we can call." ~X-Files
Will work for chips! CHIPTALK POKER CHIP FACTORY | 
09-10-2005, 07:38 PM
|  | Banned | | Join Date: Mar 2005 Location: Los Angeles, CA, USA
Posts: 858
Chips: 684 | | Quote: |
Originally Posted by X-Files This Code: $mailheader .= "Reply-To: $from\r\n"; To This Code: $mailheader .= "Reply-To: $e-mail\r\n"; I think this will fix and I have changed the code on the site already. Just waiting to here back from Ten. | Yeah, that looks like the most clever solution. I still think there may be a problem with the dash in the "$e-mail" variable, but I'm not positive. | 
09-10-2005, 08:45 PM
|  | Faux Clay Nation | | Join Date: Mar 2005 Location: FAUX CLAY NATION Age: 3
Posts: 5,137
Chips: 1,513 | | | Oh no....not again.....brain swimming.....uckkue.....spinning out...ajwoifn....of control.....blechwhehlwk......
can't .......read.......bsdjkla;sjsfd.......code............fdasjlkafdsjlkadfljjklafdsjklsdfdsalaljkfdlkaslndkavsmdklamslkadsvmklvadmfma'fvlkdflksepogmpstrmvop4isapeorvs'peoimvrsi'bnwirtpmpvaeo5903[q05v8m'ie'bio5mpm54y w,.46y ,bop909as-45-]w9,,sr {insert major vomiting sounds} q34m54vowoimmsriotvsio;tvslkrtb'w09-069bsp9tb
pmpoerom54vostrlb;,lsRtb;ldr;m,lmbkjb9tj0sb9r0boibmibgkkl
oh boy .......... | | Thread Tools | Search this Thread | | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is On Chips Per Thread View: 0 Chips Per Thread: 3 Chips Per Reply: 1 | | | |  |