Jump to content

[SOLVED] PHP / HTML Form


DirtySnipe

Recommended Posts

I have a basic form up and running which is used for submiting support requests. but i want to do the following.

 

I want people to fill in a text box called 'email' but i dont want them to put in the full email address. e.g.

 

"[email protected]"

 

I just want them to add the name "me"

 

then i want the form to enter in the from field

 

[email protected]

 

I basically want to add the domain name onto the end so they dont have to put it in. (saves time for them) and it will always be from the same domain because of it being an internal form.

Hope you can help.

 

 

Link to comment
https://forums.phpfreaks.com/topic/102682-solved-php-html-form/
Share on other sites

its still sending it from the email address in the main php.ini settings

 

here is the code sofar.

 

<?php

 

$to                      = "[email protected]";

$from                    = "$Emailaddress";

 

 

$Name                    = $_POST['Name'];

$Emailaddress            = $_POST['Emailaddress']."@mylongdomainname.com";

$House                    = $_POST['House'];

$Department              = $_POST['Department'];

$Problem                  = $_POST['Problem'];

$Description              = $_POST['Description'];

 

 

 

 

 

$sub      = "$Problem";

$headers  = "$from";

 

 

 

$mes    .= "$Name\n";

$mes    .= "$House\n";

$mes    .= "$Department\n";

$mes    .= "$Description\n";

 

 

    mail($to, $sub, $mes, $headers);

 

 

?>

 

Link to comment
https://forums.phpfreaks.com/topic/102682-solved-php-html-form/#findComment-525864
Share on other sites

Ive changed this part

 

$headers  = "From: $from\n";

 

 

If i put a manual email address in the $from it send it from that person now.

 

But if i want to send it from  $from                    = "$Emailaddress";

 

I get from UNKNOWN in the email address.

Link to comment
https://forums.phpfreaks.com/topic/102682-solved-php-html-form/#findComment-525873
Share on other sites

$to                       = "[email protected]";
// $from                     = "$Emailaddress"; 


$Name                     = $_POST['Name'];
$Emailaddress             = $_POST['Emailaddress']."@mylongdomainname.com";
$House                    = $_POST['House'];
$Department               = $_POST['Department'];
$Problem                  = $_POST['Problem'];
$Description              = $_POST['Description'];

$from                     = "$Emailaddress"; // define $from AFTER we know who it's from

 

Link to comment
https://forums.phpfreaks.com/topic/102682-solved-php-html-form/#findComment-525897
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.