Jump to content

jasonc310771

Members
  • Posts

    50
  • Joined

  • Last visited

Everything posted by jasonc310771

  1. we after a time... this is what I have and all works so far apart from date fields. I need to make sure none of the dates over lap another group. But just can not get this to work. <!DOCTYPE html> <html> <head> <title></title> <style> .error { background-color: red; } </style> </head> <body> <form id="my-form"> <div class="group"> <input type="text" name="name[]" required><br> <input type="number" name="price[]" required><br> <input type="date" name="start[]" class="start" required> <input type="date" name="end[]" class="end" required> </div> <br> <div class="group"> <input type="text" name="name[]" required><br> <input type="number" name="price[]" required><br> <input type="date" name="start[]" class="start" required> <input type="date" name="end[]" class="end" required> </div> <br> <div class="group"> <input type="text" name="name[]" required><br> <input type="number" name="price[]" required><br> <input type="date" name="start[]" class="start" required> <input type="date" name="end[]" class="end" required> </div> <input type="submit" value="Submit"> </form> <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> <script> $(document).ready(function() { // Add error class to empty fields $('form').on('blur', 'input', function() { var value = $(this).val(); if (value === '') { $(this).addClass('error'); } else { $(this).removeClass('error'); } }); // Validate date fields $('form').on('change', '.start, .end', function() { var startDate = $(this).closest('.group').find('.start').val(); var endDate = $(this).closest('.group').find('.end').val(); alert('startDate ' + startDate + ' | endDate ' + endDate); // Check if date is in the past //var currentDate = new Date(); const date = new Date(); var currentDate = date.toLocaleDateString('en-GB').split('/').reverse().join('-'); // '2021-11-24' alert(currentDate); if (startDate < currentDate || endDate < currentDate) { $(this).addClass('error'); } else { $(this).removeClass('error'); } // Check if start date is after end date if (startDate > endDate) { $(this).closest('.group').find('.end').addClass('error'); } else { $(this).closest('.group').find('.end').removeClass('error'); } // Check if start date conflicts with other groups var startDates = $('.start').not($(this)); startDates.each(function() { var otherStartDate = new Date($(this).val()); if (startDate > otherStartDate) { $(this).addClass('error'); } else { $(this).removeClass('error'); } }); }); // Allow one group to use the same start date as another group's end date $('form').on('change', '.start', function() { var startDate = new Date($(this).val()); var endDates = $('.end').not($(this).closest('.group').find('.end')); endDates.each(function() { var otherEndDate = new Date($(this).val()); if (startDate.getTime() === otherEndDate.getTime()) { $(this).removeClass('error'); } }); }); // Prevent form submission if there are errors $('form').on('submit', function(event) { var errors = $('.error'); if (errors.length > 0) { event.preventDefault(); alert('Please fill in all required fields correctly.'); } }); }); </script> </body> </html>
  2. So now I have it change the BG color, but on every field with theat class name. How do I correctly add to the class to just the one being checked by the onchange click and not all that have the same name ? function checkFormOK(field) { //alert( field + ' ' + $('input:text').val()); // When a field is changed, check if it is empty, if so, mark as red. if (field == 'n') { // process the names. if ($('input:text').val().length == 0) { // alert('empty'); $('.n').addClass('formError'); // does not change the BG color. } else { $('.n').removeClass('formError'); } } // if (field == 'p') { // process the prices. // } // When a date field is changed, check if the dates entered overlap any of the other dates in other groups. // if (field == 's' || field == 'e') { // process the dates. // } }
  3. And using AddClass is not adding to the class function checkFormOK(field) { //alert( field + ' ' + $('input:text').val()); // When a field is changed, check if it is empty, if so, mark as red. if (field == 'n') { // process the names. if ($('input:text').val().length == 0) { // alert('empty'); $(this).addClass('formError'); // does not change the BG color. } else { $(this).removeClass('formError'); } } // if (field == 'p') { // process the prices. // } // When a date field is changed, check if the dates entered overlap any of the other dates in other groups. // if (field == 's' || field == 'e') { // process the dates. // } }
  4. Slowly getting there with yet more hours of trial and error, story of my entire life... I now know which one of the group is being checked and got the value from the input. Just to get the BG to change. function checkFormOK(field) { alert( field + ' ' + $('input:text').val()); // When a field is changed, check if it is empty, if so, mark as red. if (field == 'n') { // process the names. if ($('input:text').val().length == 0) { $(this).attr('class', 'n formError'); // does not change the BG color. } else { $(this).attr('class', 'n'); } } // if (field == 'p') { // process the prices. // } // When a date field is changed, check if the dates entered overlap any of the other dates in other groups. // if (field == 's' || field == 'e') { // process the dates. // } }
  5. So I have removed all reference to IDs. But still not able to get the value of the input or set the BG color of the fields if they are empty. <!DOCTYPE html> <html lang="en"> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link href="scripts/jquery-ui.css" rel="stylesheet"> <script src="scripts/jquery-2.0.3.min.js"></script><?php // this line nust be first before the jquery-ui.js ?> <script src="scripts/jquery-ui.js"></script> <style> .eventGroup { float: left; padding: 0 3em 3em 0; } .eventGroup .n, .eventGroup .p { width: 20em; } .eventGroup .s, .eventGroup .e { float: left; width: 10em; } .addMore { padding-right: 1.5em; } .formError { background-color: #FF4747; } </style> <script> $(document).ready(function(){ $(".addMore").click(function(){ var fieldHTML = '<div class="eventGroup">'+$(".eventGroupCopy").html()+'</div>'; $('body').find('.eventGroup:last').after(fieldHTML); });//add more fields group $("body").on("click",".remove",function(){ $(this).parents(".eventGroup").remove(); });//remove fields group }); function checkFormOK(field) { alert(field + ' ' + $(this).find('value').val()); // When a field is changed, check if it is empty, if so, mark as red. if (field == 'n') { // process the names. if ($(this).find('value').val() == '') { $(this).attr('class', 'n formError'); // does not change the BG color. } else { $(this).attr('class', 'n'); } } if (field == 'p') { // process the prices. } // When a date field is changed, check if the dates entered overlap any of the other dates in other groups. if (field == 's' || field == 'e') { // process the dates. } } /* // When a date field is changed, check if the dates entered overlap any of the other dates in other groups. //var startDates = document.getElementsByClassName('s'); //var endDates = document.getElementsByClassName('e'); // for (let s = 0; s < startEndDates.length; s++) { // for (let e = 0; e < startEndDates.length; e++) { //console.log(groups[i].value); if (s1 != s2) { // do not check a group with itself !, skip to next one. if (document.getElementsByClassName('s' + s1).value >= document.getElementsByClassName('s' + s2).value && document.getElementsByClassName('e' + s1).value < document.getElementsByClassName('e' + s2).value) { document.getElementsByClassName('s' + s1).className = 'se formError'; document.getElementsByClassName('s' + s2).className = 'se formError'; document.getElementsByClassName('e' + s1).className = 'se formError'; document.getElementsByClassName('e' + s2).className = 'se formError'; } } // } // } */ </script> </head> <body> <form method="post" action="editDatePrices.php"> <div class="centerText"> <div class="eventGroup"> <input class="n" onchange="checkFormOK('n')" type="text" name="eventName[]" placeholder="Enter name" value="Event 1"><br> <input class="p" onchange="checkFormOK('p')" type="number" name="price[]" placeholder="Enter Price i.e.&nbsp;&nbsp;&nbsp;1000&nbsp;&nbsp;&nbsp;no decimals" value="123"><br> <input class="s" onchange="checkFormOK('s')" type="date" name="eventStart[]" value="2023-08-13"> <input class="e" onchange="checkFormOK('e')" type="date" name="eventEnd[]" value="2023-08-14"> <div class="clearFloat"></div> <a href="javascript:void(0)" class="remove">Remove</a> </div> <div class="eventGroup"> <input class="n" onchange="checkFormOK('n')" type="text" name="eventName[]" placeholder="Enter name" value="Event 1"><br> <input class="p" onchange="checkFormOK('p')" type="number" name="price[]" placeholder="Enter Price i.e.&nbsp;&nbsp;&nbsp;1000&nbsp;&nbsp;&nbsp;no decimals" value="123"><br> <input class="s" onchange="checkFormOK('s')" type="date" name="eventStart[]" value="2023-08-13"> <input class="e" onchange="checkFormOK('e')" type="date" name="eventEnd[]" value="2023-08-14"> <div class="clearFloat"></div> <a href="javascript:void(0)" class="remove">Remove</a> </div> <div class="eventGroup" style="display: none;"></div> <div class="clearFloat"></div> </div> <br><a href="javascript:void(0)" class="addMore">Add more</a> <input type="submit" name="submit" value="SUBMIT" onclick="checkFormOK()"> </form> <!-- copy of input fields group --> <div class="eventGroupCopy" style="display: none;"> <input class="n" onchange="checkFormOK('n')" type="text" name="eventName[]" placeholder="Enter Event Name" value=""><br> <input class="p" onchange="checkFormOK('p')" type="number" name="price[]" placeholder="Enter Price" value=""><br> <input class="s" onchange="checkFormOK('s')" type="date" name="eventStart[]" value=""> <input class="e" onchange="checkFormOK('e')" type="date" name="eventEnd[]" value=""><br> <a href="javascript:void(0)" class="remove">Remove</a><br> </div> </body> </html>
  6. This is what I have at the moment... This is using IDs, how do I get the same results without using IDs as I was unable to add a new ID to the new group, also if one is deleted then their is a number missing which causes problems with the checker. <!DOCTYPE html> <html lang="en"> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link href="scripts/jquery-ui.css" rel="stylesheet"> <script src="scripts/jquery-2.0.3.min.js"></script> <script src="scripts/jquery-ui.js"></script> <style> .eventGroup { float: left; padding: 0 3em 3em 0; } .eventGroup .np { width: 20em; } .eventGroup .se { float: left; width: 10em; } .addMore { padding-right: 1.5em; } .formError { background-color: #FF4747; } </style> <script> $(document).ready(function(){ $(".addMore").click(function(){ var fieldHTML = '<div class="eventGroup">'+$(".eventGroupCopy").html()+'</div>'; $('body').find('.eventGroup:last').after(fieldHTML); // find last group, change ID to n p s e with next number. // var eg = $('#form .eventGroup').length; // document.getElementById('n').setAttribute('id', 'n' + (eg + 1)); // document.getElementById('p').setAttribute('id', 'p' + (eg + 1)); // document.getElementById('s').setAttribute('id', 's' + (eg + 1)); // document.getElementById('e').setAttribute('id', 'e' + (eg + 1)); // var lastChildID = lastChild.id; // add the ID element to the newly added div group, with +1 of the count of divs with the class eventGroup // newEventGroup.setAttribute("id", "eg + 1"); });//add more fields group $("body").on("click",".remove",function(){ $(this).parents(".eventGroup").remove(); });//remove fields group }); function checkFormOK() { //alert($('.eventGroup').length - 1); // When a field is changed, check if it is empty, if so, mark as red. for (var id = 0; id < $('.eventGroup').length - 1; id++) { //alert(id); if ($('#n' + id).val() == '') { document.getElementById('n' + id).className = 'np formError'; } else { document.getElementById('n' + id).className = 'np'; } if ($('#p' + id).val() == '') { document.getElementById('p' + id).className = 'np formError'; } else { document.getElementById('p' + id).className = 'np'; } if ($('#s' + id).val() == '') { document.getElementById('s' + id).className = 'se formError'; } else { document.getElementById('s' + id).className = 'se'; } if ($('#e' + id).val() == '') { document.getElementById('e' + id).className = 'se formError'; } else { document.getElementById('e' + id).className = 'se'; } } // When a date field is changed, check if the dates entered overlap any of the other dates in other groups. for (var s1 = 0; s1 < $('.eventGroup').length - 1; s1++) { for (var s2 = 0; s2 < $('.eventGroup').length - 1; s2++) { if (s1 != s2) { // do not check a group with itself !, skip to next one. if (document.getElementById('s' + s1).value >= document.getElementById('s' + s2).value && document.getElementById('e' + s1).value < document.getElementById('e' + s2).value) { document.getElementById('s' + s1).className = 'se formError'; document.getElementById('s' + s2).className = 'se formError'; document.getElementById('e' + s1).className = 'se formError'; document.getElementById('e' + s2).className = 'se formError'; } } } } } </script> </head> <body> <form method="post" action="editDatePrices.php"> <div class="centerText"> <div class="eventGroup"> <input class="np" id="n0" onchange="checkFormOK()" type="text" name="eventName[]" placeholder="Enter name" value="Event 1"><br> <input class="np" id="p0" onchange="checkFormOK()" type="number" name="price[]" placeholder="Enter Price i.e.&nbsp;&nbsp;&nbsp;1000&nbsp;&nbsp;&nbsp;no decimals" value="123"><br> <input class="se" id="s0" onchange="checkFormOK()" type="date" name="eventStart[]" value="2023-08-13"> <input class="se" id="e0" onchange="checkFormOK()" type="date" name="eventEnd[]" value="2023-08-14"> <div class="clearFloat"></div> <a href="javascript:void(0)" class="remove">Remove</a> </div> <div class="eventGroup"> <input class="np" id="n1" onchange="checkFormOK()" type="text" name="eventName[]" placeholder="Enter name" value="Event 1"><br> <input class="np" id="p1" onchange="checkFormOK()" type="number" name="price[]" placeholder="Enter Price i.e.&nbsp;&nbsp;&nbsp;1000&nbsp;&nbsp;&nbsp;no decimals" value="123"><br> <input class="se" id="s1" onchange="checkFormOK()" type="date" name="eventStart[]" value="2023-08-13"> <input class="se" id="e1" onchange="checkFormOK()" type="date" name="eventEnd[]" value="2023-08-14"> <div class="clearFloat"></div> <a href="javascript:void(0)" class="remove">Remove</a> </div> <div class="eventGroup" style="display: none;"></div> <div class="clearFloat"></div> </div> <br><a href="javascript:void(0)" class="addMore">Add more</a> <input type="submit" name="submit" value="SUBMIT" onclick="checkFormOK()"> </form> <!-- copy of input fields group --> <div class="eventGroupCopy" style="display: none;"> <input class="np" id="n" type="text" name="eventName[]" placeholder="Enter Event Name"><br> <input class="np" id="p" type="number" name="price[]" placeholder="Enter Price"><br> <input class="se" id="s"type="date" name="eventStart[]" value=""> <input class="se" id="e"type="date" name="eventEnd[]" value=""><br> <a href="javascript:void(0)" class="remove">Remove</a><br> </div> </body> </html>
  7. If not using IDs ! Then I am now trying to get the value of the item that calls the checkFormOK() function checkFormOK() { var nameValue = $(this).val(); alert(nameValue); } Even though this does not work. It was just to test if I could get the value of the input field that just changed. But no way of know what field called it or which group the input field is in. Which is why I had previously used IDs. But now see that when I add or remove a new group the number is not added to new groups and the one that is removed means that I am missing a group number that causes the checkFormOK to break, even though I might of been able to check if it exists before doing a check. There are only three checks: To check that each field has content, if not change background color. If the dates entered in each group is valid That no date range in each group overlaps that of another groups date range.
  8. Ah, thank you. I actually know very lttle, of JavaScript or jquery. Just reading and trying to figure it out based on the knowledge I have other other languages. The simple stuff I get there in the end. But this is all different.
  9. What other methods should I be looking at if I should stop using IDs ?
  10. Without the IDs how can I use the onClick error check to make sure the form is filled out correctly ? One field is just text (n1), make sure the (n) fields are not duplicated text of another (n) the next is a number only (p1), only check it is a number and not more than say 100000 the last two are named start (s1) and end (e1) cross reference each groups start end to make sure that they do not overlap the other groups start/end dates Each group has a different number so the error checker will highlight which boxes needs attention.
  11. What website/s can I check out to read all about JavaScript like I can do for PHP on php.net ?
  12. I have an add more link that dynamically adds new fields, but these do not have a number after the initial letter. How could I change the ID element of the newest fields to have the next number after the count of eventGroup divs. $(document).ready(function(){ $(".addMore").click(function(){ var fieldHTML = '<div class="eventGroup">'+$(".eventGroupCopy").html()+'</div>'; $('body').find('.eventGroup:last').after(fieldHTML); // find last group, change ID to n p s e with next number. var eg = $('.eventGroup').length; // add the ID element to the newly added div group, with +1 of the count of divs with the class eventGroup });//add more fields group $("body").on("click",".remove",function(){ $(this).parents(".eventGroup").remove(); });//remove fields group }); <!-- copy of input fields group --> <div class="eventGroupCopy" style="display: none;"> <input class="np" id="n" type="text" name="eventName[]" placeholder="Enter Event Name"><br> <input class="np" id="p" type="number" name="price[]" placeholder="Enter Price"><br> <input class="se" id="s"type="date" name="eventStart[]" value=""> <input class="se" id="e"type="date" name="eventEnd[]" value=""><br> <a href="javascript:void(0)" class="remove">Remove</a><br> </div>
  13. So after some hours playing around with different code found here and there... I have opted to create a test page using the basic type=date All ok so far, but then I remembered why I went with datepicker... The format shown in the field. I really need it to show the full month name, as both UK and US visitors may use the site and this will cause the site to break if a US visitor uses 12-25-2023 ! so if someone uses 11-12-23, is it 12 November 2023 or 11 December 2023 ! How do I change the format of the input type to 'd F Y' ? Yes I know the type=date shows the format required and you can not on my PC change the date manually, but what if this feature does not show correctly on their device, then they are left to enter manually.
  14. After reading yet more documentation... I now have this... But the added groups datepicker does not show the calendar. If I understand it correctly, I need to reinitialise the datepicker of the new group, but using the initPicker() does not seem to work. Even though it is initionising the others. <script> function initPicker() { $(function() { $( ".datepicker" ).datepicker({ defaultDate: "+1w", changeMonth: true, numberOfMonths: 1, onClose: function( selectedDate ) { //$( ".datepicker" ).datepicker( "option", "minDate", selectedDate ); } }); }); } initPicker(); $(document).ready(function(){ $(".addMore").click(function(){ var fieldHTML = '<div class="eventGroup">'+$(".eventGroupCopy").html()+'</div>'; $('body').find('.eventGroup:last').after(fieldHTML); initPicker();alert("1"); });//add more fields group $("body").on("click",".remove",function(){ $(this).parents(".eventGroup").remove(); });//remove fields group }); </script> <form method="post" action="editSpecialDatePrices.php"> <?php if ($getEventDetails->num_rows != 0) { while($eventDetail = $getEventDetails->fetch_assoc()) { ?> <div class="eventGroup"> <input type="text" name="eventName[]" placeholder="Enter name" value="<?php echo($eventDetail['eventName']); ?>"><br> <input type="text" name="price[]" placeholder="Enter Price" value="<?php echo($eventDetail['pricePerNight']); ?>"><br> <input class="datepicker" type="text" name="eventStart[]" placeholder="<?php echo(date('d F Y', time())); ?>" value="<?php echo(date("d F Y", strtotime($eventDetail['eventStart']))); ?>"><br> <input class="datepicker" type="text" name="eventEnd[]" placeholder="<?php echo(date('d F Y', strtotime('+7 days'))); ?>" value="<?php echo(date("d F Y", strtotime($eventDetail['eventEnd']))); ?>"><br> <a href="javascript:void(0)" class="remove">Remove</a> </div> <?php } } ?> <div class="eventGroup" style="display: none;"></div> <a href="javascript:void(0)" class="addMore">Add more</a> <input type="submit" name="submit" value="SUBMIT"/> </form> <!-- copy of input fields group --> <div class="eventGroupCopy" style="display: none;"> <input type="text" name="eventName[]" placeholder="Enter Event Name"><br> <input type="text" name="price[]" placeholder="Enter Price"><br> <input class="datepicker" type="text" name="eventStart[]" placeholder="<?php echo(date('d F Y', time())); ?>" value=""><br> <input class="datepicker" type="text" name="eventEnd[]" placeholder="<?php echo(date('d F Y', strtotime('+7 days'))); ?>" value=""><br> <a href="javascript:void(0)" class="remove">Remove</a><br><br> </div>
  15. I did try this method to start with but what ever the reason was it did not work well (lack of understanding maybe) Using datepicker work brilliantly for this so far, I just stumbled on an issue when I have the date picker in more than one group.
  16. Digging around a little more, I found this... The first group datepickers work correctly, but adding new groups the datepicker does not work. How do I get the datepickers to work no matter how many groups I add ? <script> $(function() { <!--$.datepicker.setDefaults($.datepicker.regional['fi']);--> $( "#from" ).datepicker({ defaultDate: "+1w", changeMonth: true, numberOfMonths: 1, onClose: function( selectedDate ) { $( "#to" ).datepicker( "option", "minDate", selectedDate ); } }); $( "#to" ).datepicker({ defaultDate: "+1w", regional: "fi", changeMonth: true, numberOfMonths: 1, onClose: function( selectedDate ) { $( "#from" ).datepicker( "option", "maxDate", selectedDate ); } }); }); $(document).ready(function(){ $(".addMore").click(function(){ var fieldHTML = '<div class="eventGroup">'+$(".eventGroupCopy").html()+'</div>'; $('body').find('.eventGroup:last').after(fieldHTML); });//add more fields group $("body").on("click",".remove",function(){ $(this).parents(".eventGroup").remove(); });//remove fields group }); </script> <form method="post" action="edit.php"> <?php // if ($getEventDetails->num_rows == 0) { // while($eventDetail = $getEventDetails->fetch_assoc()) { ?> <div class="eventGroup"> <input type="text" name="eventName[]" placeholder="Enter name" value="<?php //if($_POST[) { } else { } ?>"><br> <input type="text" name="price[]" placeholder="Enter Price"><br> <input type="text" id="from" name="eventStart[]" placeholder="Enter Start Date"><br> <input type="text" id="to" name="eventEnd[]" placeholder="Enter End Date"><br> <a href="javascript:void(0)" class="remove">Remove</a> </div> <?php // } // } ?> <div class="eventGroup" style="display: none;"></div> <a href="javascript:void(0)" class="addMore">Add more</a> <input type="submit" name="submit" value="SUBMIT"/> </form> <!-- copy of input fields group --> <div class="eventGroupCopy" style="display: none;"> <input type="text" name="eventName[]" placeholder="Enter Event Name"><br> <input type="text" name="price[]" placeholder="Enter Price"><br> <input type="text" id="from" name="eventStart[]" placeholder="Enter Start Date"><br> <input type="text" id="to" name="eventEnd[]" placeholder="Enter End Date"><br> <a href="javascript:void(0)" class="remove">Remove</a><br><br> </div>
  17. I am wanting to have my page add a new row of fields not just the one as in this script. So when submitted I can save each group of fields in to the DB. The save to DB I hope will be simple. But its getting the new row of fields added to the form that I am not able to do. <form id="form" method="POST" action="save_data.php"> <input type="text" name="text_field[]"> <button type="submit">SUBMIT</button> </form> <button onclick="add_field()">ADD FIELD</button> <script> function add_field(){ var x = document.getElementById("form"); // create an input field to insert var new_field = document.createElement("input"); // set input field data type to text new_field.setAttribute("type", "text"); // set input field name new_field.setAttribute("name", "text_field[]"); // select last position to insert element before it var pos = x.childElementCount; // insert element x.insertBefore(new_field, x.childNodes[pos]); } </script>
  18. I am trying to get an iframe to have its height the same as the viewpoint I have got it to be 100% wide but can not get it to fill the page. Please can someone suggest how I might do this? <!DOCTYPE html> <html lang="en" xml:lang="en"> <head> <title>Title</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="w3.css"> <link rel="stylesheet" href="styles.css"> </head> <body> <div class="w3-main"><!-- margin: 180px 0em 70px 0em; --> <div class="mainContent w3-row"><!-- mainContent margin-left: 1%; margin-right: 1%; --> <h3>Virtual tour</h3> <div class="width100pc"> <iframe src="https://www.example.com/thepage.php" class="tour"></iframe><!-- tour width: auto; width: 100%; height: 100%; max-height: 600px; --> </div> <div class="w3-container"> <div class="w3-row"> 00. <a href="00.php" class="link1">more</a><br><br> 00. <a href="00.php" class="link1" aria-label="00">more</a><br><br> 00. <a href="00.php" class="link1" aria-label="00">more</a><br><br> 00. <a href="00.php" class="link1" aria-label="Read more about ">more</a><br><br> 00. <a href="00.php" class="link1">more</a> </div> </div> </div> </div> </body> </html>
  19. I have a feeling someone is sending their spam to me using other means and not via the websites contact page form. What other checks should I use to ensure it came from my website and not somewhere else ?
  20. I have the following PHP code that links my site to Google Analytics but get errors viewing Console in my browser. echo("<!-- Google Analytics GA4 --><!-- Google tag (gtag.js) --><script defer src='https://www.googletagmanager.com/gtag/js?id=" . googleAnalyticsGA4ID . "'></script> <script defer>window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date());gtag('config', '" . googleAnalyticsGA4ID . "', { cookie_flags: 'max-age=7200;secure;SameSite=None'});</script>"); Cookie “PHPSESSID” does not have a proper “SameSite” attribute value. How do I fix this ? TIA
  21. Think I'll opt to do in PHP with two queries and filter out the first ten from the second results.
  22. The table still remains and showed error that table already exists.
  23. OK, I'll try this for a while and see if my error log shows any issues. Thank you.
  24. No, using the temp table still not going to work. If the visitor views the page with the top ten and the rest underneath on their first visit, and remain on the site to view other pages and then come back to the home page they will likely get error that the table already exists.
×
×
  • 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.