Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First we got the mailto function to work.(using localhost and an email program such as Thunderbird or Outlook or Mail)<br> Thereafter you can use Swiftmailer. (Easier than PHPmailer) I have added some javascript validation P.S. It's better to use textareas instead of textboxes becasue they keep whitespaces. later when you add a database code you can use TEXT instead of VARCHAR. (I left out a few things that you need to fill in) Enjoy!</p> <p>contact.php </p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;Registration&lt;/title&gt; &lt;meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /&gt; &lt;script type="text/javascript"&gt; function formValidator(){ var subject = document.getElementById('subject'); var usermail = document.getElementById('useremail'); if(notEmpty(subject, "Please enter an email subject")){ if(emailValidator(usermail, "Please enter email addr")){ return true; } } return false; }//very important end of formvalidator!! function notEmpty(elem, helperMsg){ if(elem.value.length == 0){ alert(helperMsg); elem.focus(); // set the focus to this input return false; } return true; } function emailValidator(elem, helperMsg){ var emailExp = /^[\w\-\.\+]+\@[a-zA-Z0-9\.\-]+\.[a-zA-z0-9]{2,4}$/; if(elem.value.match(emailExp)){ return true; }else{ alert(helperMsg); elem.focus(); return false; } } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;form onsubmit="return formValidator()" action="contact_ok.php" method="post"&gt; &lt;textarea id='username' name='username' style='white-space:pre-wrap; height:18px;font-family:arial;width:200px;font-size: 10pt' &gt; &lt;/textarea&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>contact_ok.php </p> <pre><code>&lt;?php $username = "_"; $usermail = "_"; $subject = "_"; $msg = = "_"; $from ='owner@gmail.com'; $username = ($_POST['username']); $usermail = ($_POST['usermail']); $subject = ($_POST['subject']); $msg =($_POST['msg']); $aa = "Hi"; $a0 = "Welcome."; $nl = "%0D%0A"; //new line echo "&lt;br&gt;&lt;br&gt;"; ?&gt; &lt;font size = 4&gt;&lt;b&gt; &lt;a href="mailto:&lt;?php echo $useremail?&gt;?subject=&lt;?php echo $subject; ?&gt;&amp;body=&lt;?php echo $aa.$nl.$a0.$nl ?&gt;"&gt; Click to EMail customer&lt;/a&gt;&lt;br&gt; &lt;/font&gt; &lt;br&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload