Highlighted

Linking Submit button in php to email

New Here ,
Oct 23, 2019

Copy link to clipboard

Copied

Hello.  Trying to link the Submit button in  a action.php doc to my agency's email.  Form working OK, echo message OK.  Who can steer me in the right direction?  Willing to share my code if necessary.

Views

61

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Linking Submit button in php to email

New Here ,
Oct 23, 2019

Copy link to clipboard

Copied

Hello.  Trying to link the Submit button in  a action.php doc to my agency's email.  Form working OK, echo message OK.  Who can steer me in the right direction?  Willing to share my code if necessary.

Views

62

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Oct 23, 2019 0
Adobe Community Professional ,
Oct 23, 2019

Copy link to clipboard

Copied

See this 3 part tutorial.  

https://alt-web.blogspot.com/2015/07/responsive-contact-form-with-bootstrap.html

 

NOTE:  For this to work, your hosting server must support PHP mail () function. And your contact form must be saved as a PHP file.  If your host doesn't support the mail function, you'll need to ask them which scripts they recommend you use.

 

 

Nancy O'Shea, ACP
Alt-Web Design & Publishing

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 23, 2019 0
New Here ,
Oct 23, 2019

Copy link to clipboard

Copied

Thank you Nancy.  Contacted my server host to check.  Waiting for a posirtive answer.

Meanwhile,here is my code.

 

<!doctype php>
<?php
if(lissett($POST_['submit']))
$to = "myname@myagency.ca";
$subject= 'Contact Form Submit';
$email_message= 'Quick Request Submission:\n\n';

 

mail ($email, $request, $message, "From:".$from);

$name = $_POST['Your Name'];
$email = $_POST['Your email'];
$request = $_POST['Request'];
$message = $_POST['Message'];

$email_from = "myname@myagency.ca';
$email_subject = 'New Request Submssion'
$email_body = "You have received a new message from $name.\n".
"Here is the message:\n $message".

<form action="http://newavenues.ca/request_form.php"

$subject = "Information Request";
print "This is an automated message from (Agency name inc.). Your message has been sent. Please do not reply to this email.";
?>

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 23, 2019 0
Adobe Community Professional ,
Oct 23, 2019

Copy link to clipboard

Copied

That is not a contact form and that script is not secure.    

Please read my 3 part tutorial from start to end.  It's very important to validate and sanitize  data before it ever reaches your server.  

 

Nancy O'Shea, ACP
Alt-Web Design & Publishing

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 23, 2019 1
New Here ,
Oct 23, 2019

Copy link to clipboard

Copied

Hello.  I know it wasn't my Contact Page code. PM'd you with Contact page code, but if we want it posted, I can.

Jacques

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 23, 2019 0
jheroux LATEST
New Here ,
Oct 29, 2019

Copy link to clipboard

Copied

Thank you.  Read through and used the script, albeit on separate pages.  

Will this be the correxct code:

<!--begin HTML Form-->
<form class="form-horizontal" role="form" method="post" action="action_page.php">

 

Also, by using 

value="<?php echo $name;?>">
<span class="required small"><?php echo $errName;?></span>

that text show in the area box ... normal?

Jacques

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Oct 29, 2019 0