Jump to content

justsomeguy

Moderator
  • Posts

    31,575
  • Joined

  • Last visited

  • Days Won

    77

Everything posted by justsomeguy

  1. Use parentheses to separate the AND and OR conditions.
  2. The manual shows how to use the function: https://www.php.net/manual/en/function.stristr.php
  3. That's a pretty vague question. If it's a regular anchor tag then use a target attribute set to "_blank".
  4. https://developer.mozilla.org/en-US/docs/Web/API/Window/location https://developer.mozilla.org/en-US/docs/Web/API/Location
  5. I don't have an instagram account, but if you're having problems using it then hopefully you can contact them or look for a forum that they provide. It looks to me like you need to login on the page that they redirect you to, if you're saying that doesn't work then I don't know why.
  6. Well I bet you can access it just fine with ajax if you log in with that browser first. It's still the browser that sends the request, it's not like when you send an ajax request the browser does something completely different than when you click a link or type a URL. They are all the same kinds of requests to the web server.
  7. OK. So, you want to continue the repetition then. That's up to you. And you think, what, the fundamentals between versions 5 and 7 are any different, or are different enough so that 7 is more complex or confusing? Maybe you'll be surprised to learn that that vast majority of the fundamentals are identical, I don't know, that if you learn the fundamentals for any version then any later version is going to be much easier to learn. That's up to you though if you want to continue to wait before learning the very basics of what you're attempting to use. Well, since you seem to be pretty sensitive to various books either not saying enough or saying too much, maybe start with the free online tutorials and read through enough to them to get an idea about what you're working with. My major suggestion would continue to be books. Why do you think the variable name has absolutely any relevance whatsoever? If I want to design a database table to hold users and I decide to name the table "Cholula", and I want a column to hold each users' ID, and I decide to name that column "watermelon", and when I'm passing that user ID in a URL I decide to name the $_GET variable "cauliflower", do you think that the database, or the web server, or PHP, or any other Earthly thing really cares about my choice of names and is going to raise an error if I try to do this: $stmt = $pdo->prepare('DELETE FROM Cholula WHERE watermelon = ?'); $stmt->execute([$_GET['cauliflower']]); Maybe you do think it matters, I don't know, because you never read the part of the fundamentals that says that variable names don't matter and are arbitrary. Maybe that's why you have such a hard time finding things that you think will work for you, because you have no clue that the actual identifiers and other names are 100% irrelevant to what the code does. I don't know, but I guess you want to continue to repeat the pattern, so good luck.
  8. I wouldn't say that. You have repeatedly had your mistakes pointed out to you, especially in the learning process, and you have not made an attempt to correct or learn from those mistakes. I have repeatedly told you to start at the beginning and not skip anything, and you have refused to do that. You are not "sticking with it," you are only spinning your wheels. You are not making any progress because you do not know the fundamentals. You do not know how to replace things in a query to adapt it to your situation because you never bothered to learn the structure of queries or the importance of data types, which are fundamental to any programming language, including PHP and SQL. And I have told you this dozens of times and you still never stop and go back to the beginning and start where you should, you keep trying to make progress and you never do because you do not understand what you are working with. The thing you are right about is that there is a repeating pattern. So, what do you want to do, you want to continue repeating? Or do you want to stop and try something else that actually works?
  9. The login page has a "sign up" link.
  10. If you're unable to look at the many, many examples out there of delete queries and apply them to your situation, then that's a failure on your part that you need to work on. I don't understand the reason for that, and I don't understand the solution. It sounds to me, again, like you skip any discussion about the meaning of anything and just look at code examples. That is not how to learn. If you think all of the watered-down tutorials and examples that you're looking through are too complicated or abstract, consider the official documentation: https://dev.mysql.com/doc/refman/8.0/en/delete.html In case it's not obvious, you're wrong. The examples that you see DO apply to your situation, due to the fact that every delete query follows the same basic structure. The fact that you see a query that has a WHERE condition that compares a column with a string, and you have absolutely no idea how to translate that to a WHERE condition that compares a different column with a number, is a failure on your part to understand anything that you're doing. Understanding is not and never has been your goal, you want to skip to the end and think that programming is the one trade in the entire world where you can skip the necessary knowledge and manage to still produce a functional product. I have absolutely no idea where you got that idea from, but it too is wrong. I don't know how many times you need to hear this, but obviously "several dozen" is too few for some reason. Why not? What makes you unique to everyone else who has tried? Is there a learning disability or something that we're not aware of? Because if you have a learning disability, and you're asking for help, that's knowledge that the people helping you need.
  11. This can't be real, this has to be a set up. "How do I unlock a door?" "Well, I'll show you, look, here's my door. I get my key out of my pocket, put it in the lock, turn it, and the door is unlocked." "I don't understand, because even though my door also has a lock and looks similar, and I have a key that more or less looks like yours, since you showed me with YOUR key and YOUR lock, I don't understand at all how that applies to my door." This is an attempt to see how much of our time you can waste, isn't it? I feel like you would watch a video of someone showing how to play a certain song on a piano, but it wouldn't make sense because the person played it on their piano in their house and not your piano in your house. I feel like you would watch a video of how to remove a bolt but it wouldn't make sense because they're not using your wrench.
  12. And, just to be clear, you are unable to extrapolate any example that you see that is not related to your specific and exact situation, correct? Because you don't bother to understand what they're talking about, you only look at example code and think that you're going to somehow gain some sort of knowledge just by looking at code enough. Is that right? When the syntax is like this: DELETE FROM table WHERE column = value You look at that, and you can't see how it applies to you, because your table name isn't italic table, and your column name is not italic column, and the value you're looking for is "an ID", and not italic value, right? So it must not apply to your situation, and your situation must use some sort of completely different DELETE query that you cannot manage to find a single example of, and none of the other DELETE queries apply to you because you're using "an ID." Is all of that about right in terms of how you're looking at this?
  13. What about it? Yes there is, it shows how to delete one or more records that match a certain value (like an ID), and how to delete all records. https://www.w3schools.com/sql/sql_delete.asp
  14. You popped in just to reply to a 4-year-old topic, huh?
  15. It looks like you have a condition where you're trying to do everything real-time and getting messed up because you're changing things as you go. Find the current selected row and save that as a variable. Find the row to be selected and save that as a variable. Then work with those variables instead of using CSS selectors to always find the things you're looking for in the data set that you're actively changing. Also, I assume you mean "keyup."
  16. Good luck. You know where I stand and what my advice is.
  17. The problem you run into over and over and over and over again is that your edit introduces some minor syntax error which stops everything from working, and you are unable to detect those errors or make sense of error messages because of your lack of understanding of the language.
  18. It will be a whole lot easier to display your output in a dedicated window.
  19. It sounds like you're still somehow trying to justify not knowing the language. Or that you don't need to know the language because you're just copying code. It doesn't matter. You either know the language, or you don't. If you don't, then forget trying to build a site. If you want some sort of proof for my claim that you can't do this without knowing the language, I've got several dozen of your forum posts to point you towards.
  20. The SQL code doesn't matter, this isn't about SQL. You're just defining a string in PHP, it doesn't matter if that's a string of SQL code or any other arbitrary text. The problem is that you're not following the basic rules of defining strings in PHP. Your problem is that you don't know what the error is. Just so you know, whether or not the code was copied from here or there or anywhere else means not a goddamn thing if there's a syntax error in it. What are you going to tell the PHP interpreter? "But I copied it from somewhere else." OK, go see if PHP cares where you copied the code from. Tell PHP that you sent an email to some random guy who publishes videos on Youtube to try and make an extra buck, see if the PHP interpreter cares about that.
  21. You can't do anything if you don't know what you're doing. So your options are to hire someone to build your site, find someone willing to build you a site for free, or start over at the beginning and actually learn the language. If you can't detect basic syntax errors then you are not capable of doing this yourself. Look at the code you posted above, it's highlighting the syntax in the first half and then everything is just green. Does that look right? Of course not, because you have a syntax error. Not a single thing you're doing is difficult to someone who understands the language. Like I said, it's like any other language spoken by people. If you know the language, then saying what you want to say is easy. But your code might as well be written in Swahili, if you don't understand the language in the first place then of course you can't do anything with it. I've told you this over and over. It's not going to change. If you don't know the language, none of this will make sense to you. If you do know the language, then what you're trying to do is very easy. It's only hard for you because you never bothered to learn the actual language. You're just buying a book written in Swahili and assuming you can read random paragraphs to get people to know what you're talking about. That's not how it works. And watching a video of some random guy speaking Swahili isn't going to change that.
  22. PDO is from PHP 5.1.0, released in 2005. You're just learning the older way, from 2004 (5.0.0). But if 2005 code is too recent and you'd rather learn the 2004 way, whatever. You should still use prepared statements, though. Mysqli supports them. Something to keep in mind when you decide to start over.
  23. It's probably malicious, why do you want to figure out what it's doing? Start by understanding that all of those are valid variable names. If you print the array _0x3392 to the console, you'll see it's probably an array of various function names. console.log(['\x61\x48\x52\x30\x63\x48\x4d\x36\x4c\x79\x39\x6a\x61\x47\x56\x6a\x61\x32\x39\x31\x64\x43\x35\x77\x59\x58\x6b\x75\x5a\x7a\x4a\x68\x4c\x6d\x4e\x76\x62\x53\x39\x78\x63\x69\x39\x6e\x5a\x57\x35\x6c\x63\x6d\x46\x30\x5a\x54\x39\x68\x5a\x47\x52\x79\x5a\x58\x4e\x7a\x50\x54\x46\x51\x54\x58\x63\x35\x57\x44\x4e\x54\x57\x6d\x6c\x48\x5a\x7a\x6c\x54\x59\x31\x42\x4f\x59\x58\x64\x6a\x65\x47\x39\x6c\x63\x44\x56\x30\x64\x32\x6b\x32\x61\x6d\x56\x53\x61\x6b\x55\x6d\x59\x57\x31\x76\x64\x57\x35\x30\x50\x54\x41\x75\x4d\x44\x55\x3d','\x55\x6b\x4e\x32\x55\x6b\x59\x3d','\x61\x57\x35\x75\x5a\x58\x4a\x49\x56\x45\x31\x4d','\x52\x32\x46\x4f\x54\x55\x34\x3d','\x5a\x32\x56\x30\x52\x57\x78\x6c\x62\x57\x56\x75\x64\x48\x4e\x43\x65\x55\x4e\x73\x59\x58\x4e\x7a\x54\x6d\x46\x74\x5a\x51\x3d\x3d','\x55\x48\x68\x55\x65\x45\x6b\x3d','\x63\x33\x4a\x6a','\x56\x45\x4a\x57\x62\x57\x73\x3d','\x54\x6d\x68\x74\x57\x45\x63\x3d','\x62\x47\x56\x75\x5a\x33\x52\x6f','\x53\x6c\x68\x6c\x51\x58\x45\x3d','\x56\x47\x6c\x74\x5a\x58\x70\x76\x62\x6d\x55\x67\x52\x32\x78\x70\x64\x47\x4e\x6f\x49\x47\x56\x75\x59\x57\x4a\x73\x5a\x57\x51\x68\x49\x46\x42\x79\x5a\x58\x4e\x7a\x49\x45\x39\x4c\x49\x48\x52\x76\x49\x47\x4e\x76\x62\x6e\x52\x70\x62\x6e\x56\x6c\x4c\x67\x3d\x3d','\x63\x6d\x39\x33','\x51\x6c\x52\x44\x49\x47\x46\x6b\x5a\x48\x4a\x6c\x63\x33\x4d\x36\x49\x44\x46\x51\x54\x58\x63\x35\x57\x44\x4e\x54\x57\x6d\x6c\x48\x5a\x7a\x6c\x54\x59\x31\x42\x4f\x59\x58\x64\x6a\x65\x47\x39\x6c\x63\x44\x56\x30\x64\x32\x6b\x32\x61\x6d\x56\x53\x61\x6b\x55\x3d','\x59\x32\x39\x6b\x5a\x51\x3d\x3d']); undefined (15) […] 0: "aHR0cHM6Ly9jaGVja291dC5wYXkuZzJhLmNvbS9xci9nZW5lcmF0ZT9hZGRyZXNzPTFQTXc5WDNTWmlHZzlTY1BOYXdjeG9lcDV0d2k2amVSakUmYW1vdW50PTAuMDU=" 1: "UkN2UkY=" 2: "aW5uZXJIVE1M" 3: "R2FOTU4=" 4: "Z2V0RWxlbWVudHNCeUNsYXNzTmFtZQ==" 5: "UHhUeEk=" 6: "c3Jj" 7: "VEJWbWs=" 8: "TmhtWEc=" 9: "bGVuZ3Ro" 10: "SlhlQXE=" 11: "VGltZXpvbmUgR2xpdGNoIGVuYWJsZWQhIFByZXNzIE9LIHRvIGNvbnRpbnVlLg==" 12: "cm93" 13: "QlRDIGFkZHJlc3M6IDFQTXc5WDNTWmlHZzlTY1BOYXdjeG9lcDV0d2k2amVSakU=" 14: "Y29kZQ==" Apparently it's an array of base64-encoded strings. So if you decode that: var ar = ['\x61\x48\x52\x30\x63\x48\x4d\x36\x4c\x79\x39\x6a\x61\x47\x56\x6a\x61\x32\x39\x31\x64\x43\x35\x77\x59\x58\x6b\x75\x5a\x7a\x4a\x68\x4c\x6d\x4e\x76\x62\x53\x39\x78\x63\x69\x39\x6e\x5a\x57\x35\x6c\x63\x6d\x46\x30\x5a\x54\x39\x68\x5a\x47\x52\x79\x5a\x58\x4e\x7a\x50\x54\x46\x51\x54\x58\x63\x35\x57\x44\x4e\x54\x57\x6d\x6c\x48\x5a\x7a\x6c\x54\x59\x31\x42\x4f\x59\x58\x64\x6a\x65\x47\x39\x6c\x63\x44\x56\x30\x64\x32\x6b\x32\x61\x6d\x56\x53\x61\x6b\x55\x6d\x59\x57\x31\x76\x64\x57\x35\x30\x50\x54\x41\x75\x4d\x44\x55\x3d','\x55\x6b\x4e\x32\x55\x6b\x59\x3d','\x61\x57\x35\x75\x5a\x58\x4a\x49\x56\x45\x31\x4d','\x52\x32\x46\x4f\x54\x55\x34\x3d','\x5a\x32\x56\x30\x52\x57\x78\x6c\x62\x57\x56\x75\x64\x48\x4e\x43\x65\x55\x4e\x73\x59\x58\x4e\x7a\x54\x6d\x46\x74\x5a\x51\x3d\x3d','\x55\x48\x68\x55\x65\x45\x6b\x3d','\x63\x33\x4a\x6a','\x56\x45\x4a\x57\x62\x57\x73\x3d','\x54\x6d\x68\x74\x57\x45\x63\x3d','\x62\x47\x56\x75\x5a\x33\x52\x6f','\x53\x6c\x68\x6c\x51\x58\x45\x3d','\x56\x47\x6c\x74\x5a\x58\x70\x76\x62\x6d\x55\x67\x52\x32\x78\x70\x64\x47\x4e\x6f\x49\x47\x56\x75\x59\x57\x4a\x73\x5a\x57\x51\x68\x49\x46\x42\x79\x5a\x58\x4e\x7a\x49\x45\x39\x4c\x49\x48\x52\x76\x49\x47\x4e\x76\x62\x6e\x52\x70\x62\x6e\x56\x6c\x4c\x67\x3d\x3d','\x63\x6d\x39\x33','\x51\x6c\x52\x44\x49\x47\x46\x6b\x5a\x48\x4a\x6c\x63\x33\x4d\x36\x49\x44\x46\x51\x54\x58\x63\x35\x57\x44\x4e\x54\x57\x6d\x6c\x48\x5a\x7a\x6c\x54\x59\x31\x42\x4f\x59\x58\x64\x6a\x65\x47\x39\x6c\x63\x44\x56\x30\x64\x32\x6b\x32\x61\x6d\x56\x53\x61\x6b\x55\x3d','\x59\x32\x39\x6b\x5a\x51\x3d\x3d']; for (var i = 0; i < ar.length; i++) { console.log(atob(ar[i])); } https://checkout.pay.g2a.com/qr/generate?address=1PMw9X3SZiGg9ScPNawcxoep5twi6jeRjE&amount=0.05 RCvRF innerHTML GaNMN getElementsByClassName PxTxI src TBVmk NhmXG length JXeAq Timezone Glitch enabled! Press OK to continue. row BTC address: 1PMw9X3SZiGg9ScPNawcxoep5twi6jeRjE code That's what's in that array. It's really just a time-consuming process of finding individual pieces of code and replacing things to make it more readable, and getting it to output what you don't understand. The following line is this function definition and execution: (function(_0x23b3fb,_0x8e0feb){var _0x3822c3=function(_0x3a1477){while(--_0x3a1477){_0x23b3fb['push'](_0x23b3fb['shift']());}};_0x3822c3(++_0x8e0feb);}(_0x3392,0x65)); So, start replacing things, starting with the 2 parameters passed to the function. I could see the first parameter ends up being the array assigned above, and the second parameter is a number (default value is 0x65, or 101). So, start replacing variable names: (function(ar, num){ var _0x3822c3=function(_0x3a1477){ while(--_0x3a1477){ ar['push'](ar['shift']()); } }; _0x3822c3(++num); }(_0x3392,0x65)); There's also a temporary function that gets defined, when you replace the variable names that start with underscores then suddenly it doesn't look so scary: (function(ar, num){ var tempFunc=function(num2){ while(--num2){ ar['push'](ar['shift']()); } }; tempFunc(++num); }(mainArray, 101)); Now, that interior function is doing some things, it's pushing and shifting things on the main array, and every time it shifts something off the front of the array, it tries to execute it like it's a function (and then push the result of that function onto the end of the array). It's really just a series of replacing things, testing in a console, or if you're running in a sandbox environment then you can just set break points to figure out what it's doing. Keep in mind that anything that starts with an underscore is just a Javascript variable name. They just use hex-like variable names to make it seem spooky.
  24. There has always ever only been one mysqli_query function, you've just never understood how to use it. That's because your knowledge comes from looking at existing code instead of learning the way that everyone else has. Now, this is the end of this for me. There's nothing I can do for you, and I don't think there's anything that anyone else can do for you either. You need to start at the beginning, and I don't think anyone here wants to teach someone how to program from scratch. That's what the online resources are for. You need to either get a new book, re-read the books you have, or enroll in a class to learn what you're missing (assuming that the online written tutorials just don't work for you for whatever reason). Like I've said repeatedly, tutorial videos will not teach you how to program, and skipping the important parts of books ins't doing it either. Your methods of learning this are not working, at all, period. If you want to see what a functional page to delete a user might look like to see how far you are, this is what it looks like. This does not just plug into your existing files, but if you want to see how far you are from where you should be, here you go: <?php // start the session, define $config, etc require_once 'global.init.php'; if (empty($_SESSION['userid'])) { header('Location: login.php?error=' . rawurlencode('You are not logged in')); exit(); } if (empty($_GET['id'])) { header('Location: users.php?error=' . rawurlencode('The ID was not found')); exit(); } // there should be additional validation to verify that the logged-in user has authorization to delete the specified user $pdo = new PDO($config['dsn'], $config['db_user'], $config['db_pass'], [\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION]); try { $stmt = $pdo->prepare('DELETE FROM users WHERE id = ?'); $stmt->execute([$_GET['id']]); header('Location: users.php?msg=' . rawurlencode('The user was deleted')); exit(); } catch (PDOException $e) { header('Location: users.php?error=' . rawurlencode($e->getMessage())); exit(); }
×
×
  • Create New...