Jump to content
#FlattenTheCurve ×


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by maxxd

  1. maxxd

    git question

    Actually that's exactly what we're doing right now - we open GitKraken and try to follow the graph. Don't get me wrong - it works, I just personally find it a bit frustrating. It's probably a moot point as we're looking into moving to a scrum process in the new year; so theoretically we should know at all times what's being worked on for the next release. However, I have to assume that scrum doesn't always work as advertised, and I can see the possibility of losing track if we have a single release that spans multiple scrums. Looking at it further though, I guess it's possible that creating pull requests from the feature branch(es) into master, then creating another pull request from master into production could give me the trail I'm looking for. At least I can see in GitLab the branches that were merged into master after the last merge from master into production... Just kinda wish there was an audit view on a branch to easily show any branches that have been merged into the current one.
  2. maxxd

    git question

    Kinda what I figured - thanks for the link!
  3. Hey y'all. I know this isn't the right forum for this but didn't see a better spot so mods, please feel free to move this. I've not really had to deal with merge/pull requests all that much in the past, but I've now started in a position where I sometimes have to check what branches have been merged into another specific (in this case, RC) branch. I'm not really finding anything in my searches that leads me to believe it's possible - `git log {branch} --merges` doesn't really show what I'm looking for, nor does `git branch --list -a --merged`, and GitLab isn't terribly helpful so far as I can see. Am I missing something here? Is there a way to see it in git, or has anybody found another way to see merged branches by overall merges that I'm overlooking? And I don't think simply searching for the release tag will work in this situation as we merge into the tagged RC branch manually right now so I can't just look for `rc_{whatever}` tags on all branches - that tag is only on the RC branch, and looking through twelve million individual commits doesn't seem like a ton of fun.
  4. What exactly do you need? You said you fixed it...
  5. Or use AJAX. Depends on what you're trying to accomplish and how you're trying to accomplish it. As far as the security goes, no matter what you do that part's going to be up to you, and I'd recommend not just blindly copy/pasting code from the internet in this situation.
  6. Which file(s)? The only issues I've really run into with PHPMailer involved incorrect email addresses and authentication issues, so I'd be interested to know. Also, make sure there's been an issue submitted to the repo if there's an error in the code.
  7. If it's set up in the image you could use exif_read_data() to grab comment metadata and output that as the caption.
  8. I totally get that, but there's really not a more elegant way to handle this situation that I can think of off the top of my head - maybe someone else can pop in with a suggestion.
  9. In the second code block, you're only running the readdir() once, so as long as it's not false on the initial run, it never will be.
  10. I can't see where $ranges is defined, so once you define $two_letter_country_code you may have another undefined variable error unless it's defined in "ip_files/".$numbers[0].".php".
  11. When I asked you to post the code, I meant for you to post the code that's actually being run. You mention a 'first' script that you don't show us, and then talk about what doesn't happen when you "combine" that script with what you do show. How are you combining the scripts? What does the resulting script look like? Right now you're asking us to tell you why your shower isn't working by telling us you have a bathroom.
  12. Sorry - bit confused here. Are you saying that if you've already submitted the form and then you run JavaScript replaceState it doesn't resubmit your data? I'm sure someone will correct me if I'm mistaken, but I believe that replaceState() won't actually redirect or refresh your browser - it just tells the browser history object where it thinks it's been or where it thinks it currently is. If you're trying to actually reload the current page, maybe window.location.reload()?
  13. You're going to have to post your code. PHP inside HTML may not be the best idea in the world, but it works pretty flawlessly assuming everything is done correctly. My bet is that if your JavaScript stopped working, something didn't get named what it is later called and the error is pretty standard once you see it. As far as which should be done first (PHP/HTML/JavaScript), if you're determined to combine PHP and HTML, put the PHP code first. Deal with any form handling, collate the page variables, and deal with the system business logic, then render the HTML display. Keep your JavaScript entirely separate from all of that so that you can minimize and uglify it via webpack or gulp. This will at least get you a step or two closer to true separation of concerns, and that'll save you refactoring time in the future. Oh - and a form action is "run" when the form is submitted. Nothing's actually run as such, the browser redirects to the page named in the form's action property and passes the data from the form to the page via either $_GET or $_POST, depending on the method attribute of the forms.
  14. OK - I assume the 'installation & loading' section of the readme got you sorted? Ask any questions you've got on it here, but I can almost guarantee that you'll have a much, much better experience using PHPMailer than you've had using PHP's native mail() function.
  15. Or $_POST or $_GET as well as the WHERE clause; the important part here is that you're gonna need a WHERE clause in your SQL statement.
  16. OK - this is not a session problem, it's a problem of not understanding variables or SQL. Your SQL statement is currently looping through every record in the table and saying 'update the current record if the ID value of the current record is equal to the ID of the current record'. Which, as Barand pointed out, will always be true. So if you're wanting to only update one specific record at a time, you'll have to get the user_id of the specific record you want to update and then assign that value to a php variable (which begins with a dollar sign), which you will then use as the value of `user_id` in the WHERE clause.
  17. I recommend reading this page - https://www.php.net/manual/en/language.variables.basics.php
  18. You set $_SESSION['eqname'] before your inner-most if statement. There are no else clauses for the other two if statements, so I assume that's the one you're talking about. For now, don't worry about running the second query or redirecting the user. Just do this until you get the results you expect: echo "<p>{$stmt->num_rows()}</p>"; if($stmt->num_rows() > 0){ die('rows were found'); }else{ die('nothing there'); }
  19. I could be completely wrong, but I think the official Docker PHP image is built on Ubuntu with Apache2x. So it theoretically should be almost as simple as `docker-up` And @dalecosp, You're kinda killing me with that - I miss Virtualbox and Vagrant by now. Docker is great, but really fiddly and docker-compose files don't make as much sense to me as Vagrantfiles did...
  20. If you've got some time, you could use Docker or install WSL. Otherwise, you'll have to set up another version of your production server and blow things up there instead of the live site.
  21. // $id may or may not exist, doesn't matter for ($i = 0; $i <= 5; $i++) { if (isset($_REQUEST["element_id_$i"])) { // Now you're checking _any_ input for anything called element_id_{0-5} and assigning it to the session variable. // $id is still potentially undefined $_SESSION["element_id_$i"] = $_REQUEST["element_id_$i"]; // OK, so now $id is a string or integer or float or whatever (validate your input, please) $id = $_SESSION["element_id_$i"]; // $_SESSION['element_id'] is an array because you're using array_push array_push($_SESSION["element_id"], $id); } // And now $id is an array because you're overwriting the value you've already put in there // Also, at this point if $_REQUEST['element_id_{0-5}'] _isn't_ set, $_SESSION['element_id'] should // not exist and you'll get an error $id = $_SESSION["element_id"]; } So $id is an array. You can use variables as array keys, but the value of those variables has to be a string or integer - you can't use an array as an index in another array.
  22. $cart_items[$id] = $quantity; and $cart_items = array($id => $quantity); are two very different things. What's the value of $id?
  23. You can use variables as the index when you create an associative array. Considering that, and as you already have the variables that contain the id and quantity, the solution should be pretty obvious...
  • 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.