Jump to content


  • Posts

  • Joined

  • Last visited

  • Days Won


Posts posted by phppup

  1. I've used PHP's mail function previously and I'm thinking of using it again.

    At one point, I recall getting success messages when the mail function completed, but discovered that certain emails were never received by recipients.

    After much troubleshooting, I discovered that the shared hosting server that I was using included quota limits on outboard emails.

    Essentially (if my understanding is correct), the PHP confirmation was accurate, but the actual messages (after hitting the quota) were never dispatched.

    How can I get confirmation that the intended email actually left the server?

    Further, can I determine that it wasn't filtered by the recipient's email provider or tagged as spam?

  2. @requinix Yes, I believe I tried that initially.  It may have worked; but then it didn't.

    After hours of futile efforts, I decided to post here and wait for a reply.

    However, it was a Sunday afternoon and ALL my sports teams were losing. *another season of tears* LOL

    My tenacity got the better of me and deeper down the rabbit hole I went.

    I haven't come up with an adequate solution (and may never do so) since this was supposed to be just a 15- minute cosmetic effect.

    However, I wanted to do my part as a contributor to the forum and share what I discovered:

    It appears, per a variety of resources that 


    @keyframes is not as easy as you might think to “restart”.

    ...say you set it to run once

    You might think CSS provides a way to kick it off again, but ....it doesn’t. 

    There seem to be several JavaScript/jQuery work-arounds or some CSS tricks to enable a smooth usefulness on every instance of an event-type.

    For now, I think I've taken it as far as I am willing to go.

    But the next person should be aware that events and CSS animations are not necessarily  completely compatible under the current rules that govern them.

  3. I'll skip the boring details and get to it.

    This CSS code runs an animation for an INFINITE period.

    I want it to ONLY run "on mouse over" or the equivalent. I've changed the duration without issue, but cannot get it to run when desired

    .obj {
      height: 90vmin;
      position: relative;
      width: 90vmin;
      > div {
        animation: growAndFade 3s infinite ease-out;
        /* lots of settings */

    I've tried different variations of using

    .obj :hover{
      height: 90vmin;
      position: relative;
      width: 90vmin;
      > div :hover{
        animation: growAndFade 3s infinite ease-out;
        /* lots of settings */

    but seem to be missing the correct implementation.

    Helpful responses, please.

  4. @kicken  I thought I'd share this interesting revelation.

    While beginning to alter my code to implement your suggested approach I //commented out// some areas of code.

    That's when I noticed that the color designations on my editing tool were inconsistent.

    Long story short, it seems my code was stalling because 

     ////var array = <?php echo json_encode($business); ?>;

    did NOT remove the code, COMPLETELY and in fact created a hiccup

    until I tried

    ////var array = <?php /** echo json_encode($business); **/ ?>;

    Thankfully, now my code is working.

    PS: had to post on this fashion as the editor would not display the leading backslashes

  5. After unsuccessful efforts at trying to obtain my GPS location from a self-written PHP script, I moved to a more local JavaScript code.

    When opened on my Android phone with a Chrome browser, I received an error Y0ZkNV.

    Is there a way to resolve this without changing my hosting to an HTTPS platform?

    My goal is to be able to access my current location on my phone's browser.

  6. Quote

    You could just have your JavaScript code work with the structure rather than having to use getElementById with different ID values.

    @kicken Not sure what you mean or how to approach this


    In general, IDs are something best avoided



    no idea what you mean by exit the JSON

    Me neither, but I realized that this cause was JSON, and wasn't sure if I had missed an aspect of "special handling" that might be required to neutralize any effects (other than hashtags to remove it... LOL)

  7. Hello all.

    I had hardcoded

    if(document.getElementById("Item_01").checked == true){
       document.getElementById("Set_01").style.display = "block";
    } else {
       document.getElementById("Set_01").style.display = "none";

    This referenced items in a form that corresponded to values in a PHP array and all seemed to work well.

    But when I realized that expanding to multiple items in the array would mean manually re-writing these same lines for every item, it occurred to me that writing a single piece of code to engage the array with a FOR LOOP would be more effective (and reduce code).

    I searched the web and discovered that this could be the answer to incorporate into my function:

    var array = <?php echo json_encode($business); ?>;

    I tested at each step to avoid issues, but noticed that while things seemed to work well, they stalled when I refreshed my webpage.

    Is there a specific way to exit the JSON or disable it so that the page works properly every time (as it does WITHOUT this variable?

    Should I be using  a different approach to connect JavaScript to a PHP array?


  8. @kicken Ahhhh, now I see it.


    a string of unlimited length so long as it matches the character list.

    So, with the parenthesis I can receive an input as you described.

    But without the parenthesis I am successfully limiting the totality of characters submitted to  1+48+1 (adding the first and last).

    At this point, I'm kinda okay with using only the American alphabet, but still want to accommodate complex names with apostrophes and hyphens (I'm still skeptical of names with underscores; and the few with numerals will need to come up with their own nickname ie:Musk's kid).

    Thanks for the info

  9. @kicken Yes. I am building a form and want PHP to "scold" users that try to submit junk. (It will be used internally by a staff group that needs to be reliied on and trusted. LOL)

    I realize the need to sanitize names and was going to simply require a-zA-z to eliminate numbers and characters.

    Then I realized that there are names with hyphens, apostrophes, and spaces, so down the rabbit hole I went.



    I moved the opening parenthesis to the middle section.

    which left me with

    $pattern = "/^[A-Z]([a-zA-Z '&-]{1,48})*[A-Za-z]$/";

    Is that the same as yours?

    Do my parentheses alter the outcome?

    So I guess, thanks to your assistance, I made progress after all.

    I just have to be more careful about using cut & paste BEFORE my coffee.

  10. @requinix Ok, I think I got it.


    $pattern = "/^([A-Z][a-zA-Z '&-]{2,4})*[A-Za-z]$/";

    Please tell me if this is the [correct] solution that you eluded to.

    I moved the opening parenthesis to the middle section.

    Ironically, I may have inadvertently discovered something, as I altered the range for easier testing (but stumbled upon new conditions).

    Effectively, this modified range of 2,4 had to affect ONLY this mid-section of the string.

    So, the first character is [A-Z]

    And the last is [A-Za-z]

    So with the mid-section {2,4} a total of 3 characters will FAIL the test but 4 thru 6 pass, and then 7 or greater fails.

    Of course, a minimum of 1 will elevate the minimum to a total of 3 (if a special character is used)

    I did notice that 2 characters only (being first and last) will pass, but I imagine that adding a minimum to the last set of characters would correct that.

    My final solution is

    $pattern = "/^([A-Z][a-zA-Z '&-]{1,48})*[A-Za-z]$/";

    Is this the same as your solution?

  11. @requinix Some deeper testing has revealed an unexpected issue.

    For test purposes I changed the range 

    $pattern = "/^([A-Z][a-zA-Z '&-]{0,4})*[A-Za-z]$/";

    and discovered that while the RegEx seems to have a few holes for what would be allowed, it is NOT returning 0 to keep the minimum requirement at two characters.

    In fact, a single uppercase A passed the test of acceptance.

  12. Ahhhh, so that's the trick!!

    I used parenthesis (that seem to resolve the issue) but I'd like to avoid any unforeseeable surprised.

    $pattern = "/^([A-Z][a-zA-Z '&-]{1,48})*[A-Za-z]$/";

    Please check to confirm that this working solution is the most correct implementation.

  13. Trying to utilize this expression

    $pattern = "/^[A-Z][a-zA-Z '&-]*[A-Za-z]$/";

    to take name to start with a capital letter, allow some symbols or space, and then continue with more letters.

    How can I require the length of all characters be involved to be between 3 and 50 keystrokes?

    Ice tried {3,50} in several positions but none seem to be making the connection that I want.




  14. Are these two pieces of code equal in risk?

    <form method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">
    <form method="post" action="">

    Do they perform the same action?

    Are both vulnerable? Best practice to minimize vulnerability?

    Will using prepared statements nullify a hacking attempt?

    I was doing some reading and thought I'd ask the experts here.

  15. Just toying with CSS to get a result I've usually used JavaScript to achieve.

    I want to toggle a paragraph's visibility when a checkbox is clicked.

       .toggle input:checked {
         p { display: none; }

    Obviously incorrect.

    Also, are there any pro/cons to using CSS over JavaScript?

  16. Quote

    Hint: go into the post editor box and type "@r"..

    I don't think I'm ready to code that at this point. But maybe....

    Nonetheless, I've uncovered the <optgroup> tag, which seems to be what I was looking for from the start.

    And I think that better demonstrates how I wanted to "categorize" the options.

    Now I'd like to be able to collapse the options so that the initial drop-down is only a list categories, with each category list appearing as needed (iie: onclick)

    But I am making progress.

  17. @requinix I understand what you're saying, but I think I am simplifying the list by categorizing the items.

    An admittedly backward example but, imagine you needed to know what was in each of the 42 aisles of a supermarket/Walmart.

    Before going down aisle 18, you would evaluate whether any of the sub-category items interested you, and the same for each subsequent aisle.

    If you're looking for cookies, you would skip the aisles containing frozen food and automotive items.

    Isn't that better than an infinite number of radio buttons? 

    It is also expected that users will use this menu regularly, and (like a consistent shopper) learn where to find the sub-category item easily.

    My supermarket keeps cupcakes in the bread aisle, and I remember it.  A different location (same company) puts the cupcakes in the cookie aisle. In either event, I can confirm that I'm in the right place by checking the signage before trekking up the aisle unnecessarily.

    That's my thinking.

  18. I'm not sure if this requires a CSS or a JavaScript approach, so hear me out.

    Note: I've been toying with several coding approaches that will get the job done, but I'm seeking an ultimate answer.

    I have categories and sub-categories: eg: candy (gum, coco), fruits (apple, orange, pear), meat (burgers, steaks) etc.

    The user has to select ONLY one item, eg: what did you eat last?

    My thinking is to have a <select> drop-down menu with category titles. When an option is selected, a secondary drop-down should appear.

    I've got one very old school method that works by literally populating a second drop-down based on the first dropdown selection. But it needs to be promoted in a separate motion (not a seamless flow).

    I also have a partial CSS solution extracted from dropdown menu designs (which seems to be more of what I'm looking for).

    The real obstacle is that most users will be using Smartphones to make they're selections.

    As an Android user I'm familiar with how a <select> is displayed, yet a CSS menu using <a href> responds more like a webpage (and seems too small to view comfortably).

    Likewise, if a second tier <select> menu were to cover the phone's screen, there would need to be an easy way to go backwards (in the case of an incorrect category selection).

    Any guidance or solutions for this?

  19. I'm fiddling around on a W3 page in order to achieve a better understanding of current JS practices.

    Goal: if ANY of several paragraphs are clicked, send an alert message.

    //var a = 
    document.querySelectorAll("p").addEventListener('click', fn);
    function fn(){ 
    //var i;for (i = 0; i < a.length; i++) { 

    I've managed to achieve success with querySelector to push out the alert for paragraph #1, but the querySelectorAll implementation seems to be causing me trouble.

    Insight and solutions to approaching this properly, please.

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