小编Hap*_*ppy的帖子

如何用文字推特图片

我想在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)

在这里我能够发推文网址,但不能发送图片.

javascript php twitter

11
推荐指数
1
解决办法
6704
查看次数

如何在yii中创建客户端自定义规则

我想在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)

php yii yii-extensions

6
推荐指数
1
解决办法
1014
查看次数

调用未定义的函数 dl()

我正在使用 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)

php

5
推荐指数
1
解决办法
3万
查看次数

如何通过IP获取时区

我有一个注册,通过它我可以获得注册用户的IP地址.

我想通过他的IP地址获取用户的时区.

就像在jquery中一样,我们可以在jquery中使用这个 时区

我怎么能用PHP做到这一点.

php timezone timezone-offset

5
推荐指数
1
解决办法
1万
查看次数

使用Api推送通知

我试图使用Api推送通知,我没有得到任何错误消息,我没有得到任何响应.

用PHP脚本检查了Apple推送通知服务

并相应地应用了我的代码中的更改但仍无效.

我无法得到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)

php push-notification apple-push-notifications ios

2
推荐指数
1
解决办法
1323
查看次数

Yii中jquery-ui.css的路径

我正在使用Yii框架,每当我打开页面时,它会在资产中加载jquery-ui.css.我想改变那个css并应用我的css.我怎么能改变那个css.或者从这个文件来的地方.在框架中jquery-ui.css的路径是什么.

yii

1
推荐指数
1
解决办法
1198
查看次数

完成Checkout的所有步骤后重定向到Paypal

我在我的Magento商店使用PayPal作为付款方式.当我选择PayPal作为付款方式时,它会同时将我重定向到PayPal登录页面,但我想在完成所有结帐步骤后重定向该页面.

我怎样才能做到这一点?是否有任何管理员设置或我必须为此自定义代码?请帮忙.

paypal magento

1
推荐指数
1
解决办法
3563
查看次数