Jump to content

requinix

Administrators
  • Posts

    15,288
  • Joined

  • Last visited

  • Days Won

    436

Everything posted by requinix

  1. What do you mean "finding a palindrome of a number"? Because you don't really find palindromes... Do you want to check if a number is a palindrome? Like 12321 is but 1232 is not?
  2. PHP will not remember $hasil from the last time you used the form. You have to store the data somewhere and then put it into $hasil before you display the form.
  3. ...is where it will be when you reach 10 posts.
  4. Unless I'm missing something, you need to add the values for the new columns into the ::create array. And presumably those values are somewhere in the $request.
  5. Are you sure the user agent really starts with Test-Robot? Nothing else in there? The hyphen doesn't need to be escaped (it's not a special character) and /* means "zero or more /". You can put it in quotes just in case. RewriteCond %{HTTP_USER_AGENT} "!^Test-Robot/"
  6. That's functional but not quite what modern Javascript code is supposed to look like. Want to spend some time improving it with our help?
  7. What code have you tried so far and what did it output?
  8. Right now the code assumes there is a file. $name = $_FILES['file']['name'] [$ID]; if(move_uploaded_file($_FILES['file']['tmp_name'][$ID],$target_dir.$name)){ What you need to change is have it first test if there was an uploaded file (the "error" in $_FILES is UPLOAD_ERR_OK). Then you only try to move the file if there was one. Then have your insert query not depend on moving that file.
  9. Like I said, sometimes you need to step away from the computer for a while. I really did mean to do that, you know. Wasn't even joking.
  10. I'm not talking about a column in a table. I'm talking about the PHP variable you have there called $voucher_code_in_transaction. Where is the line of PHP code that declares that variable?
  11. Okay, now I'm done. $stmt->bind_param('s', $voucher_code_in_transaction); Where is the $voucher_code_in_transaction variable coming from?
  12. This might be one of those times when you should step away from the computer for an hour or so, get something to eat, watch TV, and come back to the code with a fresh pair of eyes. As a reminder, this works: $stmt = $con->prepare('SELECT request_receiver_id, request_receiver_name FROM transactions WHERE voucher_code_in_transaction = ?'); $stmt->bind_param('s', $_POST['voucher_code_in_transaction']); and this does not work: $stmt = $con->prepare('SELECT voucher_value FROM voucher_codes WHERE voucher_code = ?'); $stmt->bind_param('s', $voucher_code_in_transaction);
  13. Almost had my fun. This query works, right? $stmt = $con->prepare('SELECT request_receiver_id, request_receiver_name FROM transactions WHERE voucher_code_in_transaction = ?'); $stmt->bind_param('s', $_POST['voucher_code_in_transaction']); There's a big difference between the two of them.
  14. I meant in the code. Good news: I've had my fun. $stmt = $con->prepare('SELECT voucher_value FROM voucher_codes WHERE voucher_code = ?'); $stmt->bind_param('s', $voucher_code_in_transaction); That query is not returning any results.
  15. Good so far. How do you get the value of that voucher? Because if, for some reason, you didn't happen to have a value for it, you'd be adding 0 to the balance and total received, thus making it look like nothing happened...
  16. Hint: It might not so much be that the query isn't working, but that the query is working except it's not actually changing the data...
  17. This "<button type='button' onclick=\"javascript:'" + ZoomAndCenter(locations[i]) + isn't going to work. What it does is actually call the ZoomAndCenter function right at the moment that you're creating the button, when what you want is to have that function called when you click the button. As part of the onclick. Calling the function, which returns nothing, is why you see onclick="javascript:'undefined'" when you inspect the button. This code is rather old in its practices. Modern Javascript has you creating a button element like with document.createElement, attaching an event handler with addEventListener, then inserting the button into the document. That said, my preferred approach is to throw data attributes on a button and pull them out in the event handler. <button type="button" data-center-latitude="1.52986" data-center-longitude="110.36">Click me</button> I also still use jQuery because it's much easier than dealing with DOM stuff manually. $("#results button[data-center-latitude][data-center-longitude]").each(function() { const lat = parseFloat(this.dataset.centerLatitude); const lng = parseFloat(this.dataset.centerLongitude); const latlng = new google.maps.LatLng(lat, lng); new google.maps.Marker({ position: latlng, map, }); $(this).on("click", function() { map.setCenter(latlng); map.setZoom(15); }); });
  18. It's going to be very, very hard for us to help you through this step by step if you don't have any PHP or development experience. It's like trying to cook some complicated dish in a kitchen and asking a chef to guide you through it - and the chef can't see what you're doing or even what dish you're trying to prepare. We can still try. However, first you should try to reach out to the original developers/company if you can. Let's start with a lot of details. What kind of software? What is this report? What about it doesn't work the way you want and how do you want to change it? What kind of fields do you want? Edit what parts of it?
  19. Why did you change the error log path at all? The php:apache image should have set everything up for you already.
  20. Sounds like you've discovered the concept of feature creep. Is the rest of your voucher system already set up?
  21. What do you mean by "actionable"? My suggestion was, given you seem to like using YouTube, to find videos that can explain aspects of page design and not just simply about HTML and CSS syntax. The idea is that you could be able to look at the elements of a page and consider, say, whether they're using flexbox or grid, or how their arrangement changes when you resize your browser window. If your goal is really just to copy that site then use the browser developer tools to look at a site and see how they set it up, then see if you can replicate what they did (and without cheating by literally copying it).
  22. Knowing the fundamentals of something is different from knowing how to apply them. That works for everything: speaking a language, driving a car, cooking a dinner... What you've learned is the fundamentals but perhaps not how you actually use them. That said, website design is another thing by itself that takes some amount of learning. Learning how to use paint and a brush doesn't mean you can sell a painting. If you're a video person then see if you can find videos about the designing side of websites, not so much the syntax side.
  23. The / are part of the traditional syntax for it. They don't actually contribute anything to the regular expression itself, but they can be useful to separate the expression part from any flags you might want to apply. Since Javascript's RegExp separates the expression from the flags, and since it needs the expression as a string, there's no point in requiring the slashes. But if you write a regex literal, so not using the RegExp class directly, then you have to use the slashes because (a) that's the syntax so Javascript knows it's a regular expression and (b) you also have to specify flags at the same time and the slashes can separate them. /foo/i <=> RegExp("foo", "i") https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/RegExp
  24. Only a Sith deals in absolutes. There's a very basic principle to consider: cost versus benefit. The issue here is whether to invest some undetermined amount of effort into making sure a theoretical attack on your voucher codes isn't possible. The cost is moderately high and the benefit, assuming we're not talking about vouchers worth thousands or millions of dollars, is negligible. It's not worth worrying about.
  25. You did start a new topic. But given how it's very closely related to this one, and how you didn't really include any information besides "I TRIED /FRENCH/ AND IT ISN'T WORKING HALP", I figured I''d save everyone (including myself) the headache of having to pull some more teeth by just bringing everyone back in here.
×
×
  • 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.