Jump to content

All Activity

This stream auto-updates     

  1. Past hour
  2. Did not receive any file attachment in thunderbird email

    When working with file type inputs, its $_FILES, not $_POST
  3. Today
  4. Live Search - Over 40,000 Records

    Under the assumption that the XML files are uniformly constructed. Why not construct a table in a database that could accommodate all of the XML items in your files, and then write a PHP routine that would extract the values of each item in each file and insert them into the data table? I know. I was also very hesitant to start using a database, but I am very glad that I did. For, it is everything at your fingertips -- anything, anywhere, anytime, in any order, and as much or as little as you want. Roddy
  5. Hello everyone I am trying to see if I can receive multiple photos at once from my contact php form to my thunderbird email when I go to my contact php form I click choose files and I highlight the photos that I want to send then I submitted form with those photos that I chosen then I checked my thunderbird email and I did receive the email from the contact form submitted but did not receive any file attachment. I have included the php code from the contact form any idea as what might be problem for this any help and solutions is greatly appreciated thanks very much in advance. <?PHP /* Contact Form from HTML Form Guide This program is free software published under the terms of the GNU Lesser General Public License. See this page for more info: http://www.html-form-guide.com/contact-form/contact-form-attachment.html */ require_once("./include/fgcontactform.php"); $formproc = new FGContactForm(); //1. Add your email address here. //You can add more than one receipients. $to = $formproc->AddRecipient('test@alphaboss.ca'); //<<---Put your email address here $subject = 'Form was submitted'; $message = 'New message from a visitor'; $headers = 'From: test@alphaboss.ca' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); // 'test@alphaboss.ca', 'Form was submitted', 'New message from a visitor' //2. For better security. Get a random tring from this link: http://tinyurl.com/randstr // and put it here $formproc->SetFormRandomKey('HG9hPBpn9Bn26yg'); $formproc->AddFileUploadField('photo','jpg,jpeg,gif,png,bmp',2024); if(isset($_POST ['uploads'])) if(isset($_POST ['photo'])) if(count($_POST['uploads']['photo'])) { foreach ($_POST['uploads']['photo'] as $file) { //do your upload stuff here echo $file; } } if(isset($_POST['submitted'])) { if($formproc->ProcessForm()) { $formproc->RedirectToURL("thank-you.php"); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US"> <head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'/> <title>Alpha Boss Computer Services</title> <style> body {font-family: Verdana, sans-serif; margin: 0; height: 1140px; } h1 {text-align:center; color: navy; } #background-image { background-image: url(alpha.png); width: 100%; top: 0; left: 0; height:1140px; opacity: 0.2; position: absolute; background-repeat: repeat; padding: 0; margin: 0; z-index:0; } .navbar { overflow: hidden; background-color: #333; position: fixed; bottom: 0; width: 100%; display: flex; align-items: center; justify-content: center; z-index: 2; } .navbar a { display: inline-block; color: #f2f2f2; text-align: center; padding: 14px 16px; text-decoration: none; font-size: 17px; margin: 0px auto; } .navbar a:hover { background: #f1f1f1; color: black; } .fieldset-auto-width { display: inline-block; } form { position: absolute; z-index: 2; left: 50px; right: 50px; top: 195px; } div.b { line-height: 1.6; } </style> <link rel="STYLESHEET" type="text/css" href="contact.css" /> <script type='text/javascript' src='scripts/gen_validatorv31.js'></script> <script type='text/javascript' src='scripts/fg_captcha_validator.js'></script> <link rel="icon" href="http://localhost/alpha.png" type="image/png" sizes="16x16"> </head> <body> <div id="background-image"></div> <!-- Form Code Start --> <div class="b"><h1>You can call <u>289-696-7530</u> or fill out the contact form below; for your computer, peripheral, and photo slideshow needs. Hours of operation: Monday to Friday 9AM to 5PM.</h1></div> <div class="form"><center><form id='contactus' action='<?php echo $formproc->GetSelfScript(); ?>' method='post' enctype="multipart/form-data" accept-charset='UTF-8'> <fieldset class="fieldset-auto-width"> <legend><h1>Contact Form</h1></legend> <input type='hidden' name='submitted' id='submitted' value='1'/> <input type='hidden' name='<?php echo $formproc->GetFormIDInputName(); ?>' value='<?php echo $formproc->GetFormIDInputValue(); ?>'/> <input type='text' class='spmhidip' name='<?php echo $formproc->GetSpamTrapInputName(); ?>' /> <div class='short_explanation'><font size="3" color="navy"><h1>* required fields</h1></font></div> <div><span class='error'><?php echo $formproc->GetErrorMessage(); ?></span></div> <div class='container'> <label for='name'><font size="3" color="navy"><h1>Your Full Name Below*:</h1></font></label><br/> <input style='width:400px;height:40px;font-size:14pt; border:3px solid black' type='text' name='name' id='name' value='<?php echo $formproc->SafeDisplay('name') ?>' maxlength="50" /><br/> <span id='contactus_name_errorloc' class='error'></span> </div> <div class='container'> <label for='email'><font size="3" color="navy"><h1>Your Email Address Below*:</h1></font></label><br/> <input style='width:400px;height:40px;font-size:14pt; border:3px solid black' type='text' name='email' id='email' value='<?php echo $formproc->SafeDisplay('email') ?>' maxlength="50" /><br/> <span id='contactus_email_errorloc' class='error'></span> </div> <div class='container'> <label for='message'><font size="3" color="navy"><h1>Your Message Below:</h1></font></label><br/> <span id='contactus_message_errorloc' class='error'></span> <textarea rows="10" cols="50" name='message' id='message' style="border:3px solid black"><?php echo $formproc->SafeDisplay('message') ?></textarea> </div> <div class='container'> <label for='photo'><font size="3" color="navy"><h1>Upload your photos:</h1></font></label><br/> <input style='font-size:24px' type="file" name='photo[]' id='photo' multiple=""/><br/> </div> <div class='container'> <input style='font-size:24px' type='submit' name='Submit' value='Submit' /> </div> </fieldset> </form></center></div> <div class="navbar"> <div class="navbar-inner"> <a href="index.html">HOME</a> <a href="https://www.facebook.com/Alpha-Boss-Computer-Services-1259286717548256/">FACEBOOK PAGE</a> </div> </div> <!-- client-side Form Validations: Uses the excellent form validation script from JavaScript-coder.com--> <script type='text/javascript'> // <![CDATA[ var frmvalidator = new Validator("contactus"); frmvalidator.EnableOnPageErrorDisplay(); frmvalidator.EnableMsgsTogether(); frmvalidator.addValidation("name","req","Please provide your name"); frmvalidator.addValidation("email","req","Please provide your email address"); frmvalidator.addValidation("email","email","Please provide a valid email address"); frmvalidator.addValidation("message","maxlen=2048","The message is too long!(more than 2KB!)"); frmvalidator.addValidation("photo","file_extn=jpg;jpeg;gif;png;bmp","Upload images only. Supported file types are: jpg,gif,png,bmp"); // ]]> </script> </body> </html>
  6. SHOW COLUMNS with prepared in php

    Why are you using prepared statements to show table fields? It seems excessive. By the way, in your case $mysqli_obj = $conn;
  7. Yesterday
  8. VIDEO BACKGROUND

    The principle is the same. Have the video in a fixed position in the background while having the rest of the content scrollable in the foreground. Here's an example: https://www.w3schools.com/code/tryit.asp?filename=FOMFZ9OYGA7L
  9. MySQL issues with query

    SELECT MAX(id), order_id FROM table GROUP BY order_id That will get the largest ID for each order. You can use that in a subquery to get the rest of the data for each row.
  10. VIDEO BACKGROUND

    HI. Does anyone know how to add more overlays in this code: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_css_fullscren_video to get as a result what we see in this website: www.goodsie.com.br Thanks!
  11. BACKGROUND: Please compare the Select Language <select> element option menu under the headings Free Webinar and Newsletter/Subscribe found in the navigation bar on the Grammar Captive main page. Therein lies the heart of the following question. QUESTION: How does one set the background and text colors of the <optgroup> element so that they appear properly in Firefox? Neither optgroup { background: black; color: white; } nor optgroup { background-color: black; color: white; } appear to work. Roddy
  12. SHOW COLUMNS with prepared in php

    $db_name = "..."; $tbl_name = "..."; $sql = "SHOW FULL COLUMNS IN " . $tbl_name . " IN " . $db_name; $result_obj = $mysqli_obj->query($sql); while ($row = $result_obj->fetch_assoc()) { foreach ($row as $key => $value) { echo "<span style='font-weight:bold;'>" . $key . "</span>: <span style='color:red;'>" . $value . '</span><br />'; } echo '<hr>'; } Roddy
  13. SHOW COLUMNS with prepared in php

    Hi I would like to know how to fetch all columns from a table. Not the data in the table, but only the names of the columns. I made a script. I tested the query first in the console giving me a good result in the section Field . Can someone please explain how to use this in PHP ? code example: <?php // test set up for fetching column names $servername = "localhost"; $username = "name"; $password = "pass123"; $dbname = "test_database"; // $conn = new mysqli($servername, $username, $password, $dbname); if ($conn->connect_error) { die("Connection failed: " . $conn->connect_error); } if ($stmt = $conn->prepare("SHOW COLUMNS FROM test_table ")) { $stmt->execute(); $row = $stmt->fetch(); var_dump($stmt); var_dump($row); foreach ($row as $value) { var_dump($value); } } $stmt->close(); $conn->close(); ?> EDIT: I solved the script in the following way. <?php $stmt = $conn->prepare("SHOW COLUMNS FROM test_table"); $stmt->execute(); $res = $stmt->get_result(); var_dump($res); foreach ($res as $val){ $col = $val['Field']; var_dump($col); } ?> You have to remove the if part and the {} and replace it with the code above.
  14. multilevel dropdown menu

    Hi, I am using w3css top navigation bar using a drop down menu. I would like to have a multilevel drop down menu for some of the items. I would like that each season opens up to another submenu where I can display eg, the years pictures or blogs etc. At the moment the code for the html and css is eg, HTML <div class="dropdown"> <button class="dropbtn"><strong>History</strong></button> <div class="dropdown-content"> <a href="#">Season2016</a> <a href="#">Season 2017</a> </div> </div> CSS .dropdown { font-family: "Comic Sans MS", cursive, sans-serif; float: left; overflow: hidden; } .dropdown .dropbtn { font-family: "Comic Sans MS", cursive, sans-serif; font-size: 16px; border: none; outline: none; color: black; padding: 14px 16px; background-color: inherit; } .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } .dropdown-content a { float: none; color: black; padding: 12px 16px; text-decoration: none; display: block; text-align: left; } .dropdown-content a:hover { background-color: #ddd; } .dropdown:hover .dropdown-content { display: block; }
  15. Last week
  16. Live Search - Over 40,000 Records

    There is no fast way to search an XML document, because the entire file needs to be loaded into memory and parsed before the search can even begin. You would need to create a file format that is optimized for searching, which is exactly what databases do. The search has to be done on the server-side as well, since transferring 40,000 records to the client before beginning the search is already a slow task.
  17. Failure to Transfer Focus

    Yes, Dsonesuk. You are so often, so accurate. You deserve the highest accolade. I am now targeting the <input> form control directly, rather than the <div> element in which it is contained. All it took was an additional line of code. My future users will have much for which to thank you. The new implementation has already begun. You can see it in the Weekly Podcasts panel of the Grammar Captive mainpage. Roddy p.s. The FIX $('#pc_other').hide(); $('#pc_tongue').change(function() { if ($('#pc_tongue').val() == 'other_tongue') { $('#pc_other').show(); $('#pc_other_input').focus(); } else { $('#pc_other').hide().focusout(function(){ $("label#pc_tongue_error").hide(); }); } });
  18. Is It a Case of Bubbling?

    OK, guys! I have made the switch. I have eliminated the multiple and simultaneous animations and switched to click. All that remains is getting the cursor to appear properly, but this should be much easier to achieve. Many thanks! Roddy
  19. I've built a static site with over 40,000 pages using Jekyll. I am trying to implement a live search into it without a database. I tried the w3schools live search example with a xml file I created from my site. It is very slow. Does anyone know of a faster way to parse xml files or am I wasting time. I enabled gzip compression on the entire site also, What would be the fastest way to search a lot of records and return a result? Thanks in advance.
  20. How to start animation html 5 canvas

    Hello, I'm new, I have realized an animation with Adobe Animate CC in HTML 5 canvas format and now I need help for a snippet code for start/play the animation when it is visible on the browser or vertical pixel and then I'll export it how .oam. the file example: AnimateBar Illustrator.fla thanks for help Illustrator_res.oam AnimateBar Illustrator.html
  21. Failure to Transfer Focus

    Unless its changed, focus is limited to inputs and anchor elements, so targeting elements other than these is your problem. From https://api.jquery.com/focus/ The focus e vent is sent to an element when it gains focus. This event is implicitly applicable to a limited set of elements, such as form elements (<input>, <select>, etc.) and links (<a href>). In recent browser versions, the event can be extended to include all element types by explicitly setting the element's tabindex property. An element can gain focus via keyboard commands, such as the Tab key, or by mouse clicks on the element.
  22. Failure to Transfer Focus

    The PROBLEM: The problem can be observed on the internet at overview.html. After the page opens: Find the words Weekly Podcasts in the page's navigation bar and click on them. After the page opens find the Seven Gates subscription form. Find the select control called Select a Language and click on it. Scroll to the bottom of the list until you arrive at the Not found? option and click where it says Click and enter! If the focus transfers to the newly opened window, then you can see something that I cannot. This failure to transfer focus is the problem. QUESTION: Why does the following code fail to realize the aforesaid mentioned transfer of the focus from the window containing the phrase Click and enter! to the newly opened, blank window? In effect, users cannot enter a missing language without first placing the cursor into the newly opened window. They cannot simply being typing after they click on the words Click and enter!. Alas. HTML <div id='pc_language_options' style='clear:both;'> <label for='pc_tongue'>Native Tongue:<span class="formlabel">*</span></label> <span class="rightfloat"> <select id="pc_tongue" name="language" style="width:auto;"> <option selected value="0">Select Language</option> ... <optgroup label='oceania'> <option value=mi>Maori</option> <option value=haw>Hawaiian</option> <option value=sm>Samoan</option> </optgroup> <optgroup label='Not found?'> <option id="not_found" value='other_tongue'>Click and enter!</option> </optgroup> </select> </span> </div><!-- end div#pc_language_options --> <div id='pc_other' style='margin-top:0.8em;'> <span class="rightfloat"><input id='pc_other_input' type='text' name='other' value=''></span> </div><!-- end div#pc_other --> <label id="pc_tongue_error" class="error" for="pc_tongue">This field is required.</label> JAVASCRIPT $('#pc_other').hide(); $('#pc_tongue').change(function() { if ($('#pc_tongue').val() == 'other_tongue') { $('#pc_other').show().focus(); } else { $('#pc_other').hide().focusout(function(){ $("label#pc_tongue_error").hide(); }); } }); By the way, this is hardly where my experimentation stopped. I have tried many ways using different combinations of the show(), hide(), focus(), focusin(), blur(), and focusout() functions -- and these, both with and without callback functions. Unfortunately, to no avail. I have learned, in effect, many different ways to mess up what already works, but I simply cannot get it to work with the desire enhancement -- a transfer of focus. Roddy
  23. Menu Whitespace

    Apart from a unnecessary extra closing div i cannot see anything wrong that would produce that? unless the min-width: was 610px instead of 160px; see https://www.w3schools.com/code/tryit.asp?filename=FOK88K6X2LA4 PS: it would be better running this from local server rather than O/S file directory.
  24. MySQL issues with query

    Firstly, Sorry about the lack of detail in the title, i'm not sure how to describe what i'm trying to achieve without going into detail. So I have a table: mysql> SELECT * FROM notes; +----+---------+-----------------+---------------------+----------+ | id | user_id | note | datetime | order_id | +----+---------+-----------------+---------------------+----------+ | 1 | 7 | Update Please? | 2018-02-16 22:22:18 | 1 | | 2 | 6 | Update Provided | 2018-02-16 22:25:18 | 1 | | 3 | 7 | test | 2018-02-17 10:03:20 | 2 | +----+---------+-----------------+---------------------+----------+ I'm trying to get the most recent row for each order_id. from the data above it result would be: Rows 2 and 3. I thought using a subquery would be the best way to go but i'm getting unexpected result: If i run the first part of the query I do get ID row 2 and 3 (which is a good sign). SELECT DISTINCT (order_id) FROM notes; If i run the second part of the query: I do get one result. SELECT user_id FROM notes WHERE order_id=1 ORDER BY datetime DESC LIMIT 1; When I combine both queries together I get an odd result. SELECT DISTINCT (order_id), user_id = (SELECT user_id FROM notes tbl2 WHERE tbl2.order_id=tbl.order_id ORDER BY datetime DESC LIMIT 1) FROM notes tbl; RESULT: +----------+------------------------------------------------------------------------------------------------------------+ | order_id | user_id = (SELECT user_id FROM notes tbl2 WHERE tbl2.order_id=tbl.order_id ORDER BY datetime DESC LIMIT 1) | +----------+------------------------------------------------------------------------------------------------------------+ | 1 | 0 | | 1 | 1 | | 2 | 1 | +----------+------------------------------------------------------------------------------------------------------------+ 3 rows in set (0.01 sec) Could anyone point me where i am going wrong? If it helps i'm actually only interested in getting the last row matches a specific value (7), but i just planned on doing this match with PHP if($user_id==7) //echo Will Display Data;
  25. Menu Whitespace

    .navbar { overflow: hidden; background-color: #FD7012; font-family: Arial, Helvetica, sans-serif; } .navbar a { float: left; font-size: 16px; color: white; text-align: center; padding: 14px 16px; text-decoration: none; } .dropdown { float: left; overflow: hidden; } .dropdown .dropbtn { font-size: 16px; border: none; outline: none; color: white; padding: 14px 16px; background-color: inherit; font-family: inherit; margin: 0; } .navbar a:hover, .dropdown:hover .dropbtn { background-color: black; } .dropdown-content { display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; } .dropdown-content a { float: none; color: black; padding: 12px 16px; text-decoration: none; display: block; text-align: left; } .dropdown-content a:hover { background-color: #ddd; } .dropdown:hover .dropdown-content { display: block; } .red a:hover { background-color: red; } .lightblue a:hover { background-color: #1da1f2; } .blue a:hover { background-color: #365899; }
  26. Menu Whitespace

    <!DOCTYPE hml> <html> <head> <title> Dashie </title> <link rel='stylesheet' href='CSS.css'> </head> <body> <div class="navbar"> <a href="#home">Home</a> <div class="dropdown"> <button class="dropbtn">Links </button> <div class="dropdown-content"> <div class='red'> <a href="https://www.youtube.com/user/DashieGames"><img src="yt_logo_rgb_light.png" style='width:10%'/></a> </div> <div class='lightblue'> <a href="https://twitter.com/DashieXP"><img src="7194920_orig.png" style='width:10%'/></a> </div> <div class='blue'> <a href="https://www.facebook.com/brokenxbox/"><img src="yt_logo_rgb_light.png" style='width:100px'/></a> </div> </div> </div> </div> </div> </body> </html>
  27. 403 Forbidden

    If you're using cURL to send a request then maybe you're including the source headers which is going to show things like referer, it sounds like the problem is there.
  28. The .newspaper style in HTML 5.

    Ahhh i see the problem, but my username apparently prohibits me from giving the solution, sorry!
  29. The .newspaper style in HTML 5.

    Attention: W3Schools.com staff: Included below is the HTML 5 code for a web page I am designing. It consists of an embedded video file with a 3-column newspaper-style article after it. Everything appears to be formatted correctly, except that the first column of the article is shifted down one line, so that the top of that column is not perfectly aligned with the tops of the other two columns. Thank you ( see Colossians 3:15, for example ) for your help. Keep in touch. Sincerely in Christ, Russell E. Willis P.S. - Please read Proverbs 23:23. <!DOCTYPE html> <html> <head> <style> .newspaper { -webkit-column-count: 3; -moz-column-count: 3; column-count: 3; } div { text-align: justify; text-justify: inter-word; } p { text-indent: 20px; } h4 { text-align: center; } </style> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>The Holy Bible.</title> </head> <body> <h3><ins>Please view the video sermon and read the article, below, regarding the book of Revelation:</ins></h3> <center><video width="650" height="500" controls> <source src="c:\Apache24\Apache24\htdocs\pecm\The_book_of_Revelation_1a.mp4" type="video/mp4"> <source src="c:\inetpub\wwwroot\vsom\Modest_apparel_1a.ogg" type="video/ogg"> </video></center> <br> <h4><ins>Revelation.</ins></h4> <div class="newspaper"><p> The book of Revelation is the last book of the New Testament and, thus, the last book of the Holy Bible. It has twenty-two chapters. The author of this book was the apostle John. The writing style of this book is apocalyptic in nature. The following quotation is provided: "Just as Genesis is the book of beginnings, Revelation is the book of consummation." [ See <i><b>Holy Bible</b>: Containing The Old and New Testaments</i>, The New King James Version, RED LETTER EDITION, <b>THE NEW OPEN BIBLE<sup>&#174</sup> STUDY EDITION</b>, with Read-Along References<sup>&#174</sup>, Read-Along Translations<sup>&#174</sup>, Topical Index to the Bible, The Christian's Guide to the New Life, Book Introductions and Outlines, Visual Survey of the Bible, Special Study Aids, THOMAS NELSON PUBLISHERS, <i>Nashville</i>, <b>Copyright &#169 1990, 1985, 1983 by Thomas Nelson, Inc.</b>, p. 1513. ]</p> </div> </body> </html>
  1. Load more activity
×