mercredi 30 décembre 2015

inserting the php sendmail fuction into a confirm button within a pop up box

I am trying to use the sendmail function in php threw a pop up box. i have gotten as far as making the sendmail function and the pop up to work separately. but i haven't been able to figure out how to connect the sendmail in the right way. below is the last working git version i have. any help would be wonderful.

{

    <th align="center">Instrument Serial Number:</th>
                        <td align="left"><input type="text" class="cInstTravText" name="SerialNumber" id="idSerialNumber"/></td>
                        <button onclick="drop_check()">comfirm</button>

                        <p id="drop_check"></p>
                    <script>
                        function sendEmail() 
                            {
                            $to = 'jonsrod1992@gmail.com'; 
                            $subject = 'Test email using PHP';
                            $message = "test";
                            //$message = 'hellow world.\n\n this is a test for fuctionality\n\n this is the first try\n place instrument serial Number here--> '<$modelNumber>'<-- there.'; 
                            $headers = 'From: jonr@twobtech.com' . "\r\n" . 'Reply-To: jonr@twobtech.com' . phpversion();
                            mail($to, $subject, $message, $headers, '-fwebmaster@example.com'); 
                        }
                        function drop_check() {
                            var x;
                            if (confirm("transfer and send email!") == true) {
                            x = "transfered and email sent!";
                            } else {
                            x = "You pressed Cancel!";
                            }
                            document.getElementById("drop_check").innerHTML = x;
                        }
                    </script>
                    </tr>

Aucun commentaire:

Enregistrer un commentaire