• Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by dsonesuk

  1. Actually thinking about it, you could just add 3rd step parameter of 2 to give same result foreach (range(1, 3, 2 ) as $staffboxsnumber ) { //rest of code }
  2. Create array to hold the identifier to remove, and create if condition <?php $do_not_displayArray[2]; foreach (range(1, 3 ) as $staffboxsnumber ) { if(!in_array($staffboxsnumber, $do_not_displayArray)){ ?> <div class="view-staff" > <div class="view-staff-name"> <h3><?php echo esc_attr(innovation_get_option('staffboxes-title' . $staffboxsnumber, 'OUR PROUD STAFF '. $staffboxsnumber )); ?></h3> <p><?php echo esc_attr(innovation_get_option('staffboxes-description' . $staffboxsnumber, 'Service Executive' )); ?></p> </div> <div class="view-staff-back social-link"> <a href="<?php echo esc_url(innovation_get_option('staffboxes-linka' .$staffboxsnumber, 'http://wordpress.org' )); ?>"></a> <a href="<?php echo esc_url(innovation_get_option('staffboxes-linkb' .$staffboxsnumber, 'http://wordpress.org' )); ?>"></a> <a href="<?php echo esc_url(innovation_get_option('staffboxes-linkc' .$staffboxsnumber, 'http://wordpress.org' )); ?>"></a> <a class="profile-link" href="<?php echo esc_url(innovation_get_option('staffboxes-link' . $staffboxsnumber, '#' )); ?>">→</a> </div> <img src="<?php echo esc_url(innovation_get_option('staffboxes-image' . $staffboxsnumber, get_template_directory_uri() . '/images/stf'. $staffboxsnumber . '.jpg')); ?>" /> </div> <?php } } ?>
  3. IF you use a decent editor, it should highlight such errors.
  4. font-wieght:bold; Should be font-weight:bold;
  5. Lets say you loop through the 'for loop' twice, you will get <table> <tr><td></td><td></td></tr> <table> <tr><td></td><td></td></tr> </table> For every opening <table> tag there must be a equally corresponding closing </table> tag, even though your table layout is incomplete and wrong, your browser will correct this by adding closing </table> before second <table>, and therefore will show two tables, because two loops equals two opening table tags with single <tr> row, with two <td> cells showing data. Whereas document.writeln('<table border="1">'); for (var i = 0; i < courseCodeArray.length; i++) { document.writeln('<tr>'); document.writeln('<td>'+courseCodeArray+'</td>'); document.writeln('<td>'+gradeValueArray+'</td>'); document.writeln('</tr>'); } document.writeln('</table>'); Will produce <table>(outside before 'for loop') <tr><td></td><td></td></tr> <tr><td></td><td></td></tr> </table>(outside after 'for loop' closing curly bracket '}')
  6. You should check out update here https://www.w3schools.com/php/php_mysql_update.asp 'UpdateGL' should be UPDATE GL, you are not setting the fields to be updated, and don't have where clause, which will cause ALL records to be updated.
  7. The First is the correct meaning not second, attribute name = "noGL22" with 22 coming from field 'TLZno' from database table row, So $_POST["noGL" . $_POST["TLZno"]]; will equal whatever value is in input with attribute name "noGL22". which at present will be 8888. You have two name attributes (name="new") for single input though which is not allowed.
  8. Then it should be $NewValue = $_POST["noGL"] . $_POST["TLZno"]; Which will mean $NewValue will equal '888822'
  9. Is this right? $NewValue = $_POST["noGL" . $_POST["TLZno"]]; If $_POST["TLZno"]] = "test" You are attempting to get value from $_POST array with name of "noGLtest" ($_POST["noGLtest"]) OR are you trying join both values If $_POST["noGL"] = "BillAnd" and $_POST["TLZno"] ="Ben, So $NewValue will equal "BillAndBen"
  10. That is what you have programed it to do, every grade etc in the for loop create opening table tag, and because you don't have a closing table tag, when it loops again, it adds the closing table tag for you. The opening and closing table tags <table>.....</table> should be outside the for loop for single table, inside for multiple tables.
  11. canvas

    The original code works in most browsers Chrome,IE11 +, Edge, Opera, but! Not Firefox while the code from op works in all these browsers.
  12. That is such an impractical way of using specific class for specific color, i doubt any professional would ever consider looking or using it. Consider multiple page using that library, and in future you want to change the theme colour, you have to change ALL of those specific color classes on ALL elements in ALL pages to the alternative theme colour? Whereas you could just set up primary, secondary etc colour classes, adjust the colours to new theme colour, and bam! Instantly the changes are made.
  13. The code at http://w3schools.invisionzone.com/index.php?/topic/56661-help-with-float/#comment-311732 Only affected the ul and li elements with parent element class of 'menu', like I mentioned in another topic, doing it this way makes it more manageable, as any other ul, li used without parent 'menu' class, will not be styled as used for navigation menu ul, li elements. Instead of class you can place the unordered list elements within nav element then use nav ul {...} nav li {...} So any ul, li elements within nav element will be styled differently from any used on its own or within a div anywhere else within the page.
  14. It really depends on the users browser setting for pdf file type, most browsers by default will use pdf browser plugin specifically for viewing in browser, but if the user changes from default to use browser plugin, to 'always ask' it will show 'download' or 'open with' which could be browser plugin or operating system Adobe reader program. Since it depends on browser settings, you can still use open pdf directly in browser php script for browsers using pdf plugin, then they will presented with alternative to 'save' or 'open with' with an alternative pdf application option. Note: the 'downloaded' part file can be called anything' even original filename, it just renames filename to 'downloaded.pdf' even if original filename was 'test.pdf'.
  15. Lose all html, the header() code should be at very top on newline after php opening tag, there should be no space or empty newline break before php opening tag. The link will go to this page with necessary information about file to view, the header() info along with readfile() will inform the page to open file directly in browser, so no html is required. NOTE: if browser option is to 'ask what to do' for this type of file (.pdf), it will still download instead, if download is selected.
  16. You need to go to a php page with header set for viewing in browser similar to https://www.w3schools.com/php/func_http_header.asp force download script <?php header("Content-type:application/pdf"); // It will be called downloaded.pdf header("Content-Disposition:attachment;filename='downloaded.pdf'"); // The PDF source is in original.pdf readfile("original.pdf"); ?> But replacing 'header("Content-Disposition:attachment;filename='downloaded.pdf'");' with 'header("Content-Disposition: inline; filename="filename.pdf");' You can use link to send filename to this file through querystring and read through $_GET['....']; So one php page for all viewable only pdf files.
  17. Its because of width 100%; but! mainly float: left .w3-bar-block .w3-bar-item{ width:100%; display:block; padding:8px 16px; text-align:left; border:none; outline:none; white-space:normal } .w3-bar .w3-bar-item{ padding:8px 16px; float:left; width:auto; border:none; outline:none; display:block; } IF you set float to none for class selector '.w3-bar-block .w3-bar-item' .w3-bar-block .w3-bar-item{ width:100%; display:block; padding:8px 16px; text-align:left; border:none; outline:none; white-space:normal; float: none; } It should fix the problem, causing container to shrink to largest menu text content.
  18. Because usually how they are set out in the menu layout is the order that is usually required. My solution makes it more manageable.
  19. You should replace the menu container div, and float the ul right, not individual LI elements, if you look they are in the wrong sequential order.
  20. In its present state using height 100% won't work because the body element shrinks to content height also, unless you set set height of html, body elements to 100% height, then use min-height: 100% on .first div. Using px unit on .first div should have worked? Note: the white elements text won't show above background image because it is outside the .first div containment.
  21. Either adjust the height: of .first class div, or place background image in body or html elements.
  22. The last sentence is when you created the form page and thinking that you alone know the full url address to access that page, because that page is not linked to from any other page, that it would be undiscoverable and therefore safe, is untrue.
  23. If you are adding html through a secure form whose access is only achievable through logging on and accessing through username password, then save html content as entered in textarea to database table field, that is how CMS does it. IT then reads that data containing html tags back to page or newsletter, which if email must be in a table structured layout. The images must be saved on server and reference with absolute path NOT relative, or be an encoded image file. IF the form is accessible from none secured area that is when sanitization needs to be taken. IF this page is not linked to in anyway, it can still be found and used to inject code IF NOT accessible ONLY by logging into the form page.
  24. IF it is not going Joe public who can submit ANYTHING, but just you, or someone with Authorization then No, but you can limit the type of html code (such as '<h1><a><p>') that can be submitted using strip_tags(), if not listed, they will be removed even <script> and <?php. Using ' <h3>Q&A</h3>' will convert it to &lt;h3&gt;Q&amp;A&lt;/h3&gt; and without being decoded with htmlspecialchars_decode() will show exactly as <h3>Q&A</h3> NOT as Q&A But you could limit the information submitted, input for title, sub title, content, images, then you control what html tags are used for the Newsletter and where/how this information is used.
  25. Block elements such as div, h1, p fill the width available to them, any element below them will stack below them, if floated or not. A floated element before a block element/s, will cause the block element to merge within it, and even though the block element still take the full width, the text within them will flow to and around the edges of floated element. #1 If you place img element within the first paragraph, which you can because is a inline element and acts similar to text, It will fall below header h1, the first paragraph text will merge to edge of img element as will the second paragraphs text. For adding a div element to .content class div for extra column, you need to float and set its width to requirements.#2 and #3 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" id="viewport" content="target-densitydpi=high-dpi,initial-scale=1.0,user-scalable=no" /> <title>Document Title</title> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> <script type="text/javascript"> </script> <style type="text/css"> * { box-sizing: border-box; } .header, .footer { background-color: grey; color: white; padding: 15px; } .column { float: left; padding: 15px; } .clearfix::after { content: ""; clear: both; display: table; } .menu { width: 25%; } .content { width: 75%; } .menu ul { list-style-type: none; margin: 0; padding: 0; } .menu li { padding: 8px; margin-bottom: 8px; background-color: #33b5e5; color: #ffffff; } .menu li:hover { background-color: #0099cc; } .column.content {float: right;} .column.content > img {float: left; max-width: 25%; margin: 0 8px;} .column.content > div {max-width: 25%;} .column.content > div img {max-width: 100%;} .column.content > div.left {float: left; margin: 0 8px; } .column.content > div.right {float: right; } </style> </head> <body> <div class="clearfix"> <div class="column menu"> <ul> <li>The Flight</li> <li>The City</li> <li>The Island</li> <li>The Food</li> </ul> </div> <div class="column content"><img src="https://www.w3schools.com/w3css/img_lights.jpg" alt=""> <h1>The City #1</h1> <p>Chania is the capital of the Chania region on the island of Crete. The city can be divided in two parts, the old town and the modern city.</p> <p>You will learn more about web layout and responsive web pages in a later chapter.</p> </div> <div class="column content"> <div class="left"><img src="https://www.w3schools.com/w3css/img_lights.jpg" alt=""></div> <h1>The City #2</h1> <p>Chania is the capital of the Chania region on the island of Crete. The city can be divided in two parts, the old town and the modern city.</p> <p>You will learn more about web layout and responsive web pages in a later chapter.</p> </div> <div class="column content"> <div class="right"><img src="https://www.w3schools.com/w3css/img_lights.jpg" alt=""></div> <h1>The City #3</h1> <p>Chania is the capital of the Chania region on the island of Crete. The city can be divided in two parts, the old town and the modern city.</p> <p>You will learn more about web layout and responsive web pages in a later chapter.</p> </div> </div> <div class="footer"> <p>Footer Text</p> </div> </body> </html>