我想在Twitter上分享我的应用图片.我想使用Javascript和php以及具有回调函数的Twitter Api来发布带有文本的图片.我怎样才能做到这一点?
我试过了
<script type="text/javascript" src="jquery.twitterbutton.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#twitterbutton-example').twitterbutton({
user: 'POSimplicity',
title: ' powered by POSimplicity',
count_url: false,
user_description: 'user description',
url: 'http://www.abc.in/index.php',
ontweet: function (response) {
var id = $("p").html();
$.ajax({
url: 'add_customer.php',
data: 'twitpoints=' + '<?php echo $res['
0 ']['
regpoints ']; ?>' + '&total_points=' + '30' + '&customer_id=' + id,
dataType: 'html',
success: function (res) {
alert(res);
}
});
},
lang: 'en'
});
});
</script>
Run Code Online (Sandbox Code Playgroud)
在这里我能够发推文网址,但不能发送图片.
我想在Yii中使用重置密码功能.为此,我有4个字段,即email,currentPassword,newPassword,newPasswordRepeat.
我在我的模型中使用了以下规则
array('email, currentPassword, newPassword, newPasswordRepeat', 'required'),
array('newPasswordRepeat', 'compare', 'compareAttribute'=>'newPassword'),
array('currentPassword', 'equalPasswords'),
Run Code Online (Sandbox Code Playgroud)
equalPasswords我的用户定义规则在哪里检查currentPassword密码是否与我的原始密码匹配.
public function equalPasswords($currentPassword)
{
$oDbConnection = Yii::app()->db;
$oCommand = $oDbConnection->createCommand('SELECT * FROM Superadmin_details where email=:email');
$oCommand->bindParam(':email', Yii::app()->session['email'],PDO::PARAM_STR);
$user=$oCDbDataReader = $oCommand->queryRow();
if ($user['password'] != $currentPassword)
$this->addError($currentPassword, 'Old password is incorrect.');
}
Run Code Online (Sandbox Code Playgroud)
此规则在服务器端出错,即当我单击"提交"按钮时,页面将重新加载,然后显示错误.
我想像其他错误一样在客户端显示错误.
我已经在表单中启用了客户端验证.
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'contact-form',
'enableClientValidation'=>true,
'clientOptions'=>array(
'validateOnSubmit'=>true,
),
)); ?>
Run Code Online (Sandbox Code Playgroud) 我正在使用 PHTML 编码器对我的 php 文件进行编码,但当我运行编码文件时,它给出错误“调用未定义的函数 dl()”。请有人帮忙。
<?php
if(!function_exists("phtmldec")){
$w=(substr(PHP_OS,0,3)=="WIN")?1:0;$ln="phtmlenc".phpversion();$cd=dirname(__FILE__);
if($w){
$ln=$ln.".dll";if($cd[1]==":") $cd=substr($cd,2);
} else {
$ln=$ln.".so";if(strlen($cd)<3) $cd=getcwd();
}
if(version_compare(phpversion(),"5.2.5")==-1){
$cd1=ini_get('extension_dir');
$cd2=PHP_EXTENSION_DIR;
if($cd[strlen($cd)-1]!="/")$cd=$cd."/";
if($cd1[strlen($cd1)-1]!="/")$cd1=$cd1."/";
if($cd2[strlen($cd2)-1]!="/")$cd2=$cd2."/";
if($cd1[1]==":") $cd1=substr($cd1,2);
if($cd2[1]==":") $cd2=substr($cd2,2);
$ic=substr_count($cd,"\\")+substr_count($cd,"/");
$ic1=substr_count($cd1,"\\")+substr_count($cd1,"/");
$ic2=substr_count($cd2,"\\")+substr_count($cd2,"/");
$en=str_repeat("../",max($ic,$ic1,$ic2))."..".$cd.$ln;
} else {
$en=$ln;$r=dl($en);if(!$r)exit("Unable to load $en");
}
$p="F4\$A016YC2@Y(8Q[Y!2F3[@K2.0>K0Z%5^#2\\,&;5L7\$<KHL)BH<`";
phtmldec($p);
}
?>
Run Code Online (Sandbox Code Playgroud) 我试图使用Api推送通知,我没有得到任何错误消息,我没有得到任何响应.
并相应地应用了我的代码中的更改但仍无效.
我无法得到serverId我必须使用的方法
$device = 'fbb5a9c71066794d57fee33b4005a89f1bb8941a68660fd6e91f466be1299ab6'; // My iphone deviceToken
$payload['aps'] = array(
'alert' => 'This is the alert text',
'badge' => 1,
'sound' => 'default'
);
$payload['server'] = array(
'serverId' => 1,
'name' => 'keyss.in'
);
$payload = json_encode($payload);
$apnsCert = 'apple_push_notification_production.pem';
$streamContext = stream_context_create();
stream_context_set_option($streamContext, 'ssl', 'local_cert', $apnsCert);
$apns = stream_socket_client('ssl://gateway.sandbox.push.apple.com:2195', $error, $errorString, 2, STREAM_CLIENT_CONNECT, $streamContext);
$apnsMessage = chr(0) . chr(0) . chr(32) . pack('H*', str_replace(' ', '', $device)) . chr(0) . …Run Code Online (Sandbox Code Playgroud) 我正在使用Yii框架,每当我打开页面时,它会在资产中加载jquery-ui.css.我想改变那个css并应用我的css.我怎么能改变那个css.或者从这个文件来的地方.在框架中jquery-ui.css的路径是什么.
我在我的Magento商店使用PayPal作为付款方式.当我选择PayPal作为付款方式时,它会同时将我重定向到PayPal登录页面,但我想在完成所有结帐步骤后重定向该页面.
我怎样才能做到这一点?是否有任何管理员设置或我必须为此自定义代码?请帮忙.