Jump to content

Funce

Moderator
  • Posts

    602
  • Joined

  • Last visited

  • Days Won

    19

Posts posted by Funce

  1. 12 hours ago, Raktim said:

    SO, it does not support 'list' properties. But print result is  ['BMW', 'MAHINDRA', 'HERO', 'KTM'] .

    Expanding on what dsonesuk has said, a more fitting representation of this list is

    [
      0: 'BMW',
      1: 'MAHINDRA',
      2: 'HERO',
      3: 'KTM'
    ] 

    It is technically ordered, just not by what you think.

  2. Hi Roddy,

    Here's what I can piece together from the help file. (If I'm not mistaken, it may be the one you are referring to)

    https://matomo.org/docs/setup-auto-archiving/

     

    `core:archive` is the command being run, much like 'mkdir' or 'cat' in other command lines. I am unsure of whether the command is in two parts and parsed together (archive command of core module) or otherwise. At the bottom of the page, you can see the help output of the command.

    • Like 1
  3. As far as I'm aware, Date objects require complete dates to be created. (Needs a Year and a Day in addition to the month so the whole object works)

    You'll want to put some placeholder year and day values in the format YYYY-MM-DD.

    Something like this would work to create your Date object.

    $dateObj = new DateTime('2000-' . $monthNum . '-01');

    However if you wanted something more concise, just the month number, you could use this.

    $monthName = date('F', strtotime('2000-' . $monthNum . '-01'));
    
  4. 6 hours ago, justsomeguy said:

    mysqli_stmt_error expects a statement identifier returned from mysqli_stmt_init, not a mysqli_stmt object.

    Apologies for the interjection, this isn't exactly correct, both procedural and OO Style use objects as parameters and returns. (mysqli_stmt_init returns a mysqli_stmt object)

    But the advice is still valid, try not to mix them.

  5. Hi there!

    Just a few issues things to fix up and you're good to go!

    • You've got a bunch of HTML comments inside your CSS and your JS, you'll need to change them to proper styles.
    • CSS uses /* code */ for commenting
    • JS uses /* code */ for multiline comments and // code for single line comnments.

     

    Your added elements on your page never have the styling classes added to them. Have a look here for more of the technical details:

    https://www.w3schools.com/howto/howto_js_add_class.asp

    An example for CreateArticleHeader

    function createArticleHeader(text = "Article Heading") {
      var p_ah = document.createElement("p");
      //    alert{"p_ah"};
      p_ah.innerHTML = text;
      p_ah.setAttribute("contenteditable", "true");
      // Add class for styling
      p_ah.classList.add("p_ah"); 
      var content = document.getElementById("content");
      content.appendChild(p_ah);
    }

    In terms of compatibility, as long as you add only one class per use of classList.add, you'll be able to support IE.

    https://developer.mozilla.org/en-US/docs/Web/API/Element/classList

     

    Now because of the way this works, you'll need to change your styling to use

    • .p_ah  instead of #p_ah and change the original Article Heading attributes from id="p_ah" to class="p_ah"
    • And the same for p_tgh and the original Text Paragraph
    <p contenteditable class="p_ah">Article Heading</p>
    .p_ah {
      font-size: 18px;
      font-style: bold;
    }

     

  6. Hi Russel,

    My experience with apache is that localhost normally serves from /htdocs/, so your webpage is possibly making you look for "C:/Apache24/Apache24/htdocs/The_book_of_Revelation_14a.mp4" instead of where it actually is.

    Also is this website hosted on an external server? Or otherwise accessible by multiple devices?

    There are three sorts of links that are common with most websites

    • Absolute Links. (http://localhost/The_book_of_Revelation_14a.mp4) I consider these only useful for external resources on another domain. These look at the exact address specified for resources and pages.
    • Relative Links. (./The_book_of_Revelation_14a.webm OR The_book_of_Revelation_14a.webm) I don't use these normally, because I end up having to move files around a lot. But they're quite nice for linking to other pages that you know are always going to be bundled together. They look for the file relative to the current page that is opened.
    • Relative to Root Links (/The_book_of_Revelation_14a.mp4) I find these links to be excellent, as they nicely translate from my testing environment to the production one without changes. These ones look at the current domain base to find the file.

    May I recommend trying a relative to root link.  (Note the / only)

    <source src="/The_book_of_Revelation_14a.webm" type="video/webm">

     

  7. 7 minutes ago, Ingolme said:

    This is a syntax error: createArticleHeader(text= "Article Heading"). Javascript is not like PHP, you cannot give default values to the function arguments (unless this is an ECMAScript 6 or 7 feature I wasn't aware of, I still wouldn't recommend using it for compatibility reasons).

    Heck sorry about that, that was my advice. Just checked MDN, its a feature of ES2015. Only Internet Explorer doesn't seem to be supported by it. (Had no idea it was 'new')

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Default_parameters

  8. Try this instead

    $sql="SELECT * FROM taxis";

    I don't know any more from your situation to improve it.

  9. Alternatively, instead of my fix earlier, you can add a default parameter. This will fallback to a given value, should it not be included when the function is called.

    function createTextArea(text= "Sample Text") {
              var p_tgh = document.createElement("p");
              p_tgh.innerHTML = text;
              p_tgh.setAttribute("contenteditable", "true");
              var content = document.getElementById("content");
              content.appendChild(p_tgh);
            }

     

  10. function createTextArea(text) {
              var p_tgh = document.createElement("p");
              p_tgh.innerHTML = text;
              p_tgh.setAttribute("contenteditable", "true");
              var content = document.getElementById("content");
              content.appendChild(p_tgh);
            }

    If you call this function with no arguments ie. createTextArea()

    Then inside the function, the value of text is undefined. Because text hasn't been defined to be anything.

  11. There's a lot of errors in your code:

    JS

    • Variable names can't have .'s in them. Make them like p_tgh
    • createElement literally creates an element of that type. This isn't the behaviour you desire. <p.tgh></p.tgh>
    • CreateTextArea is used before its defined, switch the two script blocks around.
    • Your text is 'undefined' due to the fact you call CreateTextArea() without any arguments. Which means the text variable is undefined.
    • If you want to add default text (for when you click the button) you'll need to change the buttons. onclick=CreateTextArea("Sample Text")
    • Why are you calling the functions createTextArea and createArticleHeader on their own?

    HTML

    • You're missing a closing <div> (I placed the closing div right before closing body)

    CSS

    • Class Styling uses a . in CSS. Using p,ah styles ALL <p> and ALL <ah> (which isn't a tag I've ever seen) Same with p,tgh
    • You probably want p.ah which is for <p class="ah"></p>
  12. 16 hours ago, snake07n said:
    
    <?php
      if(!isset($_POST['boton_enviar'])){
        $sql="SELECT * FROM taxis WHERE Matricula='".$_POST['taxi_radio']."'";

     

     

    If your submit button isn't set, you would logically assume that no $_POST variables have been sent through.

    You would never have $_POST['taxi_radio'] defined.

  13. Hey its no worries.

    There's an alternative that I use regularly on my website when I need to use create consistent page headers/navigation/menus. 
    It does exactly as you specify.

    If you create a php file (Or change an existing html file to a php one) you'll be able to take your home page and do this.

    <!-- index.php -->
    <div class="dropdown">
      <a href="#">Links</a>
      <div class="dropdown-content">
        <?php include "links.html"; ?>
      </div>
    </div>

     

    The only thing is you can't test php files straight from your file system.
    You'll only be able to see it on the website or a local server you've set up. (if your web host supports PHP even).

  14. I had a look around the website, and the only point of difference compared to other hover overs would be the fact its using an iframe.

    I did some research and I came across this StackOverflow question which looks accurate.

    https://stackoverflow.com/questions/43787495/iframehover-in-ie-and-edge-doesnt-work-as-expected

     

    What is the purpose of putting an iframe in?
    If its to include a given file in the HTML, may I recommend a server-side processing language such as PHP. I'd be pleased to assist you in setting this up.

     

    I love your website by the way!

  15. As I've been playing around in your site, I've noticed that your 'missing divs' appear right as you're attempting to leave the particular section. I also noticed that when I attempted to come back to the section, it hid itself again. However, when I attempted to navigate to the 'same' section as the one I was in, all the 'missing divs' were there.

    The main one I've noticed is your services page, which when you navigate onto it, the x-card-inner div is set to a height of 16px, when you navigate off, it goes to 295px. Something is off in the JavaScript. Could you look into the theme page transitions? I suspect it might be something there.

×
×
  • Create New...