How does one link to the submit button
On a webpage, an input element with 'submit' as its 'type' attribute inside a form element will submit the form to the URL specified in the form's 'action' attribute and the response will be loaded in the window supplied in the form's 'target' attribute.
<form action='process.php' target='_blank' id='emailForm'>
<input type='text' name='email' />
<input type='submit' value='Send Email!' />
</form>
Yukarıdaki kod 'process.php' ve döner sayfasına yeni bir pencerede gösterilir 'email' metin alanındaki ('E-posta gönder!' Düğmesine tıkladıktan sonra) kullanıcının girdiği ne sunacaktır.
I am thinking of embedding a or just using href
If you don't want to use a submit button like the example above, the code below will produce the same results as the submit button.
<a href='javascript:document.getElementById("emailForm").submit();'>
<img src='images/submit.jpg' />
</a>
have the entire php emailer code embedded somehow inside the submit section
Unless you're talking about AJAX, there's a clear distinction between the capability of code executed on the client side (JavaScript) and server side (PHP).
JavaScript kodu istemci tarafında yürütülen ve olası hataları kontrol (ve teslim ediliyor formu durdurma) önce bir e-posta adresi ya da giriş sayısal olması gerekiyordu harflerle bir boşluk gibi, bir form göndererek olanak tanır.
PHP kodu sunucu tarafında yürütülen ve bir veritabanında e-posta adresi (veya başka ne ihtiyaçları tasarruf) kaydeder. Ayrıca e-posta gönderme yeteneğine sahiptir. Güvenlik nedenlerinden dolayı, e-posta adresleri ve harflerle boşluk gibi, hata denetimi ve aynı kontroller için JavaScript üzerinde sadece bağımlı olmamalıdır nerede girişin sayısal olması gerekiyordu, çok PHP yapılmalıdır.
I can submit the information supplied by a user to a MySQL database and log it there; however, I was just wondering if there is a more elegant way to send email using the information saved in my database
If I understand you correctly, you now have a form that submit to a PHP file which in turn records the contents of that form (an email address) to a MySQL database which you check from time to time. Now your objective is to have the email address sent to your inbox in addition to being recorded in the MySQL database, is that right? All you need to do is to append this code to your existing PHP file that currently writes to your MySQL database.
$to = "my_address@email.com";
$subject = "New email address!";
$body = "Hi,\n\nYou have a new email address:\n" . $_REQUEST['email'];
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
Eğer posta göndererek sorunları varsa farklı barındırma hizmeti sağlayıcıları servis sağlayıcınız ile kontrol, vb alanında bir gerektiren gibi e-posta göndererek, veya alandan Form üzerinde barındırılan etki uyan bir e-posta adresi içermesi gerekiyor düzenleyen farklı kurallar olabilir .