Jump to content

Recommended Posts

I have made a members page where user input information into a form and it updates a certain table in the database. now when the user clicks on the submit button and updates the table in the database i want it to send me an email telling me there's been an update in the database and also what information has been added.

can anyone help me with  what to do.

here is the form code below. the names of things have been changed.

<tr><td>M name	:</td><td>
<input type="text" name="mname" maxlength="60">
</td></tr>
<tr><td>please enter</td><td>
<input type="text" name="hheight" maxlength="11">
</td></tr>
<tr><td>Please enter height</td><td>
<input type="text" name="height" maxlength="11">
</td></tr>
<tr><td>Please enter  the  </td><td>
<input type="text" name="area" maxlength="30">
</td></tr>
<tr><td>Please enter  the  number</td><td>
<input type="text" name="numb" maxlength="11">
</td></tr>
<tr><th colspan=2><input type="submit" name="submit" value="update"></th></tr> </table>
</form>

 

Link to comment
https://forums.phpfreaks.com/topic/196769-mail-and-update/
Share on other sites

Well you said you've set it so that it updates the database. After the query you do to update the database, you'd put in something like..

		$to = 'Your email address here'
		$subject = "Your subject here";
		$message  = "Your message will go here, including all variables etc.";
		$header  = "From: $name <no-reply@horble.com> " . "\r\n";

		$send = mail($to, $subject, $message, $header);

 

Simple huh?

Link to comment
https://forums.phpfreaks.com/topic/196769-mail-and-update/#findComment-1033321
Share on other sites

  • 3 weeks later...

What does the error contain? You can see for yourself what POST elements are like this:

<?php 
  if (isset($_POST['submit'])) {
     
        print "Name = " . $_POST['mname'] . "<br/>"; //Example showing POST element
        print_r($_POST); //List all the Data to see what was sent
  }
?>

 

I'd recommend you view tutorials though on what you're doing.

http://www.tizag.com/phpT/forms.php

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

 

Link to comment
https://forums.phpfreaks.com/topic/196769-mail-and-update/#findComment-1046306
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.