Jump to content

PHP Form Processing


dan182skater

Recommended Posts

Hello everyone! Quick question:

 

I have a form that I made with phpFormGenerator and the processor.php file makes the form have this in the "From" field when it is sent to my email:

 

Nobody [nobody@burgos.ourhostingservers.com]

 

I'm not that good with PHP but can see from below that the email above is a default server email address for the hosting account I have and it is being retrieved from the PHP line below:

 

$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

 

How can I make the "From" field simple be an email address that I specify?

 

THANK YOU!!!!

Link to comment
Share on other sites

processor.php

 

<?php

$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));

mail("dan182skater@gmail.com","MCWL New Member - Form submission","Form data:

Name: " . $_POST['field_1'] . " 
Telephone: " . $_POST['field_2'] . " 
Email: " . $_POST['field_3'] . " 
Business Address: " . $_POST['field_4'] . " 
Address Line 2: " . $_POST['field_5'] . " 
City: " . $_POST['field_6'] . " 
State: " . $_POST['field_7'] . "
Zip Code: " . $_POST['field_8'] . " 
Website: " . $_POST['field_9'] . " 
Areas of Practice: " . $_POST['field_10'] . " 






");

include("newmember_thankyou.html");

?>

 

Thanks!

Link to comment
Share on other sites

try this...

 


<?php

$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));


$to = 'dan182skater@gmail.com';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
$subject = 'MCWL New Member - Form submission';
$message = "Form data:

Name: " . $_POST['field_1'] . " 
Telephone: " . $_POST['field_2'] . " 
Email: " . $_POST['field_3'] . " 
Business Address: " . $_POST['field_4'] . " 
Address Line 2: " . $_POST['field_5'] . " 
City: " . $_POST['field_6'] . " 
State: " . $_POST['field_7'] . "
Zip Code: " . $_POST['field_8'] . " 
Website: " . $_POST['field_9'] . " 
Areas of Practice: " . $_POST['field_10'];

mail($to, $subject, $message, $headers);

include("newmember_thankyou.html");

?>

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.