我想让用户填写一份联系表格,然后发送到我的电子邮箱.但由于某种原因它不起作用.我只是得到一个没有错误消息的空白页面或任何文本和电子邮件也没有发送.
if (isset($_POST['submit']))
{
include_once('class.phpmailer.php');
$name = strip_tags($_POST['full_name']);
$email = strip_tags ($_POST['email']);
$msg = strip_tags ($_POST['description']);
$subject = "Contact Form from DigitDevs Website";
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->CharSet = 'UTF-8';
$mail->Host = "mail.example.com"; // SMTP server example
//$mail->SMTPDebug = 1; // enables SMTP debug information (for testing)
$mail->SMTPAuth = true; // enable SMTP authentication
$mail->Port = 26; // set the SMTP port for the GMAIL server
$mail->Username = "info@example.com"; // SMTP account username example
$mail->Password = "password"; // SMTP …Run Code Online (Sandbox Code Playgroud) 在我的表单中有多个文件上传,FormData只使用一个文件上传,虽然我选择了多个文件上传,以下是代码
HTML
<form name="uploadImages" method="post" enctype="multipart/form-data">
<input type="file" name="photo[]" value="">
<input type="file" name="photo[]" value="">
<input type="file" name="photo[]" value="">
</form>
Run Code Online (Sandbox Code Playgroud)
JS
var ajaxData = new FormData();
ajaxData.append( 'action','uploadImages');
jQuery.each($("input[name^='photo']")[0].files, function(i, file) {
ajaxData.append('photo['+i+']', file);
});
$.ajax({
url: URL,
data: ajaxData,
cache: false,
contentType: false,
processData: false,
type: 'POST',
dataType:'json',
success: function(data) {
if (data.status == 'success') {
location.reload();
}
}
});
Run Code Online (Sandbox Code Playgroud)
我PHP在服务器上使用,使用HTML attribute namei,e photo只有我能够保存文件,动态文件名对我来说不起作用.
我DOM如下,
<div id='level-1'>
<ul>
<li><span><a>Mike</a></span></li>
<li><span><a>John</a></span></li>
<li><span><a>Ket</a></span></li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
并且jQuery是如下,
$(document).on('click','div[id^=[level] ul li span a',function(){
//Making ajax request,no problem in getting the response
// Here I need to append response next to the current div i,e div#level-1 or div#leve-2
});
Run Code Online (Sandbox Code Playgroud)
ajax响应将与上述相同的DOM除了id所述的div的和内容anchor tag.id将是level-2或level-3我,e.+1到div的当前值.
我正在研究以下代码,其中我想使用php if conditions多个非运算符的多个(示例如下).
但是当我执行跟随时php code,它总是返回true(括号中的平均内容总是执行)甚至条件为假.
我想问一下下面代码中的问题是什么,是否有使用多个的特定语法或规则!= operator in php conditions?我很惊讶地看到,如果我用替换下面的代码!= operator与== operator它工作正常.
if( $ext!="exe" || $ext!="html" || $ext!="htm" || $ext!="js" || $ext!="iso" || $ext!="zip" || $ext!="rar" )
{ // ececk extension
echo $ext."extension";
}
else{
echo "not match";
}
Run Code Online (Sandbox Code Playgroud)
等待你的回复.抱歉我的英语不好
我dynamic forms在一个网页中有多个,如下所示
<form name='login' id='login_1'>
<input type='text' name='username'/>
<input type='password' name='pwd'/>
<input type='submit' name='submit' id='submit_1' value='Login'/>
</form>
<form name='login' id='login_2'>
<input type='text' name='username'/>
<input type='password' name='pwd'/>
<input type='submit' name='submit' id='submit_2' value='Login'/>
</form>
.......
.......
Run Code Online (Sandbox Code Playgroud)
这里id's是动态的,假设用户以第二种形式输入数据并提交然后我需要将第二(仅)表单数据发送到服务器而不使用第三方jQuery plugins,这里我无法submit button id正确选择.
是否使用发送数据的安全过程serializeArray();,尤其是登录过程?
谁能告诉我这里有什么问题?我有冲突
ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js,
所以这就是我需要noconflict真实的原因,但是如果我将它分配给所有页面我slidingpanels都行不通.我真的需要在页面上使用滑动面板脚本没有virtuemart帮助
<?php
if ($("body").hasClass("option-com-virtuemart")) {
addScript("noflict.js");}
else {
addScript("slidingpanel.js");}
?>
Run Code Online (Sandbox Code Playgroud)
提前致谢