Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Not easy to see this happening for ourselves with some CSS and HTML but no images or demo. Is this somewhere on the internet we can see in action?
  2. Search engines stopped caring about URL structures years ago. As long as you have the appropriate words in there, like "search" and the search keywords, then it's fine.
  3. No it is not. Look at the query in your code: $query = "SELECT krs.id_thn_ak ,krs.kode_matakuliah ,matakuliah.nama_matakuliah ,matakuliah.sks ,krs.nilai FROM krs INNER JOIN matakuliah ON (krs.kode_matakuliah = matakuliah.kode_matakuliah) WHERE krs.nim = $nim AND krs.id_thn_ak = $thn_ak"; Look at the query in the error message: SELECT krs.id_thn_ak ,krs.kode_matakuliah ,matakuliah.nama_matakuliah ,matakuliah.sks ,krs.nilai FROM krs WHERE krs.nim = 18024114 AND krs.id_thn_ak = INNER JOIN matakuliah ON (krs.kode_matakuliah = matakuliah.kode_matakuliah) They are not the same query. Now look at this part of the query that was shown in the error message: ...FROM krs WHERE krs.nim = 18024114 AND krs.id_thn_ak = INNER JOIN matakuliah... See why the query does not work? Now look at this part of your code: $this->input->post('$id_thn_ak', TRUE); Look carefully. Are you sure that is correct?
  4. You need to rank the results, not just check if they contain the words in the query. Try a FULLTEXT search using MATCH AGAINST. https://dev.mysql.com/doc/refman/8.0/en/fulltext-search.html
  5. The general term is "CAPTCHA". Google's reCAPTCHA and whatever the non-Google alternative is, are the de-facto standards. It takes a little more work to implement but they're effective and reliable.
  6. Sounds like you're talking about doing this in Javascript? If you're implementing your own bot check then it can't be in Javascript because the bots can just ignore that. It has to be in PHP. Doing that means you need to "remember" $entry from before. If you put that as a hidden input in the form then guess what the bots will do. There's a really simple way to solve this, though. Don't remember $entry but a hash of it, then check the hashes. $hash = sha1(__FILE__ . $entry); <input type="hidden" name="hash" value="<?= $hash ?>"> Then your PHP does the hash the same way but using the number the user put in the form, and it checks that the result matches the hash from the form. Bots can't figure out what value generated the hash, which also means they can't successfully substitute their own hash value. But know that bots are capable of solving math problems like this...
  7. Python people love to say it's better/faster/whatever than <other language>. Don't take their word for it.
  8. Like I asked elsewhere, What have you tried so far?
  9. What mac_gyver and Barand are trying to tell you is that this idea you have is the wrong way of doing... whatever you want. As in, don't use multiple arguments named "varX" and instead use a single argument that takes an array. xyz(1, 2, 3); // no xyz([1, 2, 3]); // yes
  10. Please confirm you are a human being living and working in Australia before we continue.
  11. I don't see OAuth2 mentioned in https://secure3.saashr.com/ta/docs/rest/public
  12. Yes it can because I'm pretty sure you have not installed Laravel correctly. No it is not.
  13. https://laravel.com/docs/9.x#your-first-laravel-project
  14. ...Why are you trying to provide a link to some place on mail.google.com that almost certainly does not exist? And is this a really old application that you're maintaining? Because it's using PHP 4-style code, and that version died off 14 years ago. Like, you aren't even using class autoloading. I don't know what you're trying to say, because what it does sound like you're trying to say doesn't make any sense, but the answer is very likely something along the lines of: We don't know what $request is or what its "url" method is. You have to learn about that method and see if there's a way to call it so that it does not include the URL scheme (http/s) or domain (localhost).
  15. If there is a minus sign then either (a) the "prefix" is a minus sign or (b) your rounded number is negative. There's no way for me to know which one based on what you've posted.
  16. The minus sign will also show up when a number is negative.
  17. Find out what the $request->url method is and see if there is a way you can call it so that it does not include the part of the URL you do not want.
  18. All languages that power websites, including PHP and Java and Node.js/Javascript, share the same two aspects: that there is code running on the server which creates some output, and (typically) that there is code running on the client to perform additional actions. That duality is a lot more apparent with PHP than it is, say, Node.js and React, but only because that's the more traditional (and easier) style of mixing your server-side code with your output. If you wanted to use React to handle the interface instead then you could do that with PHP too, even if the approach would be different.
  19. Named PHP functions do not work like that. There is no such thing as nesting for them.
  20. Are you familiar with your browser's developer tools? Here's a few links for Chrome, but all major browsers have something similar: https://www.codecademy.com/article/f1-devtools-box-model https://developer.chrome.com/docs/devtools/css/ https://feastdesignco.com/how-to/use-inspect-element-troubleshoot/ You can use that to find out where the extra spacing is coming from. Start by looking at the parent UL...
  21. You mean you want a line between the items? Between D/M/L and also A/B? Try adding a top border to every LI that comes after another LI: ul.dropdown-menu > li + li { border-top: ???; }
  22. PHP's gd extension doesn't support editing or outputting animated GIFs. Use something like Imagick/ImageMagick instead - which, honestly, will probably give you better quality results anyway.
  23. Using global variables means it can be very difficult to know where they are being set, or modified, or used. If you have a question or problem about one then you could have a hard time finding out what is responsible. "Attaching" is a weird way of saying "pass it as an argument". I don't know what you mean but I doubt it's a good idea. By not trying to access things outside the function at all. Use arguments and return values.
  24. This code uses a loop to fetch records, which suggests there are multiple records it might need to fetch. It does not sound like that is the case. $query_res = mysqli_query($conn, $query); while ($query_run = mysqli_fetch_array($query_res)) { The fix is simple: keep the mysqli_fetch_array but don't use a while loop. $query_res = mysqli_query($conn, $query); $query_run = mysqli_fetch_array($query_res); You can then add an if to check if that fetch returned anything. $query_res = mysqli_query($conn, $query); $query_run = mysqli_fetch_array($query_res); if ($query_run) { ... } Inside this new block is where you put your answers. After the block you add an else for the "no records found" message. $query_res = mysqli_query($conn, $query); $query_run = mysqli_fetch_array($query_res); if ($query_run) { ... } else { ... }
  25. First step: fix your code so that you do not use a loop to read a single row. Read the one single row and then output it. After you've done that, you'll know whether you have that one single row to output, and if not...
×
×
  • 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.