简体   繁体   English

将 html 表单数据发送到 php

[英]sending html form data to php

I am using a drupal site.here is the code I have written in client side我正在使用 drupal 站点。这是我在客户端编写的代码

<form  method="get">
Email :<input type ="text" name ="email" size ="20"><br />
<button style="width:65;height:25" onClick='email_direction_data()'><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. 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.您需要有一个 html <input type="submit" />按钮,而不是<button>标签。

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.为了给你一个安全可靠的解决方案,我将在这个答案中写一本关于基本 web 开发和 drupal 开发的书。

I suggest you take a little more time to get to learn basic webdevelopment, security basics and some initial understanding of Drupal-development.我建议您多花一点时间来学习基本的 Web 开发、安全基础知识以及对 Drupal 开发的一些初步了解。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM