Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

2 Neutral

About TapeGun007

  • Rank
    Advanced Member
  • Birthday 12/11/1968

Profile Information

  • Gender
  • Location
    San Diego, CA
  1. TapeGun007

    Framework Recommendation

    Just curious, but is it better to use a php framework say like Laravel than coding just plain php? And which framework do you recommend? I've read several websites that suggest Laravel is the better one but who knows who really posted that, so ... just curious from some real dev's what they prefer.
  2. TapeGun007

    Can you update multiple db's?

    I know you can query multiple DB's using UNION, but can you also UPDATE multiple db's, is that even possible? Not something I really want to do, but I'm trying to work around what I inherited until we hire internal dev's to fix this.
  3. Ask your web host. I have been able to keep documents outside of my "www" folder with some web hosts, and others I had no choice but to store it in a sub folder. One simple thing you can do, is let's say you have your www/production/ folder, simply put a blank file in that folder as index.html and you cannot use a web browser to peruse the other files.
  4. TapeGun007

    Form Re-Submission?

    Oh I see... ok thanks.
  5. TapeGun007

    Form Re-Submission?

    I believe this would be a JS question, but I could be wrong: I query a database, it creates a table with all the matches, and then I click "Edit" next to one of the matches which passes an id so I can edit the user info. However, if I click 'Back' in the browser, I get the usual Is there a way to create a back button that would basically resubmit that form or is that even possible? Yes, I don't want to have to re-click "refresh" to populate the form again. Call me lazy, I don't care.
  6. TapeGun007

    CSS Active Dropdown

    Ah. Dadgum it, I really worked hard trying to figure out the error on my own. Now I understand. I had thought about that, but what I also misunderstood is that the last CSS code always overwrites the first CSS code... which apparently is NOT true. But yes, that fixed it, and I'm very grateful for all your help!!!! I feel like you really went the extra mile on this.. and it's very much appreciated.
  7. TapeGun007

    CSS Active Dropdown

    Hi Psycho, I already changed the color back to #99000 (I was just testing to see what that did). This is not the issue. The *ONLY* difference between your picture and my picture is that under the "drivers" menu option (set to active), you have a background of #f6f6f6 (for "add driver" and "search drivers") and I have background color of #99000. This is what I'm trying to understand. I thought maybe it was a browser issue, but I tried this in Chrome, Firefox, and Edge all with the same result. Here is my entire code: <?php //definition of available menu $menuLinks = array( 'Home' => array( 'href' => 'Home.php' ), 'Territory Manager' => array( 'href' => 'tms.php', 'children' => array ( 'Add TM' => '#', 'Search TM' => 'search.php?search=TM' ), ), 'Sales' => array( 'href' => 'sales.php', 'children' => array ( 'Add Sales Person' => '#', 'Search Sales' => 'search.php?search=sales' ), ), 'Drivers' => array( 'href' => 'testcss.php', 'children' => array ( 'Add Driver' => '#', 'Search Drivers' => 'testcss.php' ), ), 'Passengers' => array( 'href' => 'passengers.php', 'children' => array ( 'Add Passenger' => '#', 'Search Passengers' => 'search.php?search=passengers' ) ) ); //Function to create html content for menu function createMenu($menuLinks, $webpage=false) { $menuLinksHtml = ''; foreach($menuLinks as $parentLabel => $parentLink) { //Determine link if parent is active or not $active = ($webpage == $parentLink['href']) ? ' active' : ''; $menuLinksHtml .= "<li class=\"dropdown{$active}\">\n"; //Determine if parent link has children if(!isset($parentLink['children'])) { //No child elements $menuLinksHtml .= "<a href='{$parentLink['href']}'>{$parentLabel}</a>\n"; } else { //Has child elements $menuLinksHtml .= "<a href=\"javascript:void(0)\" class=\"dropbtn\">{$parentLabel}</a>"; $menuLinksHtml .= "<div class=\"dropdown-content\">\n"; foreach($parentLink['children'] as $childLabel => $childLink) { $menuLinksHtml .= "<a href=\"{$childLink}\">{$childLabel}</a>\n"; } $menuLinksHtml .= "</div>\n"; } $menuLinksHtml .= "</li>\n"; } //Return HTML content return $menuLinksHtml; } ?> <!DOCTYPE HTML> <html> <head> <!-- <link rel="stylesheet" type="text/css" href="components/css/rs.css"> --> <style> /***** Begin Menu CSS *****/ ul { width: 100%; list-style-type: none; margin: 0; padding: 0; overflow: hidden; background-color: #333; } li { float: left; } li a, .dropbtn{ display: inline-block; font-size: 15px; color: white; text-align: center; padding: 14px 16px; text-decoration: none; border-right: 1px solid #bbb; } /* Color of the main menu text when hovering */ li a:hover { background-color: red; } /* Once the mouse has moved off the main menu button and is now highlighting a sub menu button, this defines what that main menu button color is */ .dropdown:hover{ background-color: red; } /* Color of main menu button when not selected */ .dropbtn { background-color: 333; } li .dropdown { position:relative; display: inline-block; } li:last-child { border-right: none; } .dropdown-content{ display: none; position: absolute; background-color: #f9f9f9; min-width: 160px; box-shadow: 5px 7px 5px 0px rgba(0,0,0,0.2); z-index: 1; } /* Links inside the dropdown */ .dropdown-content a{ color: black; padding: 12px 16px; text-decoration: none; display: block; text-align: left; background-color: #f6f6f6; /* Sets background color of the drop down menu (not selected) */ } /* Change color of dropdown links on hover */ .dropdown-content a:hover {background-color: #ccc} .dropdown:hover .dropdown-content{ display: block; } /* I have no idea what this does as it appears nothing... li a:hover:not(.active) { background-color: #blue; } */ li.active a { background-color: #990000; } .active dropdown-content{ display: none; position: absolute; min-width: 160px; box-shadow: 5px 7px 5px 0px rgba(0,0,0,0.2); z-index: 1; } .active dropdown-content a{ color: black; padding: 12px 16px; text-decoration: none; display: block; text-align: left; } li.active a.dropbtn { background-color: #990000; } /***** End Menu CSS *****/ </style> </head> <body> <ul> <?php echo createMenu($menuLinks, "testcss.php"); ?> </ul> </body> </html>
  8. TapeGun007

    CSS Active Dropdown

    That's very odd. Your picture is exactly how I would like it to look, but on my screen... it's like the picture above (minus the dark red Home button). Can you re-post your entire page code? I did go into Chrome and completely delete all cached files and such just to be sure.
  9. TapeGun007

    CSS Active Dropdown

    li.active a.dropbtn { background-color: #f6f6f6; /* This set the background of the actively selected top menu item */ } What that does is makes the word "Driver" on the main menu turn to a light gray. But it doesn't change the background color of the drop down box.
  10. TapeGun007

    CSS Active Dropdown

    So that background color on the drop down which is the same as the background of "Drivers" is a bit hard on the eyeballs.
  11. TapeGun007

    CSS Active Dropdown

    Yeah, I had noticed and was trying to find the issue. But drop down box of the selected item is still dark red (background) even with that. The background of a the active item drop down should be #f6f6f6 (or whatever other color).
  12. TapeGun007

    CSS Active Dropdown

    Ah nevermind, I'm dumb. <?php echo createMenu($menuLinks, "testcss.php"); ?> Thank you so very much Psycho, this is awesome!
  13. TapeGun007

    CSS Active Dropdown

    Wow Psycho... I wasn't asking for all that, but this is certainly eye opening on a way better method of generating a simple menu. Yes, HTML tables are old hat, but I was just trying to better learn CSS, so I wasn't focused too much on that. My only frustration with building "tables" using <div> and CSS is there seems to be no replacement of "colspan" or "rowspan" (that I can find anyway). I put all of this into a testcss.php file exactly as you have it above and it works fine except the highlight of the selected menu item. I set "Home" to this: $menuLinks = array( 'Home' => array( 'href' => 'testcss.php' ), So when I click home it's not highlighted in the dark red. In my HTML I just put the additional CSS in a style tag: <!DOCTYPE HTML> <html> <head> <link rel="stylesheet" type="text/css" href="css/rs.css"> </head> <style> li.active a { background-color: #990000; } </style> <body> I also put it at the end of the css file actually just now.
  14. TapeGun007

    CSS Active Dropdown

    Oh sorry, I didn't know another reply was coming... now I see the explanation.
  15. TapeGun007

    CSS Active Dropdown

    Thanks for the reply Psycho. I am not good with CSS, so while I understand what you are saying I do not know how to apply it. I am guessing you mean I need something like this? .active:hover .dropdown-content{ position: relative; display: block; } Now that DOES give me a "drop down" on the selected item, but not correctly. I'll have to keep reading and see how to fix, but at least you got me on the right track! What I completely do not understand is when you said:

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.