I am trying to add a feature into my webform that allows users to recieve text messages that confirm their web form submission... and I am kind of lost in doing so... Can someone guide me... I wasn't sucessful with google for the heads up....

Recommended Answers

All 7 Replies

You can perform a redirect to a "success.php" page or turn to an error page. You can do this with header():

$to      = 'nobody@example.com';
$subject = 'the subject';
$message = 'hello';
$headers = 'From: webmaster@example.com' . "\r\n" .
    'Reply-To: webmaster@example.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();

if(mail($to, $subject, $message, $headers)) # TRUE
{
    header('Location: success.php');
}
else                                        # FALSE
{
    header('Location: error.php');
}

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

For better help post your code. Bye.

Can you explain to me how this works? How does this send the text? And thanks for the link :)

first you need to install a working email system inorder for you to send mail

ok... so what if i have (for example) gmail? will that work?

hmm... I may have it SMTP working... can you go over the installation of it, I mean I could use my form to send emails to me and the user but that probably doesn't have to do with what SMTP does...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.