Posts Tagged with ok

Displaying 1-6 of 6 results.
Resolved: PHP Curl with login password create empty cookie and can't login to account
posted by admin on August 2, 2017

function bin_write($file, $str, $mode = 'w'){
$fd = fopen($file, $mode);
$result = fwrite($fd, $str);
fclose($fd);
chmod($file, 0777);
return $result;
}

function mycurlFunction($login, $password){
$user_agent = 'User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:15.0) Gecko/20100101 Firefox/15.0.1';

$cookies = dirname(__FILE__) . '/cookie/cookie_'.md5($login).'.txt';

if(!file_exists($cookies))
bin_write($cookies, '', 'w');

if (!is_writeable($cookies))
return "Cannot write to $cookies";

if ( ! extension_loaded('curl'))
return "You need to load/activate the curl extension.";

$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);

curl_setopt($ch, CURLOPT_ENCODING, "gzip");
curl_setopt($ch, CURLOPT_AUTOREFERER, 1);

curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);

curl_setopt($ch, CURLOPT_COOKIEFILE, $cookies);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookies);

curl_setopt($ch, CURLOPT_POST, false);

$url = "there is your website url/auth?Password=$password&Login=$login";
curl_setopt($ch, CURLOPT_URL, $url);
$html = curl_exec($ch);
curl_close($ch);
return $html;
}

Curl create empty cookie 0B and not login to my account. How to resolve itRead more
Resolved: Odnoklassniki OK api apiok users.getInfo all fields without errors
posted by admin on April 17, 2017
I try to get all allowed fields from user by id, and got some error

{
error_code:100
error_msg:PARAM : Invalid parameter fields value : [accessible,age,allows_anonym_access,allows_messaging_only_for_friends,birthday,blocked,blocks,can_vcall,can_vmail,capabilities,common_friends_count,current_location,current_status,current_status_date,current_status_date_ms,current_status_id,current_status_track_id,email,feed_subscription,first_name,friend,friend_invitation,gender,has_email,has_service_invisible,invited_by_friend,is_activated,last_name,last_online,last_online_ms,location,login,modified_ms,name,notifications_subscription,online,photo_id,pic1024x768,pic128max,pic128x128,pic180min,pic190x190,pic224x224,pic240min,pic288x288,pic320min,pic50x50,pic600x600,pic640x480,pic_1,pic_2,pic_3,pic_4,pic_5,pic_base,pic_full,pic_max,premium,presents,private,ref,registered_date,registered_date_ms,relationship,show_lock,uid,url_chat,url_chat_mobile,url_profile,url_profile_mobile,vip]
error_data:null
}

All fields I got from apiok official page

[{
accessible:Boolean
age:Integer
allows_anonym_access:Boolean
allows_messaging_only_for_friends:Boolean
birthday:String
blocked:Boolean
blocks:Boolean
can_vcall:Boolean
can_vmail:Boolean
capabilities:String
common_friends_count:Integer
current_location:{
altitude:Float
cellId:Integer
city:String
country:String
ipAddress:String
latitude:Float
longitude:Float
}
current_status:String
current_status_date:Date
current_status_date_ms:Long
current_status_id:String
current_status_track_id:String
email:String
feed_subscription:Boolean
first_name:String
friend:Boolean
friend_invitation:Boolean
gender:String
has_email:Boolean
has_service_invisible:Boolean
invited_by_friend:Boolean
is_activated:Boolean
last_name:String
last_online:String
last_online_ms:Long
locale:String
location:{
city:String
country:String
countryCode:String
countryName:String
}
login:String
modified_ms:Long
name:String
notifications_subscription:Boolean
online:String
photo_id:String
pic1024x768:String
pic128max:String
pic128x128:String
pic180min:String
pic190x190:String
pic224x224:String
pic240min:String
pic288x288:String
pic320min:String
pic50x50:String
pic600x600:String
pic640x480:String
pic_1:String
pic_2:String
pic_3:String
pic_4:String
pic_5:String
pic_base:String
pic_full:String
pic_max:String
premium:Boolean
presents:[{}]
private:Boolean
ref:String
registered_date:Date
registered_date_ms:Long
relations:[{}]
relationship:{}
show_lock:Boolean
uid:String
url_chat:String
url_chat_mobile:String
url_profile:String
url_profile_mobile:String
vip:Boolean
}]
Read more
Resolved: PHP get the first word of a sentence string
posted by admin on May 22, 2016
I want to extract the first word of a variable from a string. For example, take this input:

<?php $myvalue = 'Test me more'; ?>

The resultant output should be Test, which is the first word of the input. How can I do this?Read more
Resolved: Yii Captcha Broken Image
posted by admin on March 12, 2016
The captcha image is broken (no image appearing). The other components of captcha (links, error matching code etc) seem to work correctly

In Controller:

public function actions() {
return array(
'captcha' => array(
'class' => 'CCaptchaAction',
'backColor' => 0xFFFFFF,
),
);
}


In View:

<?php if (CCaptcha::checkRequirements()): ?>
<div class="row">
<?php echo $form->labelEx($model, 'verifyCode'); ?>
<div>
<?php $this->widget('CCaptcha'); ?>
<?php echo $form->textField($model, 'verifyCode'); ?>
</div>
<div class="hint">Please enter the letters as they are shown in the image above.

Letters are not case-sensitive.</div>
<?php echo $form->error($model, 'verifyCode'); ?>
</div>
<?php endif; ?>


In Model:

public $verifyCode;
....
public function rules() {
return array(
....
....
array('verifyCode', 'captcha', 'allowEmpty' => !CCaptcha::checkRequirements()),
);
}


Why I have this problem?Read more
Resolved: The app (77777777777) specified in fb:app_id meta tag is not published yet
posted by admin on January 23, 2016
Open Graph Object Debugger I see this error message

The app (573942919436638) specified in fb:app_id meta tag is not published yet. App attribution will be disabled when shared stories are rendered. Please check the status in the app settings.

I put my app_id on my meta fb:app_id tag, and resolve my app_id error, but now I got this one.Read more
Wiki: Create facebook app idwiki
posted by admin on January 23, 2016
In Facebook Open Graph Object Debugger, I see this error warning message

fb:app_id hasn't been included in the meta tags. Specify the app ID so that stories shared to Facebook will be properly attributed to the app. Alternatively, app_id can be set in url when open the share dialog. Otherwise, the default app id( 966242223397117 ) will be assigned.


How to resolve it?Read more