briciusaz Posted April 30, 2007 Share Posted April 30, 2007 I need someone to help me out by keeping this code but one part of this php script. Right now I am getting the header of from in my email address but I do not want that- I prefer from person who is filling ou tthe form. The main reason I want to keep this script is because I can put whatever I want in form and still get it in email. Just need to chang ethe from part instead of my email address. HELP!! Thanks <?php $subject = 'CONTACT FORM'; $emailadd = 'email@email.com'; $url = '../thankyou.html'; $req = '1'; $text = "Results from form:\n\n"; $space = ' '; $line = ' '; foreach ($_POST as $key => $value) { $j = strlen($key); if ($j >= 30) {echo "Name of form element $key cannot be longer than 30 characters";die;} $j = 20 - $j; for ($i = 1; $i <= $j; $i++) {$space .= ' ';} $value = str_replace('\n', "$line", $value); $conc = "{$key}:$space{$value}$line"; $text .= $conc; $space = ' '; } mail($emailadd, $subject, $text, 'From: '.$emailadd.''); echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">'; ?> Quote Link to comment Share on other sites More sharing options...
cksrealm Posted April 30, 2007 Share Posted April 30, 2007 If you just to change the from part just change the value of $emailadd at the moment its set to email@email.com just change that to who you want to to appear to have come from Quote Link to comment Share on other sites More sharing options...
briciusaz Posted April 30, 2007 Author Share Posted April 30, 2007 I don't want it to be my email or whatever that is up there now but I want that to be changed from in the form that user is typing. Like; From: Subject: etc.. That From text input should be the email address I am seeing from instead of what I have up there. Quote Link to comment Share on other sites More sharing options...
briciusaz Posted April 30, 2007 Author Share Posted April 30, 2007 can anyone help me out?? Quote Link to comment Share on other sites More sharing options...
briciusaz Posted May 1, 2007 Author Share Posted May 1, 2007 Pretty please help me? ??? ??? Quote Link to comment Share on other sites More sharing options...
cksrealm Posted May 1, 2007 Share Posted May 1, 2007 So do you want to to appear to come from the users email address that they put in when filling in the form? Quote Link to comment Share on other sites More sharing options...
briciusaz Posted May 1, 2007 Author Share Posted May 1, 2007 Yes thats right- while still using the code I have as it gives me the flexible to put whatever I have in the form. Quote Link to comment Share on other sites More sharing options...
briciusaz Posted May 2, 2007 Author Share Posted May 2, 2007 Really need help here... Quote Link to comment Share on other sites More sharing options...
dj-kenpo Posted May 2, 2007 Share Posted May 2, 2007 http://ca3.php.net/mail the php mail() function is really easy to use. if you read the manual on it it will answer your question completly + much more. in email there is the header section. you must decide what you want in the header section, and edit accordingly. you can then have the email appear to come from however you like. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.