Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to get action script to both post to email and post to table

Posted on 2008-06-11
6
Medium Priority
?
176 Views
Last Modified: 2013-12-13
I am trying to create a php form with Dreamweaver MX that will post to a table and post  to an email address at the same time when the submit button is hit.  I can only get it to do one or the other but not both.  Any suggestions how to do both.
0
Comment
Question by:cfwd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 40

Expert Comment

by:Richard Quadling
ID: 21764409
If you have a form whose action is "mailto:someone@somewhere.com", then the browser is responsible for getting the local mail client started to be able to send the message, not the server.

What you need to look at is the mail() command in PHP.

http://docs.php.net/manual/en/function.mail.php


There first example ...

<?php
// The message
$message = "Line 1\nLine 2\nLine 3";

// In case any of our lines are larger than 70 characters, we should use wordwrap()
$message = wordwrap($message, 70);

// Send
mail('caffinated@example.com', 'My Subject', $message);
?>
0
 
LVL 16

Accepted Solution

by:
rbudj earned 750 total points
ID: 21765288
This is correct.  The logic behind it is this.

First, take the data from the variables and send the message, then below the mail() command just echo the variables.
0
 

Author Comment

by:cfwd
ID: 21770915
I can get the mail function to work but I want it to work only when the form is submitted and to have the form post to my table at the same time.  Where do I put the mail code so that it works at the same time as posting to the table?  
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 40

Expert Comment

by:Richard Quadling
ID: 21773417
Where is the code for posting to the table?

Oh.

When you say "table" do you mean ...

<table>

or

INSERT INTO table(column [, ...]) VALUES(value [, ...])

?

I've assumed (possibly wrongly) you meant an SQL table rather than an HTML table.
0
 

Author Comment

by:cfwd
ID: 21775116
Yes, I meant MySQL table.  I want the sumit button to send the data to my database and to send an email notifying that the database has been updated.  Can anyone help? I don't know code.
0
 
LVL 40

Assisted Solution

by:Richard Quadling
Richard Quadling earned 750 total points
ID: 21777793
You must have some code if it currently sends to the MySQL table?

Ah. You've got neither working?

Take a look at http://docs.php.net/manual/en/mysql.examples.php to get some idea of how you talk to mysql.
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
In this blog, we’ll look at how improvements to Percona XtraDB Cluster improved IST performance.
The viewer will learn how to count occurrences of each item in an array.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question