Jump to content

jomla

Members
  • Content count

    37
  • Joined

  • Last visited

Community Reputation

0 Neutral

About jomla

  • Rank
    Newbie
  1. 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>"; ?>
  2. 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
  3. <?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(); ?>
  4. 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
  5. To change a file date creation

    Hi at all I need a php script to set new date creation of a file. Thank you very much
  6. 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
  7. 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
  8. Mysqli query $result into a $_SESSION. Can I?

    <code> $query="SELECT id,name FROM iml order by name"; $result = $mysqli->query($query); $_SESSION['iml']=$result; </code>
  9. 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
  10. 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
  11. unable to prevent error if I work offline

    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
  12. 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
  13. 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
  14. it was a very informative post Thank you
  15. the script.php that I use now works well but at the beginning simply moved files from one directory and one of remoro server but not brought me the file locally. The mistake was that the script should be installed in a local server and not on a remote server. Now that I've installed the script in HTDOCS directory in my local XAMPP server the script works well but takes the files in the htdocs directory in the midst of the scripts .. In practice it is useless ahahahah So much work for nothing the script I use now works well at the beginning but simply moving files from one directory and one of remoro server but not brought me the file locally. The mistake was that the script should be installed in a local server and not on a remote server. Now that I've installed the script in HTDOCS directory in my local XAMPP server the script works well but takes the files in the htdocs directory in the midst of the script .. In practice it is useless ahahahah So much work for nothing
×