Jump to content

larry29936

Members
  • Posts

    128
  • Joined

  • Last visited

Everything posted by larry29936

  1. I have some inline css that I'd like to add to an existing styles.css file but have no idea what the format needs to be. Here's what the inline css looks like: <style> .container { display: flex; max-width: 1350px; margin-right: auto; margin-left: auto; padding-top: .3rem; padding-bottom: 1.5rem; } .divL { box-sizing: border-box; padding: 5px; border-right: solid 1px #000000; border-left: solid 1px #000000; background: #eaeaea; width: 50% ; } .divR { box-sizing: border-box; padding: 5px; border-right: solid 1px #000000; border-left: solid 1px #000000; background: #eaeaea; width: 50% ; } .divR h1 { font-size:24px; font-weight:bold; margin-bottom:8px; border-bottom:solid 1px #000000; padding-bottom:10px; text-align: center; } .divR h2 { font-size:18px; font-weight:bold; margin-bottom:4px; padding-bottom:5px; text-align: center; } .divR h4 { font-size:16px; font-weight:normal; margin-bottom:4px; padding-bottom:5px; text-align:left; } .divL h1 { font-size:24px; font-weight:bold; margin-bottom:8px; border-bottom:solid 1px #000000; padding-bottom:10px; text-align: center; } .divL h2 { font-size:18px; font-weight:bold; margin-bottom:4px; padding-bottom:5px; text-align: center; } .divL h4 { font-size:16px; font-weight:normal; margin-bottom:4px; padding-bottom:5px; text-align: left; } .p { font-size:16px; color:#000000; font-weight:normal; margin-bottom:8px; padding-bottom:10px; } .h1 { font-size:24px; font-weight:bold; margin-bottom:4px; border-bottom:solid 3px #000000; padding-bottom:5px; text-align: center; } </style> How do I merge it into the pre-existing styles.css?
  2. My mistake... here's the page source for that section <div class="container"> <div class="divL"> <h3>Get the "foxclone34-02.iso" file (approx. 600MB)</h3> <center> <a href=mydloader(download/foxclone34-02.iso)><img src="images/button_get-the-app.png" alt=""> </a> </center> <br /> Bet I need to change the code to read "<a href=mydloader.php(<?php echo "{$iso}";?>)><img src="images/button_get-the-app.png" alt=""> </a> Edit: changing to mydloader.php didn't help
  3. I didn't know if you wanted the whole thing or not so I gave you everything. Scroll down to the download section for the link. <?php $filename = NULL; session_start(); // start of script every time. // setup a path for all of your canned php scripts $php_scripts = '/home/larry/web/test/php/'; // a folder above the web accessible tree // load the pdo connection module require $php_scripts . 'PDO_Connection_Select.php'; require $php_scripts . 'GetUserIpAddr.php'; require $php_scripts . 'mydloader.php'; //******************************* // Begin the script here $ip = GetUserIpAddr(); if (!$pdo = PDOConnect("foxclone")): { echo "Failed to connect to database" ; exit; } else: { $stmt = $pdo->prepare("INSERT INTO download (IP_ADDRESS, FILENAME) VALUES (?, ?)"); $stmt->execute([$ip,$filename]) ; } endif; ?> <DOCTYPE html> <html lang="en"> <head> <title>Foxclone</title> <!-- <meta content-type="text/html" charset="utf-8"> --> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <!-- Links --> <link href="https://fonts.googleapis.com/css?family=Montserrat:500,700&display=swap&subset=latin-ext" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,600&display=swap&subset=latin-ext" rel="stylesheet" /> <link href="css/bootstrap.css" rel="stylesheet" /> <link href="css/fontawesome-all.css" rel="stylesheet" /> <link href="css/swiper.css" rel="stylesheet" /> <link href="css/magnific-popup.css" rel="stylesheet" /> <link href="css/styles.css" rel="stylesheet" /> <!-- a helper script for vaidating the contact form--> <script language="JavaScript" src="js/gen_validatorv31.js" type="text/javascript"></script> <!-- Favicon --> <link rel="icon" href="images/favicon.png" /> <style> .container { display: flex; max-width: 1800px; /* margin-right: auto; margin-left: auto; */ padding-top: .3rem; padding-bottom: 1.5rem; } .divL, .divR { box-sizing: border-box; padding: 5px; border-right: solid 1px #000000; border-left: solid 1px #000000; } .divL { background: #eaeaea; width: 50% ; } .divR { background: #eaeaea; width: 50% ; } .divR h1 { font-size:24px; font-weight:bold; margin-bottom:8px; border-bottom:solid 1px #000000; padding-bottom:10px; text-align: center; } .divR h2 { font-size:18px; font-weight:bold; margin-bottom:4px; padding-bottom:5px; text-align: center; } .divR h4 { font-size:16px; font-weight:normal; margin-bottom:4px; padding-bottom:5px; text-align:left; } .divL h1 { font-size:24px; font-weight:bold; margin-bottom:8px; border-bottom:solid 1px #000000; padding-bottom:10px; text-align: center; } .divL h2 { font-size:18px; font-weight:bold; margin-bottom:4px; padding-bottom:5px; text-align: center; } .divL h4 { font-size:16px; font-weight:normal; margin-bottom:4px; padding-bottom:5px; text-align: left; } .p { font-size:16px; color:#000000; font-weight:normal; margin-bottom:8px; padding-bottom:10px; } .h1 { font-size:24px; font-weight:bold; margin-bottom:4px; border-bottom:solid 3px #000000; padding-bottom:5px; text-align: center; } </style> </head> <body data-spy="scroll" data-target=".fixed-top"> <!-- Preloader --> <div class="spinner-wrapper"> <div class="spinner"> <div class="bounce1"></div> <div class="bounce2"></div> <div class="bounce3"></div> </div> </div> <!-- end of preloader --> <!-- Navbar --> <nav class="navbar navbar-expand-md navbar-dark navbar-custom fixed-top"> <!-- Mobile Menu Toggle Button --> <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-awesome fas fa-bars"></span> <span class="navbar-toggler-awesome fas fa-times"></span> </button> <!-- end of mobile menu toggle button --> <div class="collapse navbar-collapse" id="navbarsExampleDefault"> <ul class="navbar-nav ml-auto"> <li class="nav-item"> <a class="nav-link page-scroll" href="#header">HOME <span class="sr-only">(current)</span></a> </li> <li class="nav-item"> <a class="nav-link page-scroll" href="#features">FEATURES</a> </li> <li class="nav-item"> <a class="nav-link page-scroll" href="#legal">LEGAL</a> </li> <li class="nav-item"> <a class="nav-link page-scroll" href="#contact">CONTACT</a> </li> <li class="nav-item"> <a class="nav-link page-scroll" href="#download">DOWNLOADS</a> </li> <br><br> </ul> </div> </nav> <!-- end of navbar --> <!-- end of navbar --> <!-- Header --> <header id="header" class="header"> <div class="header-content"> <div class="container"> <div class="row"> <div class="col-lg-12"> <div class="text-container"> <h1>FoxClone</h1> <p class="p-heading p-large">FoxClone is a Linux based image backup, restore and clone tool using a simple point and click interface. It takes images of the partitions on your hard disk (HDD) or solid-state drive (SSD) and stores them for later restoration. Image files can optionally be compressed to save space.</p> <p> </p> </div> </div> <!-- end of col --> </div> <!-- end of row --> </div> <!-- end of container --> </div> <!-- end of header-content --> </header> <!-- end of header --> <!-- end of header --> <!-- Features --> <div id="features" class="download"> <!-- <div class="container"> --> <div class="row"> <div class="download"> <br /><br> <h1><center>We've made it easy to backup or clone partitions or entire drives</center></h1> <div class="container"> <div class="divL"> <h2><center>Simple Interface<center></h2> <h4>Just four simple tabs to take you to each function. No confusing configuration or input is required. Just point and click.</h4> </div> <div class="divR"> <h2><center>Backup & Restore</center></h2> <h4>Backup any partition on a drive or all of them. Windows and linux partition types, legacy and GPT partition tables. Backups are compressed to save space.</h4> </div> <div class="divL"> <h2><center>Clone Full Disks</center></h2> <h4>Clone direct drive to drive or clone from a backup. Clone from a larger drive to smaller drive (with limitations).</h4> </div> <div class="divR"> <h2><center>Additional Tools</center></h2> <h4>Gparted and testdisk are included. Gparted is a disk partitioning tool, testdisk is for data recovery.</h4> </div> <div class="divL"> <h2><center>Built-In Document Viewer</center></h2> <h4>A step by step manual is available from within the app. If you're unsure what to do next, just open the manual using the built-in document viewer.</h4> <br /><br /><br /><br /><br /><br /> </div> </div> </div> <!-- end of col --> </div> <!-- end of row --> </div> <!-- end of container --> </div> <!-- end of cards-2 --> <!-- end of services --> <!-- ====================================== LEGAL ========================================= --> <div id="legal" class="filter"> <!-- hitwebcounter Code START --> <div class="container"> <div class="row"> <div class="col-lg-12"> <h2>LEGAL</h2> <div class="body"> <p class="p-heading p-large"> This is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. <br /><br /> This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. <br /><br /> A copy of the GNU General Public License is available on the World Wide Web at http://www.gnu.org/copyleft/gpl.html. You can also obtain it by writing to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1335, USA. </h3> <br /><br /><br /><br /><br /><br /> </div> </div> </div> <!-- end of col --> </div> <!-- end of row --> </div><br /> </div> <!--===============END LEGAL======================--> <div id="contact" class="stylized"> <br /> <div "myform"> <br /> <h1>Need help? Have a suggestion? Why not send us an email.</h1> <h3><center> You'll receive a copy for your records</center></h3> <br /> <form id="form1" method="POST" action="mail.php"> <label>Name</label> <input type="text" name="name" > <label>Email</label> <input type="text" name="email" > <select name="type" id="category" size="1"> <option value=''>Select A Category</option> <option value='Questions'>Questions</option> <option value="Report Problem">Report Problem</option> <option value='Suggestion'>Suggestion</option> <option value='Other'>Other</option> <option value="Website Problem"> Website Problem</option> </select> <br /><br /> <br /> <label>Message(10 character min.)</label> <textarea name="message" rows="7"></textarea><br /> <button type="submit" value="Send" style="margin-top:15px; margin-left: 500px; text-align: center;">Send Email</button> <!-- <center><input type="image" src="images/button_send-email.png" alt="Email"></center> --> <div class="spacer"></div> <br /><br /><br /><br /><br /><br /> </form> </div> <!-- end of form class --> </div> <br /><br /><br /><br /> <!-- End of Contact --> <!-- DOWNLOAD --> <div id="download" class="stylized"> <div "myform"> <div class="container"> <div class="row"> <div class="download"> <br /><br> <h1><center>FoxClone Download Page</center></h1> <?php $isos = glob('download/*.iso'); $iso = $isos[count($isos) -1]; $isoname = basename($iso); $md5file = md5_file($iso); ?> <?php $pdfs = glob('download/foxcloneV*.pdf'); $pdf = $pdfs[count($pdfs) -1]; $pdfname = basename($pdf); ?> <?php $debs = glob('download/*.deb'); $deb = $debs[count($debs) - 1]; $debname = basename($deb);; ?> <?php $srcs = glob('download/*.tar.*'); $src = $srcs[count($srcs) - 1]; $srcname = ltrim($src,'download/'); ?> <div class="container"> <div class="divL"> <h3>Get the "<?php echo "{$isoname}";?>" file (approx. 600MB)</h3> <!-- $filename = "<?php echo "/{$iso}";?> --> <center> <a href=mydloader(<?php echo "{$iso}";?>)><img src="images/button_get-the-app.png" alt=""> </a> </center> <br /> <h3 style="margin-bottom: 0.5rem;">The MD5sum for "<?php echo "{$filename}";?>" is "<?php echo "{$md5file}";?> <br> ______________________________________________________________________________________________________________________"</h3> <h3>Read or Download the Installation and Use Instructions </h3> <center> <a href="<?php echo "/{$pdf}";?>"><img src="images/button_read-the-file.png" alt=""></a></center> <br /><h3>______________________________________________________________________________________________________________________"</h3> <h3>How To Install To A USB/CD</h3> <h4>1. Download the iso file <br /> 2.&nbspa. If burning to a USB stick use the USB image writer that comes with your distribution. <br /> &nbsp&nbsp&nbsp b. If burning to a CD, there are many Linux utilities, xfburn is one of the simplest. Install from your software manager/centre if not installed.</h4> <br /> <h3>How To Boot The USB/CD</h3> <h4>At the manufacturer’s splash screen, press the key to get into the boot menu. This key varies across PCs, as an example for a Lenovo Thinkpad it is F12. Consult your user manual to find out what the key is or google. Do not confuse the boot menu with the boot priority order settings in BIOS. The boot menu is a one time selection for the device to use to boot the PC. It overrides the normal boot priority order. The next time you boot, the PC will revert to the normal boot order. Virtually all BIOSs support this feature, they just do it differently. </h4> </div> <div class="divR"> <h3>Get the "<?php echo "{$debname}";?>" file (approx. 7MB) </h3> <center> <a href="<?php echo "/{$deb}";?>"><img src="images/button_download.png" alt=""></a></center><br /> <?php $filename = $debname; $stmt->execute([$ip,$filename]) ; ?> <h3 style="color:red"><b>WARNING - DO NOT INSTALL THIS TO YOUR COMPUTER !!!</b></h3> <h4 style="color:black">This .deb file is designed to be installed on a large USB drive, typically 1TB or greater, that already has an operating system installed and is intended as a backup drive.</h4> <h4><b>For more information <a href='download/deb_file.pdf' style='color:#ff0099;'>Click Here</a></b></h4> <?php $filename = 'deb_file.pdf' ; $stmt->execute([$ip,$filename]) ; ?> <br><h3>______________________________________________________________________________________________________________________"</h3> <h3>Get the "<?php echo "{$srcname}";?>" Source file (approx. 6MB) </h3> <center> <a href="<?php echo "/{$src}";?>"><img src="images/button_download.png" alt=""></a></center> <?php $filename = $srcname; $stmt->execute([$ip,$filename]) ; ?> </div> </div> </div> </div> </div> </div> </div> <!-- footer ================================================== --> <div id="footer"> <div class="copyright"> <div class="container"> <div class="row"> <div class="col-lg-12"> <div class="p-small">Copyright © 2019-2020 Andy Hardwick <br /> Design by Larry Hale</div> <p> <a href="https://jigsaw.w3.org/css-validator/check/referer"> <img style="border:0;width:88px;height:31px" src="https://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" /> </a> </p><br /> <!-- hitwebcounter Code START --> <script type="text/javascript" src="https://free-hit-counters.net/count/5gee"></script><br> <a href='https://thesiswritingservice.net/'>author bachelor's thesis</a> <script type='text/javascript' src='https://www.whomania.com/ctr?id=af7ce0098d37aaf2a18654f4fc14d04350b374b2'></script> </div> </div> </div> </div> </div> <!-- end footer__top --> <script src="js/jquery.min.js"></script> <!-- jQuery for Bootstrap's JavaScript plugins --> <script src="js/popper.min.js"></script> <!-- Popper tooltip library for Bootstrap --> <script src="js/bootstrap.min.js"></script> <!-- Bootstrap framework --> <script src="js/jquery.easing.min.js"></script> <!-- jQuery Easing for smooth scrolling between anchors --> <script src="js/swiper.min.js"></script> <!-- Swiper for image and text sliders --> <script src="js/jquery.magnific-popup.js"></script> <!-- Magnific Popup for lightboxes --> <script src="js/morphext.min.js"></script> <!-- Morphtext rotating text in the header --> <script src="js/isotope.pkgd.min.js"></script> <!-- Isotope for filter --> <script src="js/validator.min.js"></script> <!-- Validator.js - Bootstrap plugin that validates forms --> <script src="js/scripts.js"></script> <!-- Custom scripts --> </body> </html>
  4. You've got me confused. I never get to the mydload.php page to "View source". When I click on the link, it immediate goes to a 404 error page with an address of http://test/mydloader(download/foxclone34-02.iso) and the following "View source": <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL was not found on this server.</p> <hr> <address>Apache/2.4.29 (Ubuntu) Server at test Port 80</address> </body></html> Should I take it out of the required section and move it to /public_html?
  5. The page source for the 404 page is above. The code for mydloader.php follows: <?php //include 'PDO_Connection_Select.php'; # YOUR CONNECTION //$db = pdoConnect('test'); # GOES HERE if (isset($_GET['ip'])) { $add = $db->prepare("INSERT INTO download (IP_ADDRESS, FILENAME) VALUES (?, ?)"); $add->execute( [ $_GET['ip'], $_GET['filename'] ] ); header('Content-Type: octet-stream'); header('Content-Disposition: attachment; filename="'.$_GET['filename'].'"'); header('Pragma: no-cache'); header('Expires: 0'); readfile("download/{$_GET['filename']}"); } ?> I had to comment the connection lines out because of errors (the db is already connected at start of index.php)
  6. Typical 404 page <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>404 Not Found</title> </head><body> <h1>Not Found</h1> <p>The requested URL was not found on this server.</p> <hr> <address>Apache/2.4.29 (Ubuntu) Server at test Port 80</address> </body></html>
  7. Typo on my part but not working here. It opens a page with the address of: http://test/mydloader(download/foxclone34-02.iso) and I get a 404 error even though I have it set in the top of my index.php as: <?php $filename = NULL; session_start(); // start of script every time. // setup a path for all of your canned php scripts $php_scripts = '/home/larry/web/test/php/'; // a folder above the web accessible tree // load the pdo connection module require $php_scripts . 'PDO_Connection_Select.php'; require $php_scripts . 'GetUserIpAddr.php'; require $php_scripts . 'mydloader.php'; etc, etc The actual line in my code is: <a href=mydloader(<?php echo "{$iso}";?>)><img src="images/button_get-the-app.png" alt=""> </a>
  8. @Barand - this doesn't work. Nothing happens when I click on the button. I put an echo near the top of mydload.php and it never gets there. Could this be because I'm using an image button, not an html button?
  9. I understand. I took the php variable and converted it like so: $filename = "<?php echo "/{$iso}";?> <a href="mydloader.php?ip=$ip&filename=$filename><img src="images/button_get-the-app.png" alt=""></a>
  10. Didn't mean to have "demo_app" at the end. Are you saying no quotes around the variables, i.e. $ip not "$ip"?
  11. OK, does the following section do the actual download? header('Content-Type: octet-stream'); header('Content-Disposition: attachment; filename="'.$_GET['filename'].'"'); header('Pragma: no-cache'); header('Expires: 0'); readfile("download/{$_GET['filename']}"); Would this work? <a href="mydloader.php?ip="$ip"&filename="<?php echo "/{$iso}";?>"><img src="images/button_get-the-app.png" alt=""></a> demo_app.html"
  12. OK, I see how that does the insert into the table. Does that call go after the download, which in my case is done like this: <a href="<?php echo "/{$iso}";?>"><img src="images/button_get-the-app.png" alt=""></a> or do I need to modify how I'm doing the download?
  13. @Barand - I'm a relative newbie at this this. Do you have a link to something that explains what you're suggesting?
  14. Sorry, wrong reference. Let me find the correct one.
  15. I refer you to: https://davidwalsh.name/download-attribute. Maybe my research is helpful.
  16. Yes, it is doing the download. Thanks for trying.
  17. I guess I didn't explain my problem properly. When a user opens the webpage, a connection to the database is established and a row is inserted into a table with the user's ip address. If the user decides to download a file, another row needs to be inserted into the same table with the user's ip address and filename. The php statement, "$stmt->execute([$ip,$filename]) ;" is what does the insertrow. What I'm asking is how to trigger that line when the button (link) is clicked.
  18. OK, it's a link on a button. <a href="<?php echo "/{$file}";?>"><img src="images/button_get-the-app.png" alt=""></a> It's a download from the server to the client. It's all working, but I want to insert a row in the database on the server when a download is made. The connection to the database is established in the script at the top of index.php and a row is inserted into the database. The download area is further into index.php
  19. The last line in what I provided in the download area is the button. The statement that I want to execute would insert a row in the database connection established in the first section.
  20. I have a download area in my index.php. I'd like to insert a row in the connected database when a user downloads a file. Here's what I have at the start of index.php: <?php session_start(); // start of script every time. // setup a path for all of your canned php scripts $php_scripts = '/home/larry/web/test/php/'; // a folder above the web accessible tree // load the pdo connection module require $php_scripts . 'PDO_Connection_Select.php'; require $php_scripts . 'GetUserIpAddr.php'; //******************************* // Begin the script here $ip = GetUserIpAddr(); if (!$pdo = PDOConnect("foxclone")): { echo "Failed to connect to database" ; exit; } else: { $filename = NULL; $stmt = $pdo->prepare("INSERT INTO download (IP_ADDRESS, FILENAME) VALUES (?, ?)"); $stmt->execute([$ip,$filename]) ; } endif; //exit(); ?> <DOCTYPE html> Here's what my download area looks like: <?php $files = glob('download/*.iso'); $file = $files[count($files) -1]; $filename = basename($file); ?> <div class="container"> <div class="divL"> <h3>Get the "<?php echo "{$filename}";?>" file (approx. 600MB)</h3> <center> <a href="<?php echo "/{$file}";?>"><img src="images/button_get-the-app.png" alt=""></a> </center> How do I execute "$stmt->execute([$ip,$filename]) ;" when the download button is pressed?
  21. So use this instead: $stmt = $pdo->prepare("INSERT INTO download (IP_ADDRESS, FILENAME) VALUES (?, ?)"); $stmt->execute([$ip,$filename]) ; Then anywhere I want to insert a row in the db, set $filename and run the execute statement?
  22. @Barand - if I need to execute this in the download section of my index.php, do I need the entire code block or can I just do something like this: $stmt->bindParam(2, $filename); $stmt->execute();
  23. Thanks Barand, that took care of it.
  24. I have this at the top of my index.php: <?php session_start(); // start of script every time. // setup a path for all of your canned php scripts $php_scripts = '/home/larry/web/test/php/'; // a folder above the web accessible tree // load the pdo connection module require $php_scripts . 'PDO_Connection_Select.php'; require $php_scripts . 'GetUserIpAddr.php'; //******************************* // Begin the script here $ip = GetUserIpAddr(); if (!$pdo = PDOConnect("foxclone")): { echo "Failed to connect to database" ; exit; } else: { $stmt = $pdo->prepare("INSERT INTO 'download' ('IP_ADDRESS', 'FILENAME') VALUES (?, ?"); $stmt->bindParam(1, $ip); $stmt->bindParam(2, $filename); $stmt->execute(); } endif; //exit(); ?> I'm getting the following error at the $pdo->prepare line: Fatal error: Uncaught PDOException: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''download' ('IP_ADDRESS','FILENAME') VALUES (?, ?' at line 1 in /home/larry/web/test/public_html/index2.php:23 Stack trace: #0 /home/larry/web/test/public_html/index2.php(23): PDO->prepare('INSERT INTO 'do...') #1 {main} thrown in /home/larry/web/test/public_html/index2.php on line 23 I verified the format of the statement at https://www.w3schools.com/php/php_mysql_prepared_statements.asp but am unsure if it needs to be in the PDO_Connection_Select.php, or it belongs where I have it since the db is already connected.
  25. Thanks for catching that. I looked rights past it for a couple of hours.
×
×
  • 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.