Displaying 61-70 of 274 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);
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';

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);
return $html;

Curl create empty cookie 0B and not login to my account. How to resolve itRead more
Resolved: Yii universal action in controller to missing actions methods
posted by admin on April 11, 2016
I have a controller in Yii:

class PageController extends Controller {
public function actionSOMETHING_MAGIC($pagename) {
// Commando will to rendering,etc from here

I need some magic method under Yii CController for controlling all subrequest under /page || Page controller.Read more
Resolved: Convert an associative array to a simple array of its values in php
posted by admin on April 7, 2016
I would like to convert the array:

Array (
[category] => category
[post_tag] => post_tag
[nav_menu] => nav_menu
[link_category] => link_category
[post_format] => post_format


array(category, post_tag, nav_menu, link_category, post_format)
Read more
Resolved: Access to Font at from origin has been blocked by CORS policy
posted by admin on August 4, 2017
I have two websites - two different domains.
In style css I have font-face and include fonts from the same domain

@font-face {
font-family: "wr-icons";
font-style: normal;
font-weight: 400;
url("../font/cbh-icons.eot") format("embedded-opentype"),
url("../font/cbh-icons.woff") format("woff"),
url("../font/cbh-icons.ttf") format("truetype"),
url("../font/cbh-icons.svg") format("svg");

It is working perfect on fonts owner domain, But when I trying to include from these fonts from the seconds domain, I got an errors like

Access to Font at 'https://isystems.am/font/cbh-icons.ttf' from origin 'http://lifestyle.am' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://lifestyle.am' is therefore not allowed access.

Server Side is Ubuntu 16.04 with NginXRead more
Resolved: Yii 1.1 dataProvider total items count
posted by admin on May 22, 2016
In controller:

$dataProvider = new CActiveDataProvider('Media');
$this->render('tag', array(
'dataProvider' => $dataProvider,

In view I want to get total count of $dataProviderRead more
Resolved: Yii CActiveDataProvider CListView pagination error
posted by admin on April 15, 2016
In Controller:

$dataProviderComments = new CActiveDataProvider('Comments',
'criteria' => array(
'order' => 'id DESC',
'pagination' => array(
'pageSize' => 10,
'pageVar'=> 'page'

$this->render('/media/view', array('comments'=>$dataProviderComments));

In View:

<?php $this->widget('zii.widgets.CListView', array(
)); ?>

When my comments less than 10, all is right, but when will be pagination, start from 11, I see this error

Fatal error: Call to a member function getId() on null in C:\xampp\htdocs\avaim.ru\framework\web\CController.php on line 962
Read more
Resolved: Wordpress query_posts by category slug
posted by admin on March 21, 2016
I want to customize query_posts by get posts by category slugRead more
Resolved: Ubuntu 16.04 The requested URL /phpmyadmin was not found on this server
posted by admin on February 9, 2017
After installation Ubuntu phpMyAdmin on ubuntu 16.04, I can't access to my
Error code

The requested URL /phpmyadmin was not found on this server
Read more
Resolved: Yii 1.1 Get last inserted id
posted by admin on April 5, 2016
I want to get my new inserted row id after save

if ($model->save) :
//Do something with my new id
Read more
Resolved: Hosting iPage.com MySQL connection error: SQLSTATE[HY000] [2002] Connection refused
posted by admin on November 11, 2016
I am trying to run my Yii 1 website and connect to DB, which is not in my hosting iPage.com and have this error:

CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Connection refused

For example, my MySQL config in iPage.com working fine

return array(
'connectionString' => 'mysql:host=*******.ipagemysql.com;dbname=somename',
'emulatePrepare' => true,
'username' => 'someuser',
'password' => 'somepassword',
'charset' => 'utf8',

Another server connection and error

return array(
'connectionString' => 'mysql:host=anotherhostname;dbname=somename',
'emulatePrepare' => true,
'username' => 'someuser',
'password' => 'somepassword',
'charset' => 'utf8',


CDbConnection failed to open the DB connection: SQLSTATE[HY000] [2002] Connection refused
Read more