只是制作一个简单的提交表单,似乎无法使其正常工作.
它甚至不会报告奇怪的错误.
检查了php.ini,一切看起来都很好.
HTML:
<form id="submit-form" action="receiving.php" method="POST">
<h3>Submit a Link</h3>
<fieldset>
<table>
<tr>
<td><label for="name">You</label></td>
<td><input id="name" name="name" type="text" placeholder="Your Twitter or Blog ect." /></td>
</tr>
<tr>
<td><label for="submit-links">Link(s)</label></td>
<td><input id="sumbit-links" name="submit-links" type="text" placeholder="" required="" /></td>
</tr>
<tr>
<td><input name="submit" type="submit" value="SUBMIT" /></td>
</tr>
</table>
</fieldset>
</form>
Run Code Online (Sandbox Code Playgroud)
receiving.php:
<?php
error_reporting(-1);
$name = $_POST['name'];
$submit-links = $_POST['submit-links'];
if(isset($_POST['submit'])){
$from_add = "submit@webdesignrepo.com";
$to_add = "ben@webdesignrepo.com";
$subject = "Your Subject Name";
$message = "Name:$name \n Sites: $submit-links";
$headers = 'From: submit@webdesignrepo.com' . …Run Code Online (Sandbox Code Playgroud) 如何从我的网页底部的"联系表格"发送电子邮件后自动向下滚动我的网站?有关在表单下方成功发送或出现错误的信息以及点击"提交"按钮页面后的信息令人耳目一新,用户只能看到网站的顶部,而不是底部......
我已经使用HTML和PHP创建了联系表格。此外,邮件正确发送到邮件ID。但是,在成功消息之后,它将重定向到form.php页面,有人可以帮助我。这是我第一次尝试建立网站。
这是我的联系表格代码:
<form method="post" action="form.php">
<input name="name" required="required" placeholder="Your Name">
<input name="email" type="email" required="required" placeholder="Your Email">
<div class="clearfix"> </div>
<textarea name="message" cols="20" rows="5" required="required" placeholder="Message"></textarea>
<div class="submit">
<input id="submit" name="submit" type="submit" value="Submit">
</div>
</form>
Run Code Online (Sandbox Code Playgroud)
这是我的form.php:
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: agriindiaexp.com';
$to = 'shridhar.kagi@gmail.com';
$subject = 'Email Inquiry';
$body = "From: $name\n E-Mail: $email\n Message:\n $message";
if ($_POST['submit']) {
if (mail ($to, $subject, $body, $from)) {
$success = …Run Code Online (Sandbox Code Playgroud) 我仍然是一名学生,今天我们的讲师告诉我们,提交联系我们表单而不必使用 mailto: 功能的唯一方法是使用 PHP。
我发誓去年另一位讲师向我们展示了一种仅使用 javascript 的方法。
是否可以使用基本表格和 javascript 提交反馈/联系表格?如果是这样,您介意分享一个示例吗?
提前致谢
我在 Magento 网站上创建了一个新的自定义联系表单,我试图在它的末尾添加验证码。
我已经添加到 app/code/core/Mage/Captcha/etc/config.xml
<customcontacts>
<label>Custom Contact Form</label>
</customcontacts>
Run Code Online (Sandbox Code Playgroud)
我添加到 app/design/frontend/base/default/layout/captcha.xml
<customcontacts>
<reference name="customcontacts">
<block type="core/text_list" name="form.additional.info">
<block type="captcha/captcha" name="captcha">
<reference name="head">
<action method="addJs"><file>mage/captcha.js</file></action>
</reference>
<action method="setFormId"><formId>customcontacts</formId></action>
<action method="setImgWidth"><width>230</width></action>
<action method="setImgHeight"><width>50</width></action>
</block>
</block>
</reference>
</customcontacts>
Run Code Online (Sandbox Code Playgroud)
我在表单中添加了以下代码:
<script type="text/javascript">
//<![CDATA[
$('form-validate-captcha').captcha.refresh($('catpcha-reload'));
//]]>
Run Code Online (Sandbox Code Playgroud)
我添加了这个代码来显示验证码:
<div><?php echo $this->getChildHtml('captcha'); ?></div>
Run Code Online (Sandbox Code Playgroud)
然后我在“配置”>“客户配置”>“验证码”中启用了验证码,然后选择“自定义联系表单”,然后选择“显示模式”为“始终”。
但是我仍然没有在我的自定义表单中获得验证码。
我希望我很清楚
谢谢
我有一个联系表格 7 插件我需要更改此表格,请在下面查看详细信息 如果有任何相关插件,请建议我选择国家/地区并在文本框中自动生成电话号码
地点:印度(在下拉菜单中选择)
代码: +91(自动出现)
我正在使用联系表单 7 将两个不同的表单加载到一个页面中,然后除了发送电子邮件之外,还将该信息动态添加到数据库中。不幸的是,由于插件的原因,我不能简单地创建具有不同名称的所有输入以避免需要过滤器。因此,本质上,我想将表单 ID 拉入操作挂钩并根据提交的表单动态创建 $data 变量,但我不确定如何获取 cf7 表单 ID。有谁知道如何做到这一点,或者更可行的方法?
表单简码
[contact-form-7 id="221" title="Reg 1"] [contact-form-7 id="112" title="Reg 2"]
Run Code Online (Sandbox Code Playgroud)
在functions.php中的PHP动作钩子
function save_form( $wpcf7 ) {
global $wpdb;
$form_to_DB = WPCF7_Submission::get_instance();
if($form_to_DB) {
$formData = $form_to_DB->get_posted_data();
}
if("Request a Free Demo" != $formData['demo_request'][0]){
$freeDemo = "yes";}else { $freeDemo = "nope";}
if(THE FORM ID = 221) {
$data = array(
some values from the 112 form
$wpdb->insert( $wpdb->prefix . 'registrations', $data );
);
}elseif(THE FORM ID = 112) {
$data = array( …Run Code Online (Sandbox Code Playgroud) 我正在尝试建立一个联系表单错误来电者。
我的 Jquery 代码只是说 Duplicate jQuery Selector最接近我能找到的与我相同的问题。但我尝试实施人们针对该问题给出的修复,但没有成功。我会展示我尝试过的内容。也许有人在这里看到了问题。
这是我的代码。
<script>
$(document).ready(function () {
$("#submit").click(function (e) {
e.preventDefault();
var $name = $("#name"),
$email = $("#email"),
$phone = $("#phone"),
$address = $("#address"),
$message = $("#message");
var $name_error = $("#name_error"),
$email_error = $("#email_error"),
$telephone_error = $("#telephone_error"),
$message_error = $("#message_error"),
$address_error = $("#address");
var data = {
name: $name.val(),
email: $email.val(),
telephone: $phone.val(),
address: $address.val(),
message: $message.val()
};
$.ajax({
type: "POST",
url: "/api/contact/submit",
data: data,
success: function (data) {
console.log(data);
$('#error_list').empty();
$('#show_error').hide();
if …Run Code Online (Sandbox Code Playgroud) 我正在尝试将投资组合网站中的联系表单链接到 firebase 并继续在我的控制台中获取 (firebase.database 不是函数)
这是针对网络的,使用纯 javascript
var firebaseConfig = {
apiKey: "AIzaSyCzX3r8CFw84WSBuCSXR1fWM_hDrwtGMSs",
authDomain: "portfolio-4c243.firebaseapp.com",
databaseURL: "https://portfolio-4c243.firebaseio.com",
projectId: "portfolio-4c243",
storageBucket: "",
messagingSenderId: "745737502175",
appId: "1:745737502175:web:a26e5b0baa3769c9"
};
// Initialize Firebase
firebase.initializeApp(firebaseConfig);
var messagesRef = firebase.database().ref('messages');
document.getElementById('contactForm').addEventListener('submit', submitForm);
function submitForm(e) {
e.preventDefault();
var name = getInputVal('name');
var email = getInputVal('email');
var message = getInputVal('message');
saveMessage(name, email, message);
}
// Function get value
function getInputVal(id) {
return document.getElementById(id).value;
}
//Save
function saveMessage(name, email, message) {
var newMessageRef = messagesRef.push();
newMessageRef.set({
name: name,
email: …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 PHPMailer 库从我的网站发送电子邮件。我这样做的目的是:
我从这个链接下载了 PHPMailer 5.2-stable 。
我在我的主机上上传了以下文件:class.phpmailer.php、class.smtp.php和PHPMailerAutoload.php
然后我创建了一个文件名 contact.php 并在其中编写了以下代码:
require 'phpmailer/PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->SMTPDebug = 1;
$mail->SMTPAuth = true;
$mail->IsSMTP();
$mail->Host = "smtp.gmail.com";
$mail->Username = "*****************"; //My Email Address
$mail->Password = "*****************"; //My Email's Address
$mail->SMTPSecure = "tls";
$mail->Port = 578;
$mail->AddAddress('*****************');
$mail->From = "*****************";
$mail->FromName = "Website Contact Form - " . "Website Name";
$mail->Subject = "New Message from Contact Form";
$mail->Body = 'This is the HTML message …Run Code Online (Sandbox Code Playgroud)