Jump to content

email form


briciusaz

Recommended Posts

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.'">';

?>

Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.