我在这里有一个函数,如果它们是空的,则验证表单中的字段.
function ValidateForm()
{
jQuery('span.error_msg').hide();
var success = true;
jQuery("#shippingF input").each(function()
{
if(jQuery(this).val()=="")
{
jQuery(this).next().show();
success = false;
}
});
return success;
}
Run Code Online (Sandbox Code Playgroud)
现在我想在这里使用该功能:
function post(url,formId) {
jQuery("#process").html('<img src="<?php echo get_bloginfo('wpurl').'/wp-content/plugins/'.basename(dirname(__FILE__)).'/images/co/ajax-loader.gif'; ?>" alt="loading" title="ajax-loader" width="16" height="16" class="alignnone size-full wp-image-134">');
jQuery.post(url, jQuery('#' + formId).serialize(), function(d) {
jQuery('html,body').animate({scrollTop: jQuery("#scrollhere").offset().top},'slow');
jQuery("#response").html('<center><p style="height:820px"><span style="color:black;font-weight:bold;font: 11px arial,verdana,sans-serif;"><b>Loading available payment getaways..</b></span><br/><img src="<?php echo get_bloginfo('wpurl').'/wp-content/plugins/'.basename(dirname(__FILE__)).'/images/co/8-1.gif'; ?>" width="220" height="19" /></p></center>');
jQuery("#response").load("<?php echo get_bloginfo('wpurl').'/wp-content/plugins/'.basename(dirname(__FILE__)).'/checkout_payment.php'; ?>", function() { Cufon.refresh(); });
jQuery("#response").attr("style","height:1030px");
});
}
Run Code Online (Sandbox Code Playgroud)
我试过了,我想出了这个.
function post(url,formId) {
ValidateForm();
if(ValidateForm() == …Run Code Online (Sandbox Code Playgroud) 基本上我希望我的用户在其帐户中关联PayPal帐户以进行身份验证.我正在开发一个市场网站,并希望将paypal作为我的身份验证程序.
有没有办法使用PHP验证电子邮件地址,名字和姓氏,如使用$_GET变量或$_POST变量?如果有可以告诉我怎么样?
我尝试了搜索,并获得了自适应帐户GetVerifiedStatusAPI.但这对我来说是全新的,我不知道在哪里以及如何开始.
我有一个带图像链接的字符串.
$image_link_raw = 'http://website.com/files/2012/10/image001.png';
Run Code Online (Sandbox Code Playgroud)
现在我想要删除http://website.com,只是得到/files/2012/10/image001.png:
$image_link_raw = '/files/2012/10/image001.png';
Run Code Online (Sandbox Code Playgroud)
有没有办法在PHP中这样做?