Posts Tagged with file

Displaying 1-9 of 9 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: PHP echo link content in page
posted by admin on October 26, 2016
I am working on website and in locale and want to show in my page part of code from live server.
like

echo PHP_LINK_READER_FUNCTION("SOME_URL");
Read more
Resolved: Bootstrap Form File Element upload button
posted by admin on October 12, 2016
I want customize my upload file input by bootstrtap default functionalityRead more
Resolved: How to create gitignore and htaccess files on xampp
posted by admin on October 6, 2016
I want to create gitignore and htaccess files on xampp, without errors. I have got errors on file type places.Read more
Resolved: PHP filesize MB/KB conversion
posted by admin on June 18, 2016
How can I convert the output of PHP's filesize() function to a nice format with MegaBytes, KiloBytes etc?

like:
  • if the size is less than 1 MB, show the size in KB
  • if it's between 1 MB - 1 GB show it in MB
  • [*] if it's larger - in GBRead more
    Resolved: Yii file save error Directory must be writable
    posted by admin on April 11, 2016
    I have form, and I create directory by mkdir

    mkdir($mydirectory, 0777, true);


    And got an error during save my file, which I try to upload from my _form.php

    Directory must be writable
    Read more
    Wiki: Yii 1.1: videojswiki
    posted by admin on April 9, 2016
    EVideoJS extends CWidget and implements a base class for the VideoJS player.

    EVideoJS extends CWidget and implements a base class for the VideoJS HTML5 Video Player.

    Tested with Yii Framework v.1.1.6 and VideoJS 1.3.0.

    Support: http://www.yiiframework.com/forum/index.php?/topic/16592-evideojs/

    Installation
    Extract the videojs folder under protected/extensions.

    Usage
    The bare minimum configuration needs:
    • video_mp4 URL
    • width
    • height


    The code below shows common usage and options defaults.


    $this->widget('application.extensions.videojs.EVideoJS', array(
    'options' => array(
    // Unique identifier, is autogenerated by default, useful for jQuery integrations.
    'id' => false,
    // Video and poster width in pixels
    'width' => 320,
    // Video and poster height in pixels
    'height' => 240,
    // Poster image absolute URL
    'poster' => false,
    // Absolute URL of the video in MP4 format
    'video_mp4' => false,
    // Absolute URL of the video in OGV format
    'video_ogv' => false,
    // Absolute URL of the video in WebM format
    'video_webm' => false,
    // Use Flash fallback player ?
    'flash_fallback' => true,
    // Address of custom Flash player to use as fallback
    'flash_player' => 'http://releases.flowplayer.org/swf/flowplayer-3.2.1.swf',
    // Show controls ?
    'controls' => true,
    // Preload video content ?
    'preload' => true,
    // Autostart the playback ?
    'autoplay' => false,
    // Show VideoJS support link ?
    'support' => true,
    // Show video download links ?
    'download' => true,
    ),
    ));


    Resources
    VideoJS official web site: HTML5 Video Player

    Download
    videojs.zipRead more
    Resolved: JavaScript get last characters from string. Get file extension from filename
    posted by admin on April 9, 2016
    I have file name, like
    dad a d as da a d ad as d as d.jpg

    I want to get file extension , the last three letters.Read more
    Resolved: Ubuntu do not show hidden files
    posted by admin on February 9, 2016
    I see hidden files in Ubuntu Linux. How to change settings. I don't want to see them.Read more