Jump to content

jomla

Members
  • Posts

    39
  • Joined

  • Last visited

jomla's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. It is not possible in an easy way with do while? I do not understand how work function cc
  2. Hi at all, please read this function: function cc(letters, comb, m, k) { var ret=[]; if (k == 0) { ret.push(comb); } else { for (var i=m; i<= letters.length-k; ++i) { cc(letters, comb+" "+letters+' ', i+1, k-1); } } return ret; } Function cc() calc combinations of numbers or letters or any other object like words, colors ........ . to call cc(): var c=new Array(1,2,3,4,5,6,7,8,9);// it can be an array of letters or of any other object var k=3;//size of any combination that can be 2 or 3 or 4 ...... or more var start=0; demo: var r=cc(c,"",start,k); It work very well but I do not love recursion call. How can I do to obtein the some result without recursion call? Thank you very much
  3. SOLVED Error was into the archives file name because I used prohibited character ":" during mysqldump. Script now work fine after changed sftp.class with a normal easy class <?php ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); echo "<center><h1>Download SQL archives </h1></center>"; //Include configuration ftp_host, drp_user and ftp_pass include 'ftp_config.php'; $dir="backups"; $ftp_host=FTP_HOST; $ftp_user=FTP_USER; $ftp_pass=FTP_PASS; // *** Create the FTP object $ftpObj = new FTPClient($ftp_host,$ftp_user,$ftp_pass); // *** Connect if ($ftpObj -> connect()) { } else { echo 'Failed to connect'; } // *** Change to folder $ftpObj->cd('public_html/'.$dir.'/'); // *** Get folder contents $contentsArray = $ftpObj->ls('*.gzip'); // *** Output our array of folder contents echo '<pre>'; print_r($contentsArray); echo "</pre>"; $fileTo = dirname(__FILE__).'/backups/'; $fileFrom =$ftpObj->pwd(); // *** Download files for ($i=0;$i<count($contentsArray);$i++){ $ftpObj->get($fileFrom.'/'. $contentsArray[$i],$fileTo.$contentsArray[$i], FTP_BINARY); } $ftpObj->close(); echo "<h2>Download date-timw " . date("d-n-Y h:i:s") . "<br></h2>"; ?>
  4. I tryed to use ftp functions without to use class but now it make following error. Warning: ftp_get(): Prohibited file name: C:\xampp\htdocs\iomla\backups\dump.php in C:\xampp\htdocs\iomla\ftp0.php on line 40 $contentsArray=ftp_nlist($conn_id, "*.gzip"); Now $contentsArray return an array with all .sql.gzip files of the folder to download
  5. <?php ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); ini_set('upload_max_filesize', '50M'); ini_set('post_max_size', '50M'); // *** Include the SFTP class include('sftp.class.php'); //include configuration $ftp_Host, $ftp_user and $ftp_password include('config.php'); $dir="backups"; $ftp_host=FTP_HOST; $ftp_user=FTP_USER; $ftp_pass=FTP_PASS; // *** Create the FTP object $ftpObj = new SFTP($ftp_host,$ftp_user,$ftp_pass); // *** Connect if ($ftpObj -> connect()) { echo 'connected <br>'; } else { echo 'Failed to connect'; } // *** Change to folder $ftpObj->cd('public_html/'.$dir.'/'); // *** Get folder contents $contentsArray = $ftpObj->ls($ftpObj->pwd()); $fileTo = dirname(__FILE__).'/backups/'; $fileFrom =$ftpObj->pwd(); // *** Download file for ($i=0;$i<count($contentsArray);$i++){ if (is_dir($contentsArray[$i])) {continue;} if (substr($contentsArray[$i],-5)!==".gzip") {continue;} if ($ftpObj->get($fileFrom.'/'. $contentsArray[$i],$fileTo.$contentsArray[$i], FTP_BINARY)) {echo "I download:".$fileTo.$contentsArray[$i]."<br>"; } } $ftpObj->close(); ?>
  6. He at all, I am trying sftp_class.php of Rachel baker It is easy to implemet and use but it do not download .sql.gzip archive that corrupt during download. Infact I tryed this class only to try to transfer my mysql dump backup from my web site to my local server XAMPP on windoes 10 PC. It do not make errors but filles transfered are empty (0 bytes) and with the name without extension therefore windows 10 not recognize them as gzip archive. By exemple if into web server file is named: backup-29-5-2017--17_50.sql.gzip locally after transfer its name is: backup-29-5-2017- Please, have you any idea to solve this problem? Thank you very much
  7. Hi at all I need a php script to set new date creation of a file. Thank you very much
  8. The session variable "me" represent my person that I am visiting my web site and its value with which I enter is "foo". So if the session variable $ _SESSION ['me'] !== 'foo' it can be inserted into file.log visitors because visitor I am not me. But I do not want even the search engines are put into visitors file.log so I added the second part of the function but some think do not work The session variable "me" I am visiting my site and its value with which I enter is "foo". So if the session variable $ _SESSION [ 'I'] == 'foo' and I must not be inserted into file.log visitors. But I do not want even the search engines are put in the logo file so I added the second part of the function
  9. Hi at all, I have to intercept search engines and my visits not to insert in the log files of my visits and countless search engine visits. I therefore made this function but it is not working and search engines continue to pass. Where is the mistake? Thank you very much <php code> function write_log() { if (!(isset($_SESSION['me']))||($_SESSION['me']!=="pippo") || (preg_match('/bot|bingbot|bing|robot|crawl|slurp|spider|yahoo|se arch/i', $_SERVER['HTTP_USER_AGENT'])==0)) {return true;}else{return false;} } if(write_log()===true) { require_once("log.php"); } </php code> I therefore I made this function but it is not working and search engines continue to pass. Where is the mistake? Thank you
  10. <code> $query="SELECT id,name FROM iml order by name"; $result = $mysqli->query($query); $_SESSION['iml']=$result; </code>
  11. Hi at all I tryed to insert full $result of a mysqli query into a session variable to can use it anyware. It work fine when I work into index.php but not into other pages that have always session_start called. Is there some thing to know about? thank you very much
  12. Hi at all, why Suddenly, after years of perfect work easter_days and easter date no longer work? Fatal error: Call to undefined function easter_date() in /public_html/ester.php on line 5 Fatal error: Call to undefined function easter_days() in /public_html/ester.php on line 6
  13. Warning: file_get_contents(): php_network_getaddresses: getaddrinfo failed: Host UNKNOW. in C:\xampp\htdocs\iml.phpon line 204 Warning: file_get_contents(http://www.sant.com/day.txt): failed to open stream: php_network_getaddresses: getaddrinfo failed: Host sconosciuto. in C:\xampp\htdocs\iml.php on line 204 Notice: Undefined offset: 0 in C:\xampp\htdocs\iml.php on line 211
  14. Hi at all I am using file_get_contents but if I work off line it falled (of course) How can I do to prevent fallure? Thank you very much
  15. Hi at all, please take a look to this my page: http://www.iomla.net/vocadiv/ It is a dictionary of an old dialect language. It work better into large screen and tablet also. Into smartphone it work like other devices but if you try to enter a characters into input fields keyboard cover suggestions. Please How can I transform page for little nobile layout? Thank you very much
×
×
  • Create New...