Jump to content

jasonc310771

Members
  • Posts

    50
  • Joined

  • Last visited

Everything posted by jasonc310771

  1. Ok I understand now, I thought the table would remain and cause the other visitors at the same time viewing to get errors. Using the test query I gave above, I get the error.. CREATE TABLE copylinks SELECT * FROM `links-test` as l LEFT JOIN `accounts-test` as a ON a.id=l.author WHERE `l`.`live` = '1' ORDER BY `l`.`lastVisitDateTime` DESC LIMIT 10; MySQL said: #1060 - Duplicate column name 'id'
  2. If I have more than one visit at the same time will it still work using the temp table ?
  3. Using a temp table is not an option, its on a live site that would conflict with each visit. Yes I realised that when I tested it locally, I had removed that colum in error.
  4. I have created test tables below... -- phpMyAdmin SQL Dump -- version 5.2.1 -- https://www.phpmyadmin.net/ -- -- Host: localhost:3306 -- Generation Time: Jun 08, 2023 at 01:35 AM -- Server version: 5.7.42 -- PHP Version: 8.1.16 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; START TRANSACTION; SET time_zone = "+00:00"; CREATE TABLE `accounts-test` ( `id` bigint(20) NOT NULL COMMENT '2013', `username` text NOT NULL COMMENT '2013', `first_name` varchar(255) NOT NULL COMMENT '2013' ) ENGINE=MyISAM DEFAULT CHARSET=latin1 ROW_FORMAT=DYNAMIC; INSERT INTO `accounts-test` (`id`, `username`, `first_name`) VALUES (1, 'user1', 'user1'), (2, 'user2', 'user2'); CREATE TABLE `links-test` ( `id` int(11) NOT NULL, `link` text, `live` int(1) NOT NULL, `author` text, `timestamp` int(11) NOT NULL, `lastVisitDateTime` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO `links-test` (`id`, `link`, `live`, `author`, `timestamp`, `lastVisitDateTime`) VALUES (1, 'https://www.example.com/1', 1, '1', 1, '2023-06-07 10:00:00'), (3, 'https://www.example.com/4', 1, '1', 3, '2023-06-07 10:00:00'), (4, 'https://www.example.com/1', 1, '2', 4, '2023-06-07 10:00:02'), (2, 'https://www.example.com/2', 1, '2', 2, '2023-06-07 10:00:01'), (5, 'https://www.example.com/3', 1, '1', 5, '2023-06-07 10:00:00'), (6, 'https://www.example.com/4', 1, '2', 6, '2023-06-07 10:00:03'), (7, 'https://www.example.com/2', 1, '1', 7, '2023-06-07 10:00:00'), (8, 'https://www.example.com/3', 1, '2', 8, '2023-06-07 10:00:04'), (9, 'https://www.example.com/1', 1, '1', 9, '2023-06-07 10:00:00'), (10, 'https://www.example.com/4', 1, '2', 10, '2023-06-07 10:00:05'), (11, 'https://www.example.com/1', 1, '1', 11, '2023-06-07 10:00:00'), (12, 'https://www.example.com/2', 1, '2', 12, '2023-06-07 10:00:06'), (13, 'https://www.example.com/3', 1, '1', 13, '2023-06-07 10:00:00'), (14, 'https://www.example.com/4', 1, '2', 14, '2023-06-07 10:00:07'), (15, 'https://www.example.com/2', 1, '1', 15, '2023-06-07 10:00:00'), (16, 'https://www.example.com/3', 1, '2', 16, '2023-06-07 10:00:08'), (17, 'https://www.example.com/2', 1, '2', 17, '2023-06-07 10:00:00'), (18, 'https://www.example.com/3', 1, '1', 18, '2023-06-07 10:00:09'), (19, 'https://www.example.com/4', 1, '2', 19, '2023-06-07 10:00:00'), (20, 'https://www.example.com/2', 1, '1', 20, '2023-06-07 10:00:10'), (21, 'https://www.example.com/3', 1, '2', 21, '2023-06-07 10:00:00'); ALTER TABLE `accounts-test` ADD PRIMARY KEY (`id`); ALTER TABLE `links-test` ADD PRIMARY KEY (`id`); ALTER TABLE `accounts-test` MODIFY `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '2013', AUTO_INCREMENT=3; ALTER TABLE `links-test` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=22; COMMIT; -- QUERY 1 CREATE TABLE copylinks SELECT * FROM `links-test` as l LEFT JOIN `accounts-test` as a ON a.id=l.author WHERE `l`.`live` = '1' ORDER BY `l`.`lastVisitDateTime` DESC LIMIT 10; -- QUERY 2 INSERT INTO copylinks SELECT * FROM `links-test` as l LEFT JOIN `accounts-test` as a ON a.id=l.author LEFT JOIN copylinks l2 ON l.id = l2.id WHERE `l`.`live` = '1' AND `l`.`linklocation` = 'main' AND l2.id IS NULL ORDER BY `l`.`timestamp` DESC; -- CHECK RESULT SELECT * FROM copylinks;
  5. I just tried it again to see if I could figure it out myself. now I get error that the copylinks table exists? I see that it creates a new table in the database. Can this not be done without creating a new table ?
  6. Hi Thanks, I used the query as is and get the error #1060 - Duplicate column name 'id'
  7. The following query is not sorting the second select by timestamp. I am after the first ten results from the table based on the lastVisitDateTime, followed by the rest of the table, I used union so this removes the duplicates, but I only want the duplicates from the second select to be removed, leaving the first ten untouched. SELECT * FROM `links` as l LEFT JOIN `accounts` as a ON a.id=l.author WHERE `l`.`live` = '1' ORDER BY `l`.`lastVisitDateTime` DESC LIMIT 10 UNION SELECT * FROM `links` as l2 LEFT JOIN `accounts` as a2 ON a2.id=l2.author WHERE `l2`.`live` = '1' AND `l2`.`linklocation` = 'main' ORDER BY `l2`.`timestamp` DESC;
  8. RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule (.*) https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] The code above is what I currently have in the public_html folder. I have the just the first rewrite part of the code in the sub.domain.com's .htaccess file, but the url gets rewritten with the www. added. How do I stop the www. being added ? tia.
  9. I still do not know enough about $_SESSION The main domain example.com is where they login. I have the user data is stored in $_SESSION['user'] as an array. Once logged in they get taken to members.example.com and $_SESSION['user'] is no longer available. All pages have session_start(); at the start (no spaces or anything outputted before) Some time ago in some forum I tried to get help in, suggested I should not use the second method that actually worked as it should work automatically without the extra code. Just use session_start(); So confused as to why it does not automatically work ?
  10. I am wanting to access session data on all subdomains. I have tried to add session.cookie_domain = '.yourdomainname.example' (with my domain name) to php.ini But no change. using the following.. if(isset($_COOKIE['session_id'])) session_id($_COOKIE['session_id']); session_start(); if(!isset($_COOKIE['session_id'])) setcookie('session_id', session_id(), 0, '/', '.yourdomainname.example'); All works fine, but I have been told that I should not be setting sessions this way ? How do I correctly configure the server to allow this ?
  11. I am having issues with "SameSite" errors in Forefox. The server is PHP Version 5.6.40 I get the error in firefox concole Cookie “PHPSESSID” does not have a proper “SameSite” attribute value. Soon, cookies without the “SameSite” attribute or with an invalid value will be treated as “Lax” In my code I have if(isset($_COOKIE['session_id'])) session_id($_COOKIE['session_id']); session_start(); if(!isset($_COOKIE['session_id'])) setcookie('session_id', session_id(), 0, '/', '.site.com'); But the error still shows. This error shows in both in the main www.site.com and m.site.com subdomain. How do I fix this please ?
  12. For some reason that I have yet to find out my body tag height is set to 135px but it should be the default 100% I have stripped down the page to the minimum where the bug still exists. Forgive the inpage styles, this was only to help me try to figure out what was going on. What would be causing the body tag to only be 135px's ? <!DOCTYPE html> <html lang="en"> <head> <link rel="shortcut icon" href="favicon.ico"> <title>xzxvcb</title> <meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="keywords" content=""> <meta name="description" content=""> <style> /* W3.CSS 2.97 Feb 2017 by Jan Egil and Borge Refsnes */ html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit} /* Extract from normalize.css by Nicolas Gallagher and Jonathan Neal git.io/normalize */ html{} body{margin:0} article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block} audio,canvas,progress,video{display:inline-block}progress{vertical-align:baseline} audio:not([controls]){display:none;height:0}[hidden],template{display:none} a{background-color:transparent;-webkit-text-decoration-skip:objects} a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted} dfn{font-style:italic}mark{background:#ff0;color:#000} small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} sub{bottom:-0.25em}sup{top:-0.5em}figure{margin:1em 40px} img{border-style:none}svg:not(:root){overflow:hidden} code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em} hr{box-sizing:content-box;height:0;overflow:visible} button,input,select,textarea{font:inherit;margin:0}optgroup{font-weight:bold} button,input{overflow:visible}button,select{text-transform:none} button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button} button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner{border-style:none;padding:0} button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring{outline:1px dotted ButtonText} fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em} legend{color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto} [type=checkbox],[type=radio]{padding:0} [type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto} [type=search]{-webkit-appearance:textfield;outline-offset:-2px} [type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none} ::-webkit-input-placeholder{color:inherit;opacity:0.54} ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit} /* End extract */ html,body{font-family:Verdana,sans-serif;font-size:15px;line-height:1.5}html{/*overflow-x:hidden*/} h1,h2,h3,h4,h5,h6,.w3-slim,.w3-wide{font-family:"Segoe UI",Arial,sans-serif} h1{font-size:36px}h2{font-size:30px}h3{font-size:24px}h4{font-size:20px}h5{font-size:18px}h6{font-size:16px} .w3-serif{font-family:"Times New Roman",Times,serif} h1,h2,h3,h4,h5,h6{font-weight:400;margin:10px 0}.w3-wide{letter-spacing:4px} h1 a,h2 a,h3 a,h4 a,h5 a,h6 a{font-weight:inherit} hr{border:0;border-top:1px solid #eee;margin:20px 0} img{margin-bottom:-5px}a{color:inherit} .w3-image{max-width:100%;height:auto} .w3-table,.w3-table-all{border-collapse:collapse;border-spacing:0;width:100%;display:table} .w3-table-all{border:1px solid #ccc} .w3-bordered tr,.w3-table-all tr{border-bottom:1px solid #ddd} .w3-striped tbody tr:nth-child(even){background-color:#f1f1f1} .w3-table-all tr:nth-child(odd){background-color:#fff} .w3-table-all tr:nth-child(even){background-color:#f1f1f1} .w3-hoverable tbody tr:hover,.w3-ul.w3-hoverable li:hover{background-color:#ccc} .w3-centered tr th,.w3-centered tr td{text-align:center} .w3-table td,.w3-table th,.w3-table-all td,.w3-table-all th{padding:8px 8px;display:table-cell;text-align:left;vertical-align:top} .w3-table th:first-child,.w3-table td:first-child,.w3-table-all th:first-child,.w3-table-all td:first-child{padding-left:16px} .w3-btn,.w3-btn-block,.w3-button{border:none;display:inline-block;outline:0;padding:6px 16px;vertical-align:middle;overflow:hidden;text-decoration:none!important;color:#fff;background-color:#000;text-align:center;cursor:pointer;white-space:nowrap} .w3-btn:hover,.w3-btn-block:hover,.w3-btn-floating:hover,.w3-btn-floating-large:hover{box-shadow:0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)} .w3-button{color:#000;background-color:#f1f1f1;padding:8px 16px}.w3-button:hover{color:#000!important;background-color:#ccc!important} .w3-btn,.w3-btn-floating,.w3-btn-floating-large,.w3-closenav,.w3-opennav,.w3-btn-block,.w3-button{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} .w3-btn-floating,.w3-btn-floating-large{display:inline-block;text-align:center;color:#fff;background-color:#000;position:relative;overflow:hidden;z-index:1;padding:0;border-radius:50%;cursor:pointer;font-size:24px} .w3-btn-floating{width:40px;height:40px;line-height:40px}.w3-btn-floating-large{width:56px;height:56px;line-height:56px} .w3-disabled,.w3-btn:disabled,.w3-button:disabled,.w3-btn-floating:disabled,.w3-btn-floating-large:disabled{cursor:not-allowed;opacity:0.3}.w3-disabled *,:disabled *{pointer-events:none} .w3-btn.w3-disabled:hover,.w3-btn-block.w3-disabled:hover,.w3-btn:disabled:hover,.w3-btn-floating.w3-disabled:hover,.w3-btn-floating:disabled:hover, .w3-btn-floating-large.w3-disabled:hover,.w3-btn-floating-large:disabled:hover{box-shadow:none} .w3-btn-group .w3-btn{float:left}.w3-btn-block{width:100%} .w3-btn-bar .w3-btn{box-shadow:none;background-color:inherit;color:inherit;float:left}.w3-btn-bar .w3-btn:hover{background-color:#ccc} .w3-badge,.w3-tag,.w3-sign{background-color:#000;color:#fff;display:inline-block;padding-left:8px;padding-right:8px;text-align:center} .w3-badge{border-radius:50%} ul.w3-ul{list-style-type:none;padding:0;margin:0}ul.w3-ul li{padding:6px 2px 6px 16px;border-bottom:1px solid #ddd}ul.w3-ul li:last-child{border-bottom:none} .w3-tooltip,.w3-display-container{position:relative}.w3-tooltip .w3-text{display:none}.w3-tooltip:hover .w3-text{display:inline-block} .w3-navbar{list-style-type:none;margin:0;padding:0;overflow:hidden} .w3-navbar li{float:left}.w3-navbar li a,.w3-navitem,.w3-navbar li .w3-btn,.w3-navbar li .w3-input{display:block;padding:8px 16px}.w3-navbar li .w3-btn,.w3-navbar li .w3-input{border:none;outline:none;width:100%} .w3-navbar li a:hover{color:#000;background-color:#ccc} .w3-navbar .w3-dropdown-hover,.w3-navbar .w3-dropdown-click{position:static} .w3-navbar .w3-dropdown-hover:hover,.w3-navbar .w3-dropdown-hover:first-child,.w3-navbar .w3-dropdown-click:hover{background-color:#ccc;color:#000} .w3-navbar a,.w3-topnav a,.w3-sidenav a,.w3-dropdown-content a,.w3-accordion-content a,.w3-dropnav a,.w3-navblock a{text-decoration:none!important} .w3-navbar .w3-opennav.w3-right{float:right!important}.w3-topnav{padding:8px 8px} .w3-navblock .w3-dropdown-hover:hover,.w3-navblock .w3-dropdown-hover:first-child,.w3-navblock .w3-dropdown-click:hover{background-color:#ccc;color:#000} .w3-navblock .w3-dropdown-hover,.w3-navblock .w3-dropdown-click{width:100%}.w3-navblock .w3-dropdown-hover .w3-dropdown-content,.w3-navblock .w3-dropdown-click .w3-dropdown-content{min-width:100%} .w3-topnav a{padding:0 8px;border-bottom:3px solid transparent;-webkit-transition:border-bottom .25s;transition:border-bottom .25s} .w3-topnav a:hover{border-bottom:3px solid #fff}.w3-topnav .w3-dropdown-hover a{border-bottom:0} .w3-opennav,.w3-closenav{color:inherit}.w3-opennav:hover,.w3-closenav:hover{cursor:pointer;opacity:0.8} .w3-btn,.w3-btn-floating,.w3-dropnav a,.w3-btn-floating-large,.w3-btn-block, .w3-navbar a,.w3-navblock a,.w3-sidenav a,.w3-pagination li a,.w3-hoverable tbody tr,.w3-hoverable li, .w3-accordion-content a,.w3-dropdown-content a,.w3-dropdown-click:hover,.w3-dropdown-hover:hover,.w3-opennav,.w3-closenav,.w3-closebtn,*[class*="w3-hover-"] {-webkit-transition:background-color .25s,color .15s,box-shadow .25s,opacity 0.25s,filter 0.25s,border 0.15s;transition:background-color .25s,color .15s,box-shadow .15s,opacity .25s,filter .25s,border .15s} .w3-ripple:active{opacity:0.5}.w3-ripple{-webkit-transition:opacity 0s;transition:opacity 0s} .w3-sidenav,.w3-sidebar{height:100%;width:200px;background-color:#fff;position:fixed!important;z-index:1;overflow:auto} .w3-sidenav a,.w3-navblock a{padding:4px 2px 4px 16px}.w3-sidenav a:hover,.w3-navblock a:hover{background-color:#ccc;color:#000}.w3-sidenav a,.w3-dropnav a,.w3-navblock a{display:block} .w3-sidenav .w3-dropdown-hover:hover,.w3-sidenav .w3-dropdown-hover:first-child,.w3-sidenav .w3-dropdown-click:hover,.w3-dropnav a:hover{background-color:#ccc;color:#000} .w3-sidenav .w3-dropdown-hover,.w3-sidenav .w3-dropdown-click,.w3-bar-block .w3-dropdown-hover,.w3-bar-block .w3-dropdown-click{width:100%} .w3-sidenav .w3-dropdown-hover .w3-dropdown-content,.w3-sidenav .w3-dropdown-click .w3-dropdown-content,.w3-bar-block .w3-dropdown-hover .w3-dropdown-content,.w3-bar-block .w3-dropdown-click .w3-dropdown-content{min-width:100%} .w3-bar-block .w3-dropdown-hover .w3-button,.w3-bar-block .w3-dropdown-click .w3-button{width:100%;text-align:left;background-color:inherit;color:inherit;padding:6px 2px 6px 16px} .w3-main,#main{transition:margin-left .4s} .w3-modal{z-index:3;display:none;padding-top:100px;position:fixed;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgb(0,0,0);background-color:rgba(0,0,0,0.4)} .w3-modal-content{margin:auto;background-color:#fff;position:relative;padding:0;outline:0;width:600px}.w3-closebtn{text-decoration:none;float:right;font-size:24px;font-weight:bold;color:inherit} .w3-closebtn:hover,.w3-closebtn:focus{color:#000;text-decoration:none;cursor:pointer} .w3-pagination{display:inline-block;padding:0;margin:0}.w3-pagination li{display:inline} .w3-pagination li a{text-decoration:none;color:#000;float:left;padding:8px 16px} .w3-pagination li a:hover{background-color:#ccc} .w3-input-group,.w3-group{margin-top:24px;margin-bottom:24px} .w3-input{padding:8px;display:block;border:none;border-bottom:1px solid #808080;width:100%} .w3-label{color:#009688}.w3-input:not(:valid)~.w3-validate{color:#f44336} .w3-select{padding:9px 0;width:100%;color:#000;border:1px solid transparent;border-bottom:1px solid #009688} .w3-select select:focus{color:#000;border:1px solid #009688}.w3-select option[disabled]{color:#009688} .w3-dropdown-click,.w3-dropdown-hover{position:relative;display:inline-block;cursor:pointer} .w3-dropdown-hover:hover .w3-dropdown-content{display:block;z-index:1} .w3-dropdown-hover:first-child,.w3-dropdown-click:hover{background-color:#ccc;color:#000} .w3-dropdown-hover:hover .w3-button,.w3-dropdown-click:hover .w3-button{background-color:#ccc;color:#000} .w3-dropdown-content{cursor:auto;color:#000;background-color:#fff;display:none;position:absolute;min-width:160px;margin:0;padding:0} .w3-dropdown-content a{padding:6px 16px;display:block} .w3-dropdown-content a:hover{background-color:#ccc} .w3-accordion{width:100%;cursor:pointer} .w3-accordion-content{cursor:auto;display:none;position:relative;width:100%;margin:0;padding:0} .w3-accordion-content a{padding:6px 16px;display:block}.w3-accordion-content a:hover{background-color:#ccc} .w3-progress-container{width:100%;height:1.5em;position:relative;background-color:#f1f1f1} .w3-progressbar{background-color:#757575;height:100%;position:absolute;line-height:inherit} input[type=checkbox].w3-check,input[type=radio].w3-radio{width:24px;height:24px;position:relative;top:6px} input[type=checkbox].w3-check:checked+.w3-validate,input[type=radio].w3-radio:checked+.w3-validate{color:#009688} input[type=checkbox].w3-check:disabled+.w3-validate,input[type=radio].w3-radio:disabled+.w3-validate{color:#aaa} .w3-bar{width:100%;overflow:hidden}.w3-center .w3-bar{display:inline-block;width:auto} .w3-bar .w3-bar-item{padding:8px 16px;float:left;background-color:inherit;color:inherit;width:auto;border:none;outline:none;display:block} .w3-bar .w3-dropdown-hover,.w3-bar .w3-dropdown-click{position:static;float:left} .w3-bar .w3-button{background-color:inherit;color:inherit;white-space:normal} .w3-bar-block{width:100%} .w3-bar-block .w3-bar-item{width:100%;display:block;padding:6px 2px 6px 16px;text-align:left;background-color:inherit;color:inherit;border:none;outline:none} .w3-block{display:block;width:100%} .w3-responsive{overflow-x:auto} .w3-container:after,.w3-container:before,.w3-panel:after,.w3-panel:before,.w3-row:after,.w3-row:before,.w3-row-padding:after,.w3-row-padding:before,.w3-cell-row:before,.w3-cell-row:after, .w3-topnav:after,.w3-topnav:before,.w3-clear:after,.w3-clear:before,.w3-btn-group:before,.w3-btn-group:after,.w3-btn-bar:before,.w3-btn-bar:after,.w3-bar:before,.w3-bar:after {content:"";display:table;clear:both} .w3-col,.w3-half,.w3-third,.w3-twothird,.w3-threequarter,.w3-quarter{float:left;width:100%} .w3-col.s1{width:8.33333%} .w3-col.s2{width:16.66666%} .w3-col.s3{width:24.99999%} .w3-col.s4{width:33.33333%} .w3-col.s5{width:41.66666%} .w3-col.s6{width:49.99999%} .w3-col.s7{width:58.33333%} .w3-col.s8{width:66.66666%} .w3-col.s9{width:74.99999%} .w3-col.s10{width:83.33333%} .w3-col.s11{width:91.66666%} .w3-col.s12,.w3-half,.w3-third,.w3-twothird,.w3-threequarter,.w3-quarter{width:99.99999%} @media (min-width:601px){ .w3-col.m1{width:8.33333%} .w3-col.m2{width:16.66666%} .w3-col.m3,.w3-quarter{width:24.99999%} .w3-col.m4,.w3-third{width:33.33333%} .w3-col.m5{width:41.66666%} .w3-col.m6,.w3-half{width:49.99999%} .w3-col.m7{width:58.33333%} .w3-col.m8,.w3-twothird{width:66.66666%} .w3-col.m9,.w3-threequarter{width:74.99999%} .w3-col.m10{width:83.33333%} .w3-col.m11{width:91.66666%} .w3-col.m12{width:99.99999%}} @media (min-width:993px){ .w3-col.l1{width:8.33333%} .w3-col.l2{width:16.66666%} .w3-col.l3,.w3-quarter{width:24.99999%} .w3-col.l4,.w3-third{width:33.33333%} .w3-col.l5{width:41.66666%} .w3-col.l6,.w3-half{width:49.99999%} .w3-col.l7{width:58.33333%} .w3-col.l8,.w3-twothird{width:66.66666%} .w3-col.l9,.w3-threequarter{width:74.99999%} .w3-col.l10{width:83.33333%} .w3-col.l11{width:91.66666%} .w3-col.l12{width:99.99999%}} .w3-content{max-width:980px;margin:auto} .w3-rest{overflow:hidden} .w3-layout-container,.w3-cell-row{display:table;width:100%}.w3-layout-row{display:table-row}.w3-layout-cell,.w3-layout-col,.w3-cell{display:table-cell} .w3-layout-top,.w3-cell-top{vertical-align:top}.w3-layout-middle,.w3-cell-middle{vertical-align:middle}.w3-layout-bottom,.w3-cell-bottom{vertical-align:bottom} .w3-hide{display:none!important}.w3-show-block,.w3-show{display:block!important}.w3-show-inline-block{display:inline-block!important} @media (max-width:600px){.w3-modal-content{margin:0 10px;width:auto!important}.w3-modal{padding-top:30px} .w3-topnav a{display:block}.w3-navbar li:not(.w3-opennav){float:none;width:100%!important}.w3-navbar li.w3-right{float:none!important} .w3-topnav .w3-dropdown-hover .w3-dropdown-content,.w3-navbar .w3-dropdown-click .w3-dropdown-content,.w3-navbar .w3-dropdown-hover .w3-dropdown-content,.w3-dropdown-hover.w3-mobile .w3-dropdown-content,.w3-dropdown-click.w3-mobile .w3-dropdown-content{position:relative} .w3-topnav,.w3-navbar{text-align:center}.w3-hide-small{display:none!important}.w3-layout-col,.w3-mobile{display:block;width:100%!important}.w3-bar-item.w3-mobile,.w3-dropdown-hover.w3-mobile,.w3-dropdown-click.w3-mobile{text-align:center} .w3-dropdown-hover.w3-mobile,.w3-dropdown-hover.w3-mobile .w3-btn,.w3-dropdown-hover.w3-mobile .w3-button,.w3-dropdown-click.w3-mobile,.w3-dropdown-click.w3-mobile .w3-btn,.w3-dropdown-click.w3-mobile .w3-button{width:100%}} @media (max-width:768px){.w3-modal-content{width:500px}.w3-modal{padding-top:50px}} @media (min-width:993px){.w3-modal-content{width:900px}.w3-hide-large{display:none!important}.w3-sidenav.w3-collapse,.w3-sidebar.w3-collapse{display:block!important}} @media (max-width:992px) and (min-width:601px){.w3-hide-medium{display:none!important}} @media (max-width:992px){.w3-sidenav.w3-collapse,.w3-sidebar.w3-collapse{display:none}.w3-main{margin-left:0!important;margin-right:0!important}} .w3-top,.w3-bottom{position:fixed;width:100%;z-index:1}.w3-top{top:0}.w3-bottom{bottom:0} .w3-overlay{position:fixed;display:none;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,0.5);z-index:2} .w3-left{float:left!important}.w3-right{float:right!important} .w3-tiny{font-size:10px!important}.w3-small{font-size:12px!important} .w3-medium{font-size:15px!important}.w3-large{font-size:18px!important} .w3-xlarge{font-size:24px!important}.w3-xxlarge{font-size:36px!important} .w3-xxxlarge{font-size:48px!important}.w3-jumbo{font-size:64px!important} .w3-vertical{word-break:break-all;line-height:1;text-align:center;width:0.6em} .w3-left-align{text-align:left!important}.w3-right-align{text-align:right!important} .w3-justify{text-align:justify!important}.w3-center{text-align:center!important} .w3-display-topleft{position:absolute;left:0;top:0}.w3-display-topright{position:absolute;right:0;top:0} .w3-display-bottomleft{position:absolute;left:0;bottom:0}.w3-display-bottomright{position:absolute;right:0;bottom:0} .w3-display-middle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%)} .w3-display-left{position:absolute;top:50%;left:0%;transform:translate(0%,-50%);-ms-transform:translate(-0%,-50%)} .w3-display-right{position:absolute;top:50%;right:0%;transform:translate(0%,-50%);-ms-transform:translate(0%,-50%)} .w3-display-topmiddle{position:absolute;left:50%;top:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)} .w3-display-bottommiddle{position:absolute;left:50%;bottom:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)} .w3-display-container:hover .w3-display-hover{display:block}.w3-display-container:hover span.w3-display-hover{display:inline-block}.w3-display-hover{display:none} .w3-circle{border-radius:50%!important} .w3-round-small{border-radius:2px!important}.w3-round,.w3-round-medium{border-radius:4px!important} .w3-round-large{border-radius:8px!important}.w3-round-xlarge{border-radius:16px!important} .w3-round-xxlarge{border-radius:32px!important}.w3-round-jumbo{border-radius:64px!important} .w3-border-0{border:0!important}.w3-border{border:1px solid #ccc!important} .w3-border-top{border-top:1px solid #ccc!important}.w3-border-bottom{border-bottom:1px solid #ccc!important} .w3-border-left{border-left:1px solid #ccc!important}.w3-border-right{border-right:1px solid #ccc!important} .w3-margin{margin:16px!important}.w3-margin-0{margin:0!important} .w3-margin-top{margin-top:16px!important}.w3-margin-bottom{margin-bottom:16px!important} .w3-margin-left{margin-left:16px!important}.w3-margin-right{margin-right:16px!important} .w3-section{margin-top:16px!important;margin-bottom:16px!important} .w3-padding-tiny{padding:2px 4px!important}.w3-padding-small{padding:4px 8px!important} .w3-padding-medium,.w3-padding,.w3-form{padding:8px 16px!important} .w3-padding-large{padding:12px 24px!important}.w3-padding-xlarge{padding:16px 32px!important} .w3-padding-xxlarge{padding:24px 48px!important}.w3-padding-jumbo{padding:32px 64px!important} .w3-padding-4{padding-top:4px!important;padding-bottom:4px!important} .w3-padding-8{padding-top:8px!important;padding-bottom:8px!important} .w3-padding-12{padding-top:12px!important;padding-bottom:12px!important} .w3-padding-16{padding-top:16px!important;padding-bottom:16px!important} .w3-padding-24{padding-top:24px!important;padding-bottom:24px!important} .w3-padding-32{padding-top:32px!important;padding-bottom:32px!important} .w3-padding-48{padding-top:48px!important;padding-bottom:48px!important} .w3-padding-64{padding-top:64px!important;padding-bottom:64px!important} .w3-padding-100{padding-top:100px!important;/*padding-bottom:128px!important*/} .w3-padding-128{padding-top:128px!important;/*padding-bottom:128px!important*/} .w3-padding-0{padding:0!important} .w3-padding-top{padding-top:8px!important}.w3-padding-bottom{padding-bottom:8px!important} .w3-padding-left{padding-left:16px!important}.w3-padding-right{padding-right:16px!important} .w3-topbar{border-top:6px solid #ccc!important}.w3-bottombar{border-bottom:6px solid #ccc!important} .w3-leftbar{border-left:6px solid #ccc!important}.w3-rightbar{border-right:6px solid #ccc!important} .w3-row-padding,.w3-row-padding>.w3-half,.w3-row-padding>.w3-third,.w3-row-padding>.w3-twothird,.w3-row-padding>.w3-threequarter,.w3-row-padding>.w3-quarter,.w3-row-padding>.w3-col{padding:0 8px} .w3-spin{animation:w3-spin 2s infinite linear;-webkit-animation:w3-spin 2s infinite linear} @-webkit-keyframes w3-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}} @keyframes w3-spin{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}} .w3-container{padding:0.01em 16px} .w3-panel{padding:0.01em 16px;margin-top:16px!important;margin-bottom:16px!important} .w3-example{background-color:#f1f1f1;padding:0.01em 16px} .w3-code,.w3-codespan{font-family:Consolas,"courier new";font-size:16px} .w3-code{line-height:1.4;width:auto;background-color:#fff;padding:8px 12px;border-left:4px solid #4CAF50;word-wrap:break-word} .w3-codespan{color:crimson;background-color:#f1f1f1;padding-left:4px;padding-right:4px;font-size:110%} .w3-example,.w3-code{margin:20px 0}.w3-card{border:1px solid #ccc} .w3-card-2,.w3-example{box-shadow:0 2px 4px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)!important} .w3-card-4,.w3-hover-shadow:hover{box-shadow:0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)!important} .w3-card-8{box-shadow:0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)!important} .w3-card-12{box-shadow:0 12px 16px 0 rgba(0,0,0,0.24),0 17px 50px 0 rgba(0,0,0,0.19)!important} .w3-card-16{box-shadow:0 16px 24px 0 rgba(0,0,0,0.22),0 25px 55px 0 rgba(0,0,0,0.21)!important} .w3-card-24{box-shadow:0 24px 24px 0 rgba(0,0,0,0.2),0 40px 77px 0 rgba(0,0,0,0.22)!important} .w3-animate-fading{-webkit-animation:fading 10s infinite;animation:fading 10s infinite} @-webkit-keyframes fading{0%{opacity:0}50%{opacity:1}100%{opacity:0}} @keyframes fading{0%{opacity:0}50%{opacity:1}100%{opacity:0}} .w3-animate-opacity{-webkit-animation:opac 0.8s;animation:opac 0.8s} @-webkit-keyframes opac{from{opacity:0} to{opacity:1}} @keyframes opac{from{opacity:0} to{opacity:1}} .w3-animate-top{position:relative;-webkit-animation:animatetop 0.4s;animation:animatetop 0.4s} @-webkit-keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}} @keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}} .w3-animate-left{position:relative;-webkit-animation:animateleft 0.4s;animation:animateleft 0.4s} @-webkit-keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}} @keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}} .w3-animate-right{position:relative;-webkit-animation:animateright 0.4s;animation:animateright 0.4s} @-webkit-keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}} @keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}} .w3-animate-bottom{position:relative;-webkit-animation:animatebottom 0.4s;animation:animatebottom 0.4s} @-webkit-keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0px;opacity:1}} @keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0;opacity:1}} .w3-animate-zoom {-webkit-animation:animatezoom 0.6s;animation:animatezoom 0.6s} @-webkit-keyframes animatezoom{from{-webkit-transform:scale(0)} to{-webkit-transform:scale(1)}} @keyframes animatezoom{from{transform:scale(0)} to{transform:scale(1)}} .w3-animate-input{-webkit-transition:width 0.4s ease-in-out;transition:width 0.4s ease-in-out}.w3-animate-input:focus{width:100%!important} .w3-opacity,.w3-hover-opacity:hover{opacity:0.60;-webkit-backface-visibility:hidden} .w3-opacity-off,.w3-hover-opacity-off:hover{opacity:1;-webkit-backface-visibility:hidden} .w3-opacity-max{opacity:0.25;-webkit-backface-visibility:hidden} .w3-opacity-min{opacity:0.75;-webkit-backface-visibility:hidden} .w3-greyscale-max,.w3-grayscale-max,.w3-hover-greyscale:hover,.w3-hover-grayscale:hover{-webkit-filter:grayscale(100%);filter:grayscale(100%)} .w3-greyscale,.w3-grayscale{-webkit-filter:grayscale(75%);filter:grayscale(75%)} .w3-greyscale-min,.w3-grayscale-min{-webkit-filter:grayscale(50%);filter:grayscale(50%)} .w3-sepia{-webkit-filter:sepia(75%);filter:sepia(75%)} .w3-sepia-max,.w3-hover-sepia:hover{-webkit-filter:sepia(100%);filter:sepia(100%)} .w3-sepia-min{-webkit-filter:sepia(50%);filter:sepia(50%)} .w3-text-shadow{text-shadow:1px 1px 0 #444}.w3-text-shadow-white{text-shadow:1px 1px 0 #ddd} .w3-transparent{background-color:transparent!important} .w3-hover-none:hover{box-shadow:none!important;background-color:transparent!important} /* Colors */ .w3-amber,.w3-hover-amber:hover{color:#000!important;background-color:#ffc107!important} .w3-aqua,.w3-hover-aqua:hover{color:#000!important;background-color:#00ffff!important} .w3-blue,.w3-hover-blue:hover{color:#fff!important;background-color:#2196F3!important} .w3-light-blue,.w3-hover-light-blue:hover{color:#000!important;background-color:#87CEEB!important} .w3-brown,.w3-hover-brown:hover{color:#fff!important;background-color:#795548!important} .w3-cyan,.w3-hover-cyan:hover{color:#000!important;background-color:#00bcd4!important} .w3-blue-grey,.w3-hover-blue-grey:hover,.w3-blue-gray,.w3-hover-blue-gray:hover{color:#fff!important;background-color:#607d8b!important} .w3-green,.w3-hover-green:hover{color:#fff!important;background-color:#4CAF50!important} .w3-light-green,.w3-hover-light-green:hover{color:#000!important;background-color:#8bc34a!important} .w3-indigo,.w3-hover-indigo:hover{color:#fff!important;background-color:#3f51b5!important} .w3-khaki,.w3-hover-khaki:hover{color:#000!important;background-color:#f0e68c!important} .w3-lime,.w3-hover-lime:hover{color:#000!important;background-color:#cddc39!important} .w3-orange,.w3-hover-orange:hover{color:#000!important;background-color:#ff9800!important} .w3-deep-orange,.w3-hover-deep-orange:hover{color:#fff!important;background-color:#ff5722!important} .w3-pink,.w3-hover-pink:hover{color:#fff!important;background-color:#e91e63!important} .w3-purple,.w3-hover-purple:hover{color:#fff!important;background-color:#9c27b0!important} .w3-deep-purple,.w3-hover-deep-purple:hover{color:#fff!important;background-color:#673ab7!important} .w3-red,.w3-hover-red:hover{color:#fff!important;background-color:#f44336!important} .w3-sand,.w3-hover-sand:hover{color:#000!important;background-color:#fdf5e6!important} .w3-teal,.w3-hover-teal:hover{color:#fff!important;background-color:#009688!important} .w3-yellow,.w3-hover-yellow:hover{color:#000!important;background-color:#ffeb3b!important} .w3-white,.w3-hover-white:hover{color:#000!important;background-color:#fff!important} .w3-black,.w3-hover-black:hover{color:#fff!important;background-color:#000!important} .w3-grey,.w3-hover-grey:hover,.w3-gray,.w3-hover-gray:hover{color:#000!important;background-color:#9e9e9e!important} .w3-light-grey,.w3-hover-light-grey:hover,.w3-light-gray,.w3-hover-light-gray:hover{color:#000!important;background-color:#f1f1f1!important} .w3-dark-grey,.w3-hover-dark-grey:hover,.w3-dark-gray,.w3-hover-dark-gray:hover{color:#fff!important;background-color:#616161!important} .w3-pale-red,.w3-hover-pale-red:hover{color:#000!important;background-color:#ffdddd!important} .w3-pale-green,.w3-hover-pale-green:hover{color:#000!important;background-color:#ddffdd!important} .w3-pale-yellow,.w3-hover-pale-yellow:hover{color:#000!important;background-color:#ffffcc!important} .w3-pale-blue,.w3-hover-pale-blue:hover{color:#000!important;background-color:#ddffff!important} .w3-text-amber,.w3-hover-text-amber:hover{color:#ffc107!important} .w3-text-aqua,.w3-hover-text-aqua:hover{color:#00ffff!important} .w3-text-blue,.w3-hover-text-blue:hover{color:#2196F3!important} .w3-text-light-blue,.w3-hover-text-light-blue:hover{color:#87CEEB!important} .w3-text-brown,.w3-hover-text-brown:hover{color:#795548!important} .w3-text-cyan,.w3-hover-text-cyan:hover{color:#00bcd4!important} .w3-text-blue-grey,.w3-hover-text-blue-grey:hover,.w3-text-blue-gray,.w3-hover-text-blue-gray:hover{color:#607d8b!important} .w3-text-green,.w3-hover-text-green:hover{color:#4CAF50!important} .w3-text-light-green,.w3-hover-text-light-green:hover{color:#8bc34a!important} .w3-text-indigo,.w3-hover-text-indigo:hover{color:#3f51b5!important} .w3-text-khaki,.w3-hover-text-khaki:hover{color:#b4aa50!important} .w3-text-lime,.w3-hover-text-lime:hover{color:#cddc39!important} .w3-text-orange,.w3-hover-text-orange:hover{color:#ff9800!important} .w3-text-deep-orange,.w3-hover-text-deep-orange:hover{color:#ff5722!important} .w3-text-pink,.w3-hover-text-pink:hover{color:#e91e63!important} .w3-text-purple,.w3-hover-text-purple:hover{color:#9c27b0!important} .w3-text-deep-purple,.w3-hover-text-deep-purple:hover{color:#673ab7!important} .w3-text-red,.w3-hover-text-red:hover{color:#f44336!important} .w3-text-sand,.w3-hover-text-sand:hover{color:#fdf5e6!important} .w3-text-teal,.w3-hover-text-teal:hover{color:#009688!important} .w3-text-yellow,.w3-hover-text-yellow:hover{color:#d2be0e!important} .w3-text-white,.w3-hover-text-white:hover{color:#fff!important} .w3-text-black,.w3-hover-text-black:hover{color:#000!important} .w3-text-grey,.w3-hover-text-grey:hover,.w3-text-gray,.w3-hover-text-gray:hover{color:#757575!important} .w3-text-light-grey,.w3-hover-text-light-grey:hover,.w3-text-light-gray,.w3-hover-text-light-gray:hover{color:#f1f1f1!important} .w3-text-dark-grey,.w3-hover-text-dark-grey:hover,.w3-text-dark-gray,.w3-hover-text-dark-gray:hover{color:#3a3a3a!important} .w3-border-amber,.w3-hover-border-amber:hover{border-color:#ffc107!important} .w3-border-aqua,.w3-hover-border-aqua:hover{border-color:#00ffff!important} .w3-border-blue,.w3-hover-border-blue:hover{border-color:#2196F3!important} .w3-border-light-blue,.w3-hover-border-light-blue:hover{border-color:#87CEEB!important} .w3-border-brown,.w3-hover-border-brown:hover{border-color:#795548!important} .w3-border-cyan,.w3-hover-border-cyan:hover{border-color:#00bcd4!important} .w3-border-blue-grey,.w3-hover-border-blue-grey:hover,.w3-border-blue-gray,.w3-hover-border-blue-gray:hover{border-color:#607d8b!important} .w3-border-green,.w3-hover-border-green:hover{border-color:#4CAF50!important} .w3-border-light-green,.w3-hover-border-light-green:hover{border-color:#8bc34a!important} .w3-border-indigo,.w3-hover-border-indigo:hover{border-color:#3f51b5!important} .w3-border-khaki,.w3-hover-border-khaki:hover{border-color:#f0e68c!important} .w3-border-lime,.w3-hover-border-lime:hover{border-color:#cddc39!important} .w3-border-orange,.w3-hover-border-orange:hover{border-color:#ff9800!important} .w3-border-deep-orange,.w3-hover-border-deep-orange:hover{border-color:#ff5722!important} .w3-border-pink,.w3-hover-border-pink:hover{border-color:#e91e63!important} .w3-border-purple,.w3-hover-border-purple:hover{border-color:#9c27b0!important} .w3-border-deep-purple,.w3-hover-border-deep-purple:hover{border-color:#673ab7!important} .w3-border-red,.w3-hover-border-red:hover{border-color:#f44336!important} .w3-border-sand,.w3-hover-border-sand:hover{border-color:#fdf5e6!important} .w3-border-teal,.w3-hover-border-teal:hover{border-color:#009688!important} .w3-border-yellow,.w3-hover-border-yellow:hover{border-color:#ffeb3b!important} .w3-border-white,.w3-hover-border-white:hover{border-color:#fff!important} .w3-border-black,.w3-hover-border-black:hover{border-color:#000!important} .w3-border-grey,.w3-hover-border-grey:hover,.w3-border-gray,.w3-hover-border-gray:hover{border-color:#9e9e9e!important} .w3-border-light-grey,.w3-hover-border-light-grey:hover,.w3-border-light-gray,.w3-hover-border-light-gray:hover{border-color:#f1f1f1!important} .w3-border-dark-grey,.w3-hover-border-dark-grey:hover,.w3-border-dark-gray,.w3-hover-border-dark-gray:hover{border-color:#616161!important} .w3-border-pale-red,.w3-hover-border-pale-red:hover{border-color:#ffe7e7!important}.w3-border-pale-green,.w3-hover-border-pale-green:hover{border-color:#e7ffe7!important} .w3-border-pale-yellow,.w3-hover-border-pale-yellow:hover{border-color:#ffffcc!important}.w3-border-pale-blue,.w3-hover-border-pale-blue:hover{border-color:#e7ffff!important} .w3-theme-l7 {color:#000 !important; background-color:#A5ACBC !important} .w3-theme-l6 {color:#000 !important; background-color:#8C8C8C !important} .w3-theme-l5 {color:#000 !important; background-color:#f0f0f0 !important} .w3-theme-l4 {color:#000 !important; background-color:#cccccc !important} .w3-theme-l3 {color:#fff !important; background-color:#999999 !important} .w3-theme-l2 {color:#fff !important; background-color:#666666 !important} .w3-theme-l1 {color:#fff !important; background-color:#333333 !important} .w3-theme-d1 {color:#fff !important; background-color:#000000 !important} .w3-theme-d2 {color:#fff !important; background-color:#000000 !important} .w3-theme-d3 {color:#fff !important; background-color:#000000 !important} .w3-theme-d4 {color:#fff !important; background-color:#000000 !important} .w3-theme-d5 {color:#fff !important; background-color:#000000 !important} .w3-theme-d6 {color:#000 !important; background-color:#A5ACBC !important} .w3-theme-grey {color:#000 !important; background-color:#A5ACBC !important} .w3-theme-light {color:#000 !important; background-color:#f0f0f0 !important} .w3-theme-dark {color:#fff !important; background-color:#000000 !important} .w3-theme-action {color:#fff !important; background-color:#000000 !important} .w3-theme {color:#fff !important; background-color:#000000 !important} .w3-text-theme {color:#000000 !important} .w3-border-theme {border-color:#000000 !important} .w3-hover-theme:hover {color:#000 !important; background-color:#ffc107 !important} .w3-hover-text-theme:hover {color:#000000 !important} .w3-hover-border-theme:hover {border-color:#000000 !important} html { } .w3-main { margin-left: 210px; } .w3-bar { background-color: #363C3A; padding-bottom: 0.3em;} #mySidenav { z-index: 3; width: 210px; margin-top: 70px; border-right: 0.0em solid #ddd; color: black; } .w3-sidenav a, .w3-navblock a { padding: 1px 2px 1px 8px; } .floatLeft { float: left; } .floatRight { float: right; } .clearFloat { clear: both; } html,body,h1,h2,h3,h4,h5,h6 { } .holder { list-style: none; } ul.ulone { margin: 0em 0em 0em 1em; padding: 0em; } li.lione { margin: 0em; padding: 0em 0.8em 0em 0em; line-height: 1.8em; text-indent: -0.5em; font-style: italic; font-family: Helvetica, sans-serif; } li.litwo { margin: 0em; padding: 0em 0.8em 0em 0em; line-height: 1.8em; text-indent: -0.5em; font-style: italic; font-family: Helvetica, sans-serif; text-decoration: none; } li.lithree { margin: 0em; padding: 0em 0.8em 0em 0em; line-height: 1.8em; text-indent: -0.5em; font-style: italic; font-family: Helvetica, sans-serif; list-style: none; } .image { width: 100%; } .image50pc { width: 50%; } .maxwidth10em { max-width: 10em; border-radius: 50%; } .maximagewidth10em { max-width: 10em; } .maximageheight4em { max-height: 4em; } .maximageheight5em { max-height: 5em; } .rangesMenuImages { max-width: 16em; padding: 0.5em 0.5em 0.5em 0.5em; } .hr { width: 90%; } .redHR { color: #ff0000; width: 90%; margin: 0.5em 0em 0.2em 0em; padding: 0em 0em 0.2em 0em; } hr.pricesHR { width: 90%; margin: 0.5em 0em 0.2em 0em; padding: 0em 0em 0.2em 0em; } .blueText { color: blue; } .redText { color: red; } .darkpurpleText { color: #540857; } .greenText { color: green; } .greyText { color: #696969; } .lightGrey { color: #D0D0D0; } .whiteText { color: white; } .blackText { color: black; } .orangeText { color: orange; } .goldText { color: #7e5109; } .color-a04 { color: #a04; } .color-990000 { color: #990000; } .color-bbbbbb { color: #bbbbbb; } .color-ddd { color: #ddd; } .color-ff0 { color: #ff0; } .color-145f9c { color: #145f9c; } .color-000033 { color: #000033; } .color-cccccc { color: #CCCCCC; } .color-c6c4c4 { color: #c6c4c4; } .color-ffffff { color: #ffffff; } .color-D97B09 { color: #D97B09; } .color-FF4040 { color: #FF4040; } .centerText { text-align: center; } .leftText { text-align: left; } .rightText { text-align: right; } .justifyText { text-align: justify; } .bold { font-weight: bold; } .underlined { text-decoration: underline; } .notunderlined { text-decoration: none; } .textdecorationnone { text-decoration: none; } .margin0auto { margin: 0 auto; } .margin20px { margin: 20px; } .margin30px { margin: 30px; } .margin2pc0pc2pc0pc { margin: 2% 0 2% 0; } .margin2em0em1em0em { margin: 2em 0em 1em 0em; } .margintop1em { margin-top: 1em; } .margin-5px0px0px10px { margin: -5px 0px 0px 10px; } .padding0em { padding: 0em; } .padding0-3125em { padding: 0.3125em; } .margin0em { margin: 0em; } .padding0pc0pc2pc0pc { padding: 0 0 2% 0; } .padding0pc8pc0pc8pc { padding: 0em 8% 0em 8%; } .padding2pc0pc { padding: 2% 0 2% 0; } .padding1em { padding: 1em; } .padding2em { padding: 2em; } .padding2px { padding: 2px; } .padding3px { padding: 3px; } .padding1em2em { padding: 1em 2em; } .padding3px5px { padding: 3px 5px; } .padding20px { padding: 20px; } .padding0em05em1em05em { padding: 0em 0.5em 1em 0.5em; } .padding0em0-5em2em0-5em { padding: 0em 0.5em 2em 0.5em; } .padding0px8px18px8px { padding: 0px 8px 18px 8px; } .padding1em2em0em2em { padding: 1em 2em 0em 2em; } .padding1em0em1em0em { padding: 1em 0 1em 0; } .padding02em { padding: 0.2em; } .padding05em { padding: 0.5em; } .paddingL0em { padding-left: 0em; } .paddingL1em { padding-left: 1em; } .paddingR1em { padding-right: 1em; } .paddingleft25px { padding-left: 25px; } .paddingR5px { padding-right: 5px; } .paddingR8px { padding-right: 8px; } .paddingL1_5em { padding-left: 1.5em; } .paddingL6px { padding-left: 6px; } .paddingL250px { padding-left: 250px; } .paddingR0em { padding-right: 0em; } .paddingr05em { padding-right: 0.5em; } .paddingr08em { padding-right: 0.8em; } .paddingR1-8em { padding: 1.8em; } .paddingb2em { padding-bottom: 2em; } .paddingb05em { padding-bottom: 0.5em; } .paddingb5px { padding-bottom: 5px; } .paddingbottom30px { padding-bottom: 30px; } .lrpadding05em { padding: 0em 0.5em 0em 0.5em; } .lrpadding1em { padding: 0.5em 2em 0.5em 2em; } .paddingLR1em { padding: 0em 1em 0em 1em; } .paddingtop-1em { padding-top: 1em; } .padding0em1em1em1em { padding: 0em 1em 1em 1em; } .size1em { font-size: 1em; } .size1-2em { font-size: 1.2em; } .size2em { font-size: 2em; } .fontsize05em { font-size: 0.5em; } .fontsize06em { font-size: 0.6em; } .fontsize0-75em { font-size: 0.75em; } .fontsize08em { font-size: 0.8em; } .fontsize09em { font-size: 0.9em; } .fontsize1-1em { font-size: 1.1em; } .fontsize1-2em { font-size: 1.2em; } .fontsize1-3em { font-size: 1.3em; } .fontsize1-4em { font-size: 1.4em; } .fontsize1-5em { font-size: 1.5em; } .fontsize1-6em { font-size: 1.6em } .fontsize-1em { font-size: 1em; } .fontsize2em { font-size: 2em } .fontsize10px { font-size: 10px; } .fontsize36px { font-size:36px; } /* h1 */ .fontsize30px { font-size:30px; } /* h2 */ .fontsize24px { font-size:24px; } /* h3 */ .fontsize20px { font-size:20px; } /* h4 */ .fontsize18px { font-size:18px; } /* h5 */ .fontsize16px { font-size:16px; } /* h6 */ .fontsize7pt { font-size: 7pt; } .fontsize8pt { font-size: 8pt; } .fontsize9pt { font-size: 9pt; } .fontsize15pt { font-size: 15pt; } .fontsize18pt { font-size: 18pt; } .fontsize20pt { font-size: 20pt; } .lineheight05em { line-height: 0.5em; } .lineheight08em { line-height: 0.8em; } .lineheight1-2em { line-height: 1.2em; } .lineheight1-3em { line-height: 1.3em; } .lineheight1-5em { line-height: 1.5em; } .lineheight1-7em { line-height: 1.7em; } .lineheight0-05em { line-height: 0.05em; } .lineheight1em { line-height: 1em; } .lineheight2em { line-height: 2em; } .lineheight25px { line-height: 25px; } .display-inline-block { display: inline-block; } .display-none { display: none; } .floatLeftTiles { /*float: left;*/ display: inline-block; width: 9em; height: 11em; text-align: center; vertical-align: top; margin: 0.5em; } .floatLeftDoubleTileWidth { /*float: left;*/ display: inline-block; width: 18em; height: 11em; text-align: center; vertical-align: top; margin: 0.5em; } br.toppadding { line-height: 1.5em; } #myFooter { position:fixed; bottom:0px; width:100%; font-size: 0.7em; } .footerFloatLeftC { display: inline-block; padding: 0em 1em 0em 1em; } .footerFloatLeftMedia { display: inline-block; width: 3.5em; } .footerFloatLeftP { display: inline-block; width: 15em; } .footerFloatLeftP a { text-decoration: none; } .footerhosttext { text-align: center; border: 0px dashed #000; color: #000; text-decoration: none; } .copyright { text-align: center; border: 0px dashed #000; } .bordercolordarkblue { border-color: darkblue; } .borderradius0-938em { border-radius: 0.938em; } .colordarkblue { color: darkblue; } .loginFields { width: 9.75em; } .rightSideContent { max-width: 20em; text-align: center; /*background-color: #3c79e8;*/ } .cursor-pointer { cursor:pointer; } .siteTitle { text-align: center; line-height: 1.3em; padding-top: 3px; font-size: 1.3em; } .slogan { float: right; text-align: center; padding-right: 0.5em; padding-top: 0.5em; } .topLogo { float: left; padding-left: 0em; margin: 0px; } .topLogo a { margin: 0px; padding: 0px; text-decoration: none; } .w3-bar a { /*padding-top: 0px;*/ } #myOverlay { cursor:pointer; } .htmlBottom { height: 2em; /*padding: 5% 2% 5% 2%;*/ } .adsbygoogle { display:block } .twitter { width: 5px; height: 17px; } .facebook { width: 5px; height: 17px; } .width30pc { width: 30%; } .width50pc { width: 50%; } .width100pc { width: 100%; } .width1em { width: 1em; } .width4em { width: 4em; } .width8em { width: 8em; } .width9em { width: 9em; } .width9-5em { width: 9.5em; } .width14em { width: 14em; } .width15em { width: 15em; } .width16em { width: 16em; } .width18em { width: 18em; } .width20em { width: 20em; } .width27em { width: 27em; } .width1px { width: 1px; } .width20px { width: 20px; } .width50px { width: 50px; } .width90px { width: 90px; } .width120px { width: 120px; } .width150px { width: 150px; } .width170px { width: 170px; } .width200px { width: 200px; } .width250px { width: 250px; } .width300px { width: 300px; } .width410px { width: 410px; } .width500px { width: 500px; } .min-width125px { min-width: 125px; } .min-width220px { min-width: 220px; } .min-width330px { min-width: 330px; } .maxwidth250px { max-width: 250px; } .maxwidth350px { max-width: 350px; } .maxwidth550px { max-width: 550px; } .bgcolor-lightblue { background-color: lightblue; } .bgcolor-D0C3BF { background-color: #D0C3BF; } .bgcolor-0066FF { background-color: #0066FF; } .bgcolor-0099FF { background-color: #0099FF; } .bgcolor-2B5095 { background-color: #2B5095; } .bgcolor-799BD9 { background-color: #799BD9; } .bgcolor-F0E68C { background-color: #F0E68C; } .bgcolordarkblue { background-color: darkblue; } .bgcolorgrey { background-color: grey; } .nowrap { white-space: nowrap; } .mySlides { display: none; } .bordernone { border:none; } .border0px { border: 0px; } .border1pxsolid-eee { border: 1px solid #eee; } .border0pxsolid-DDD { border: 0px solid #DDD; } .border01emsolid-DDD { border:0.1em solid #DDD; } .error404page { margin: 20px 30px 0px 30px; border: 0px dashed #000; font-size: 12pt; padding: 0 40px 0 40px; } a:link, a:active, a:visited { } a:hover { text-decoration: none; } #navigation a:link, #navigation a:active, #navigation a:visited { text-decoration: none; } ul{ list-style: none; } /*--- Home page links --- */ .website { padding: 0px 5px 5px 0px; border-bottom: 1px solid #125892; font-size: 11px; word-wrap: break-word; } .websiteDescription { margin: 5px; } .mainDesc { font-size: 1.5em; } .mainInfo { font-size: 1.5em; } .mainAdvert { font-size: 1.5em; } .viewsCounter { font-size: 0.7em; } .postedBy { font-size: 0.7em; } .source { font-size: 0.7em; } .commentLink { font-size: 0.7em; } .error{ color: #ff3; font-size: 1.1em; } .error2{ color: #e5a; font-size: 1.3em; } .errorLogin{ font-weight: bold; color: #e5a; font-size: 11px; } .success { color: green; font-size: 1.2em; } .sessionMessage { padding: 5px 5px 45px 0; } .black_overlay{display: none; position: absolute; top: 0%; left: 0%; width: 100%; height: 100%; background-color: black; z-index:1001; opacity:.80; } .white_content {display: none; position: absolute; top: 70px; left: 80px; width: 330px; height: 380px; padding: 6px; border: 6px solid blue; background-color: #D2B48C; z-index:1002; overflow: auto;} .verticalBottom { vertical-align: baseline; } .w3-bar .w3-button { color: white; } .myButton { border: 0.0em solid #FFFFFF; background-color: #F7941D; font-family: Arial; color: #363C3A; font-weight: bold; border-radius: 18px; cursor: pointer; padding: 0.3em; white-space: nowrap; } form { width: 100%; margin: 0 auto; padding: 1em 1em 1em 1em; background-color: #363C3A; color: white; border-radius: 18px; } form input.field { float: left; width: 93%; height: 2em; border: 0.02em solid #000; line-height: 1.7em; font-size: 0.9em; padding: 0.2em; } form input.answer { float: left; width: 15%; height: 2em; border: 0.01em solid #000; line-height: 1.7em; font-size: 0.9em; padding: 0.2em; } form input.submit { float: left; /* width: 50%; border: 0.01em solid #000; line-height: 1.8em; font-size: 0.9em;*/ } form textarea { height: 15em; width: 100%; border: 0.02em solid #000; font-size: 0.9em; padding: 0.3em; } form span { float: left; text-align: right; width: 1em; color: #FF4040; font-size: 1em; } .form2 { width: 100%; margin: 0 auto; padding: 1em 1em 1em 1em; background-color: #363C3A; color: white; border-radius: 18px; } .form2 input.field { float: left; width: 100%; height: 2em; border: 0.02em solid #000; line-height: 1.7em; font-size: 0.9em; padding: 0.2em; } .form2 select { } .form2 select.field { float: left; width: 100%; height: 2em; border: 0.02em solid #000; line-height: 1.7em; font-size: 0.9em; padding: 0.2em; } .form2 select.field option { } /* Option Right Align */ .form2 input.answer { float: left; width: 15%; height: 2em; border: 0.01em solid #000; line-height: 1.7em; font-size: 0.9em; padding: 0.2em; } .form2 input.submit { float: left; /* width: 50%; border: 0.01em solid #000; line-height: 1.8em; font-size: 0.9em;*/ } .form2 textarea { height: 15em; width: 100%; border: 0.02em solid #000; font-size: 0.9em; padding: 0.3em; } .form2 span { float: left; text-align: right; width: 1em; color: #FF4040; font-size: 1em; } .form2 .width48pc { float: left; width: 48%; } .form2 .width4pc { float: left; width: 4%; } .aboutiframe { border: 0; } .menu-bg { background-image:url(images/menu-bg.jpg); height: 100%; width: 200px; background-repeat: no-repeat; } .menu-bg-about { background-image:url(images/menu-bg-about.jpg); height: 100%; width: 220px; background-repeat: no-repeat; } .menu-bg-storage { background-image:url(images/menu-bg-storage.jpg); height: 100%; width: 200px; background-repeat: no-repeat; } #divQuote .reviewscontent { width: 880px; height: 1100px; text-align: center; padding: 0px 20px 0px 20px; } #divQuote .quoteText { color: grey; font-style: italic; font-size: 8pt; } #divQuote .quoteName { color: blue; font-weight: bold; font-size: 7pt; } #divQuote .quoteDate { color: green; font-style: italic; font-size: 6pt; } #divQuote .quoteLink { color: blue; font-weight: bold; font-size: 7pt; } #divQuote form{ font-size: 0.9em; color: #000; } #divQuote input, .reviews textarea{ margin-bottom:0.5em; background-color: #ddd; border-color: #ccc; } #divQuote .button { border-color:#FFFFFF; background-color:#F7941D; font-family:Arial; color:#363C3A; font-weight:bold; border-radius: 15px; cursor:pointer; } .num { float: left; font-weight: bold; color: red; } .dots { float: left; color: #FF6600; font-weight: bold; } .sub { float: left; color: #FF6600; font-weight: bold; } .blurb { float: left; color: #111; text-align: justify; } @media only screen and (max-width: 767px) { slogan { } .topLogo {font-size: 1.6em; } .rightSideContent { max-width: 30em; padding-left: 0.2em; } .form2 .width48pc { float: left; width: 48%; } .form2 .width4pc { float: left; width: 4%; line-height: 1.5em; } } @media only screen and (max-width : 400px) { .slogan { font-size: 0.65em; } .topLogo { font-size: 1.3em; padding-left: 0.2em; } .rightSideContent { max-width: 30em; } .form2 .width48pc { clear: both; width: 100%; } .form2 .width4pc { clear: both; width: 0em; line-height: 0em; } } </style> </head> <body> <div class="w3-top"> <div class="w3-bar /*w3-theme-d6*/ grad w3-top w3-left-align w3-large"> <a class="w3-bar-item w3-button w3-opennav w3-right w3-hide-large w3-hover-white w3-large /*w3-theme-l1*/" href="javascript:void(0)" onclick="w3_open()"><i class="fa fa-bars"></i></a> <div class="topLogo"><a href=""><img class="image" alt="" src="images/logo4.gif"></a></div> <div class="slogan"><a class="myButton textdecorationnone" href="tel:+">000</a></div> <div class="clearFloat"></div> </div> </div> <nav class="w3-sidenav w3-collapse /*w3-theme-d6*/ grad w3-animate-left" id="mySidenav"> <div class="menu-bg color-D97B09"> <a href="javascript:void(0)" onclick="w3_close()" class="w3-right w3-xlarge w3-padding-large w3-hover-black w3-hide-large" title="close menu"> <i class="fa fa-remove"></i> </a> <a href="index.php" class="w3-hover-white" title="Home">Home</a> </div> </nav> <div class="w3-overlay w3-hide-large" onclick="w3_close()" title="close side menu" id="myOverlay"></div> <div class="w3-main"> <br><br><br><br> <div class="w3-row lrpadding05em w3-twothird"> <br><br> </div> <div class="w3-third w3-container rightSideContent"> <br><br> <div class="rightText"> </div> <br><br> </div> </div> <br><br> </body> </html>
  13. define("corrections", array("<?=" => "<?php echo ")); $newFileContents = str_replace(array_keys(corrections), corrections, $fileContents); the file contents... <? $a = "1"; ?><?=$a;?> I have taken this form https://www.designcise.com/web/tutorial/how-to-replace-words-in-a-string-based-on-a-map-in-php But do not understand why the newFileContents returned is the same as the original. Please can someone tell me what I have wrong with the code above ? EDIT i just realised i missed out the function to get content, it was only getting the file names.
  14. The script starts in the browser (FireFox) and runs for about 20 minutes, the error shows access denied Fatal error: Uncaught exception 'UnexpectedValueException' with message 'RecursiveDirectoryIterator::__construct(l:\System Volume Information,l:\System Volume Information): Access is denied. (code: 5)' in C:\xampp\htdocs\GetFiles.php:27 Stack trace: #0 [internal function]: RecursiveDirectoryIterator->__construct('l:\\System Volum...', 4096) #1 C:\xampp\htdocs\GetFiles.php(27): RecursiveDirectoryIterator->getChildren() #2 {main} thrown in C:\xampp\htdocs\GetFiles.php on line 27 The number of files at this point is only some of the files (121304) it then stores the same files from the start of the list which has already been through.
  15. ok so I removed that flag but still the same thing. Like before it is restarting the scan and duplicating the results in the db table. It shows error.. access denied for system volume information folder and restarts. But I do not want that indexed, just all files. In case there is something else I have wrong here is the complete code. <!DOCTYPE html><html lang="en" xml:lang="en"><head><title>GetFiles.php</title></head><html><body><?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); define('DB_USER', 'root'); define('DB_PASSWORD', ''); define('DB_HOST', 'localhost'); define('DB_NAME', 'mydupcleaner'); function db_query($mysqli, $query) { $result = $mysqli->query("$query"); return $result; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die('Could not connect to MySQL: '.mysqli_connect_error()); define('DBTableName', 'filesfrom-m'); $dir = "M:"; $system_volume_information = "M:/System Volume Information"; $flags = \FilesystemIterator::SKIP_DOTS;// some flags to filter . and .. and follow symlinks $iterator = new \RecursiveDirectoryIterator($dir, $flags);// create a simple recursive directory iterator $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST);// make it a truly recursive iterator foreach ($iterator as $path) { if ($path->isDir() || $path == $system_volume_information){ continue;} $ext = pathinfo($path, PATHINFO_EXTENSION); $query = "INSERT INTO `" . DBTableName . "` (`dateAddedToDB`, `fullpath`, `ext` ) VALUES ('" . $mysqli->real_escape_string(gmdate("Y-m-d H:i:s")) . "', '" . $mysqli->real_escape_string($path) . "', '" . $mysqli->real_escape_string($ext) . "')"; db_query($mysqli, $query); } ?> done</body></html>
  16. $dir = "L:"; $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS;// some flags to filter . and .. and follow symlinks $iterator = new \RecursiveDirectoryIterator($dir, $flags);// create a simple recursive directory iterator $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST);// make it a truly recursive iterator foreach ($iterator as $path) { if ($path->isDir()){continue;} // rest of code } Very strange but with one of my drive the code above shows the correct number of files but the other larger drive the code is showing way more than double the actual number of files and still going. I changed the settings to show all hidden files/folder and select all files/folders then I use right click, properties. There is nothing in any of the recyclebin. Still the number of files the code above states is way more than that shown in properties. How can this be ?
  17. I placed all the code in the try, a few tweaks and its working.
  18. I am new to TRY, I am wanting to scan all files, but if one fails say the file name contains invalid characters then catch the error and still continue to the next foreach loop. But this just shows the error and stops. What is the correct way to do this ? <?php $dir = "C:/Users/RH/Desktop"; $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS;// some flags to filter . and .. and follow symlinks $iterator = new \RecursiveDirectoryIterator($dir, $flags);// create a simple recursive directory iterator $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST);// make it a truly recursive iterator foreach ($iterator as $path) { if ($path->isDir()){ continue; } try { @$mdatetime = date_format(DateTime::createFromFormat('U', filemtime($path)), 'Y-m-d H:i:s'); } catch (Exception $e) { // store in separate table error files. echo "<br><br><br>display my error text<br>" . $path . "<br><br><br>"; } @$cdatetime = date_format(DateTime::createFromFormat('U', filectime($path)), 'Y-m-d H:i:s'); //echo("path " . $path . "<br>"); //echo("info of path " . gettype($path) . "<br>"); @$sizebytes = @$path->getSize(); $sizemb = ($sizebytes/1024/1024); // this is in MB $sizegb = ($sizemb/1024); // this is in GB $ext = pathinfo($path, PATHINFO_EXTENSION); echo($path . "<br>"); } echo("still running"); ?>
  19. even using the original code i got from a website it still does not work, same error. Is it the code or the pattern, both ?
  20. $string = "t*e*s*t"; $pattern = "/[^A-Za-zÀ-ÿ0-9\-\_\(\)\[\]\{\} ]/"; // keep all language letters, numbers, all types of brackets, spaces, hyphen, dash fullstop $cleanStr = preg_replace($pattern, '', $string); echo("{" . $cleanStr . "}"); I do not understand why this is not working, apart from the pattern which I know still need correcting the code is the same as code I used ages ago. Apart from the string. I get this error... Parse error: syntax error, unexpected '''' (T_CONSTANT_ENCAPSED_STRING) I am trying to remove all special characters from a string apart from all letters and accented, numbers and the usual characters allowed in a file name.
  21. I have tried to get my head around this one, tried the following found on the web... $flags = \FilesystemIterator::SKIP_DOTS | \FilesystemIterator::FOLLOW_SYMLINKS;// some flags to filter . and .. and follow symlinks $iterator = new \RecursiveDirectoryIterator($dir, $flags);// create a simple recursive directory iterator $iterator = new \RecursiveIteratorIterator($iterator, \RecursiveIteratorIterator::SELF_FIRST);// make it a truly recursive iterator foreach ($iterator as $path) {// iterate over it How do I stop the directory names showing in the list? Only have all files from all directories ?
  22. ok thank you. Well after more changes and more... I now have it working, but... now there is a memory issue.... it stops storing after 200 or so files. Is there a better way to get all file names listed without having to store so much before it is displayed on screen or stored in database ? Here is what I have. <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); session_start(); define('DB_USER', 'root'); define('DB_PASSWORD', ''); define('DB_HOST', 'localhost'); define('DB_NAME', 'mydupcleaner'); define('DBTableName', 'table1'); function db_query($mysqli, $query) { $result = $mysqli->query("$query"); return $result; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die ('Could not connect to MySQL: ' . mysqli_connect_error()); $dir = "I:/"; // DO NOT ADD the trailing / function scanDirectories($dir, $allData, $mysqli) { $invisibleFileNames = array(".", "..", ".htaccess", ".htpasswd");// set filenames invisible if you want $dirContent = scandir($dir);// run through content of root directory foreach($dirContent as $key => $content) { $path = $dir.'/'.$content;// filter all files not accessible if(!in_array($content, $invisibleFileNames)) { if(is_file($path) && is_readable($path)) {// if content is file & readable, add to array $allData[] = $path;// save file name with path /////////////////////// $size = filesize($path); $content = file_get_contents($path); $md5 = md5($content); $ext = pathinfo($path, PATHINFO_EXTENSION); $cdatetime = date_format(DateTime::createFromFormat('U', filectime($path)), 'Y-m-d H:i:s'); $mdatetime = date_format(DateTime::createFromFormat('U', filemtime($path)), 'Y-m-d H:i:s'); $query = "INSERT INTO `" . DBTableName . "` (`dateAddedToDB`, `md5`,`fullpath`,`size`,`ext`,`createDate`,`ModDate`) VALUES ('" . $mysqli->real_escape_string(date("Y-m-d H:i:s")) . "','" . $mysqli->real_escape_string($md5) . "','" . $mysqli->real_escape_string($path) . "','" . $mysqli->real_escape_string($size) . "','" . $mysqli->real_escape_string($ext) . "', '" . $mysqli->real_escape_string($cdatetime) . "','" . $mysqli->real_escape_string($mdatetime) . "')"; db_query($mysqli, $query); // echo("-4- " . $query) . "<br><br><br>"; /////////////////////// }elseif(is_dir($path) && is_readable($path)) {// if content is a directory and readable, add path and name $allData = scanDirectories($path, $allData, $mysqli);// recursive callback to open new directory } } } return $allData; } var_dump(scanDirectories($dir, $allData=array(), $mysqli)); ?>
  23. I have been trying all sorts of code from various sites but stil face different issues each time. I have now got the full path, file name, file size but can not get the creation and modified date due to errors. <?php ini_set('display_errors', 1); ini_set('display_startup_errors', 1); error_reporting(E_ALL); session_start(); define('DB_USER', 'root'); define('DB_PASSWORD', ''); define('DB_HOST', 'localhost'); define('DB_NAME', 'mydupcleaner'); function db_query($mysqli, $query) { $result = $mysqli->query("$query"); return $result; } $mysqli = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME) OR die ('Could not connect to MySQL: ' . mysqli_connect_error()); define('DBTableName', 'table1'); $_SESSION['c'] = 1; $dir = "C:/Users/RH/Desktop/test dir for db work"; function find_all_files($dir) { $root = scandir($dir); foreach($root as $value) { if($value === '.' || $value === '..') {continue;} if(is_file("$dir/$value")) {$result[]="$dir/$value";continue;} foreach(find_all_files("$dir/$value") as $value) { $result[]=$value; } } return $result; } $it = find_all_files($dir); foreach($it as $fullpath) { if(!is_dir("$fullpath")) { $size = filesize($fullpath); if ($size > 0 && $size < 1000000) { echo("-1- " . $fullpath . " " . $size . " " . "<br>"); $content = file_get_contents($fullpath); $md5 = md5($content); $ext = pathinfo($fullpath, PATHINFO_EXTENSION); echo("-2- " . $fullpath . " " . filectime($fullpath)) . "<br>"; $newfullpath = (array)$fullpath; $vars = get_object_vars($fullpath); print_r($vars); $cdatetime = DateTime::createFromFormat( 'U', filectime($newfullpath)); // error here $mdatetime = "";//DateTime::createFromFormat( 'U', filemtime('"'.print_r($fullpath).'"')); // error here $query = "INSERT INTO `" . DBTableName . "` (`md5`,`fullpath`,`size`,`ext`,`createDate`,`ModDate`) VALUES ('" . $mysqli->real_escape_string($md5) . "','" . $mysqli->real_escape_string($fullpath) . "','" . $mysqli->real_escape_string($size) . "','" . $mysqli->real_escape_string($ext) . "','" . $mysqli->real_escape_string($cdatetime) . "','" . $mysqli->real_escape_string($mdatetime) . "')"; db_query($mysqli, $query); echo("-3- " . $query) . "\r\n"; } } } exit; ?> I just can not get the full path to be used to get the dates, its saying that fullpath is an object so i tried to convert to string, then get error that string is given. How to I get the fullpath from the object to use as a text string for getting the dates?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.