sending html form data to php
I am using a drupal site.here is the code I have written in client side
<form method="get">
Email :<input type ="text" name ="email" size ="20"><br />
<button style="width:65;height:25" onClick='email_direction_data()'开发者_StackOverflow社区><b>Send</b></button>
</form>
when I click the button page will refresh.text field is used for enter the email address.I have written below code inside a drupal module file in a function to send an email.
drupal_mail('direction', 'invitation', $_GET['email'] , language_default(), $params);
but the text field content is not going to GET array when I click the button.what is the reason for that?is there any wrong in my code?
You need to have an html <input type="submit" />
button, not a <button>
tag.
You are aware that you have just written the perfect spam-relay, now, have you?
In order to give you a secure and solid solution, I would be writing both a book on basic webdevelopment and drupal development in this answer.
I suggest you take a little more time to get to learn basic webdevelopment, security basics and some initial understanding of Drupal-development.
- http://docforge.com/wiki/Web_application/Security
- Securing PHP forms for beginners? Resources?
- http://www.drupalbook.com/
精彩评论