Jump to content

maxxd

Gurus
  • Posts

    1,658
  • Joined

  • Last visited

  • Days Won

    51

Posts posted by maxxd

  1. Wrap your entire page structure in a div, give it display: flex, flex-direction: column, and min-height: 100vh. Give the header and footer a max-height and flex-grow: 0, then assign the body div a flex-grow: 1. Sticky footer with dynamic page height, and unless you're still supporting < IE 9, should be pretty universally cross-browser by now.

  2. 7 hours ago, Psycho said:

    Look at the code examples on that page. The examples first create a datetime object with a specific timezone and then use gettimezone to retrieve the timezone that was previously set. A string such as "2021-05-06T13:48:19.2064951+05:30" has only the offset from UTC time - there is no timezone identifier. So, there is no way to programmatically determine the correct timezone out of the ones that share that offset.

    Gotcha - I didn't read everything correctly. Thank you!

  3. I'm not entirely sure what you're trying to accomplish with everything after the mysqli_query (also, you may want to look into PDO as it's much easier), but what does this give you:

    die("<pre>".var_export($result, true)."</pre>");

    if you put it right after the mysqli_query line?

  4. You'll need to look into AJAX.

    Basically, using JavaScript you trigger a call (ajax or fetch) to a php script on your server - in the call you pass the selected value. The php script will use this passed value to determine what to show in the next drop-down and return that to the JavaScript which will then display that data to the user as a second drop-down.

  5. There's probably a Cake-specific method of creating form fields with an array-enabled name, but I don't have the slightest notion what it would be.

    To answer your other question, you'll need to submit the form data. Whether you do it via AJAX or a traditional HTML submit doesn't matter - send the data to the PHP script and process it there.

    I'm not going to lie, given what you've described I'm hard-pressed to believe that what you're doing is actually what you want to do, but then again I don't know your project.

  6. So CPANEL is a dependency package that you've not included in your script. I don't use cPanel so I'm not sure how it's set up, but there should be a require or include directive in the script somewhere - either it'll include the script directly, or it'll include an autoloader file in which case you'll see a use statement naming the CPANEL class.

    • Thanks 1
  7. 10 hours ago, phppup said:

    echo '$var';  //indicates that you want the item in the quotes (which translates to a variable value, in this case) to be displayed.

     

    10 hours ago, ajetrumpet said:

    this is literally the only thing you said that I wasn't aware of.  thanks!  I think that pretty much gives me everything I need.  your words to describe what PHP does what that line of code was really what I was after, more or less.  wonderful!  😃

    Sorry, but this is completely incorrect. Single quotes in PHP will not interpolate variables, while double quotes will. So this:

    echo '$var';

    will output

    $var

    , and

    echo "$var";

    will output

    value

     

  8. I didn't read all your code, but on a macro-level you have a couple choices. Either get all the information on page load and use PHP to put it into JS variables or HTML data attributes, or use AJAX on the mouse over event and do it dynamically (slower, but IMO a better choice).

  9. 37 minutes ago, Kell said:

    $book = array("Moby Dick", "Wuthering Heights");

    What you've done is create an array of strings. The Book objects that represent 'Moby Dick' and 'Wuthering Heights' are $first_book and $second_book. So this is what you're looking for:

    $book = array($first_book, $second_book);

     

    • Thanks 1
  10. If you're pulling data from WordPress but not using it as the CMS (so basically, it's headless) then your page doesn't know what to do with the WordPress functions you're calling. That's what I mean by mixing CMSs, you're relying on the PHPjabbers stuff to handle the bracketed text replacement and WordPress to hand the_posts(), the_title(), the_excerpt(), etc. Pick one - make sure you include the proper WordPress handler code, or use WordPress and include the PHPjabber script in the WordPress template file and use it there.

  11. It looks like you're mixing CMSs? WordPress by itself doesn't understand mustache notation, so {SCMS_CONTENT_2} means nothing to it unless you're using a theme or plugin that parses that code.

    1 hour ago, Strider64 said:

    You're not echoing out the content

    the_title() will echo by default - you can turn echo off by passing false to the third parameter.

×
×
  • 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.