Jump to content

Ingolme

Moderator
  • Posts

    14,901
  • Joined

  • Last visited

  • Days Won

    177

Everything posted by Ingolme

  1. No, that is incorrect. Each line is its own set of conditions completely independent from the other line of code. It is equivalent to the following code: if(!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $str_browser_language = strtok(strip_tags($_SERVER['HTTP_ACCEPT_LANGUAGE']), ','); } else { $str_browser_language = ''; } if(!empty($_GET['language'])) { $str_browser_language = $_GET['language']; } else { $str_browser_language = $str_browser_language; }
  2. It is not inside the user_stats menu item, it is in front of it, 40 pixels from the left and 0px from the top of the #iconscontainer element.
  3. Yes. You can use the PHP database libraries in any part of your program.
  4. There are three different things that you need to be aware of: The name of the GET key, the name of the PHP variable and the name of the database field. When it comes to SQL, the only one that matters is the name of the database field. The code that you just provided only handles the GET key and the PHP variable. You should start learning from the very beginning, the W3Schools PHP tutorial is a good place to start, but you have to read and understand every single page of the tutorial.
  5. "id" is just another field, just like CustomerName. They're all just fields in the database. DELETE works equally well whether you filter using strings or numbers.
  6. It looks pretty straightforward. It indicates the request method, headers and body as well as what responses you can expect. What more do you need?
  7. I don't think that can be changed, it is built into the font. There are browser-specific CSS selectors to change the selection box, but I think it only lets you change the colors and not much else. I haven't memorized them so I'd have to look them up.
  8. The purpose is to show which syntax is allowed, the values are the same to make it more clear where the difference is between the two lines of code. Notice that there is an extra comma in the "Not allowed" code.
  9. You can LEFT JOIN the tables. Of course, wherever there's a NULL, all you'll get is NULL for the fields in table 2. If you want to completely ignore NULL rows, a plain JOIN will do that.
  10. Yeah, it's obfuscated. You can decode the strings by just printing them out. It's a long and tedious process, so I'm not going to waste my time on it, but I'll show you some examples with one of the strings: '\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' The first step is to convert the character codes into actual letters. Just opening the Javascript console in your browser, pasting the string and pressing enter will do that and it yields this: aHR0cHM6Ly9jaGVja291dC5wYXkuZzJhLmNvbS9xci9nZW5lcmF0ZT9hZGRyZXNzPTFQTXc5WDNTWmlHZzlTY1BOYXdjeG9lcDV0d2k2amVSakUmYW1vdW50PTAuMDU= The "=" on the end makes it obvious that it's base64 encoded. Javascript uses atob() and btoa() to convert to and from base64. atob() will decode this, so I write this into the Javascript console: atob("aHR0cHM6Ly9jaGVja291dC5wYXkuZzJhLmNvbS9xci9nZW5lcmF0ZT9hZGRyZXNzPTFQTXc5WDNTWmlHZzlTY1BOYXdjeG9lcDV0d2k2amVSakUmYW1vdW50PTAuMDU=") The console then prints this: https://checkout.pay.g2a.com/qr/generate?address=1PMw9X3SZiGg9ScPNawcxoep5twi6jeRjE&amount=0.05 That's one string decoded. It's up to you to decode all the rest.
  11. I recommend you read every post in this thread carefully and consider reading books, tutorials and other resources more carefully as well. It's as though you ignore anything longer than a sentence. You have to stop writing code and begin learning to read code instead.
  12. Why is there a "{" on the first line of your code?
  13. Personally, I don't think books should just be giving examples of how to do things at all. They should be focusing on teaching the material and only provide examples that help solidify understanding that material. A good book wouldn't tell you how to make a login system, it would give you the knowledge to figure out how to make a login system on your own.
  14. A session cookie does not need a consent notice, but a "Remember me" cookie identifies a user for a long period of time and is not crucial for site functionality, so you probably need a notice for it. I'm not an expert on this, so it might be better to look for a more definitive answer.
  15. The first step is to learn about functions. Here is the tutorial that teaches how to create and run a function: https://www.w3schools.com/php/php_functions.asp
  16. The first line is just the assignment of a string to a variable. It actually does not do anything at all on its own. As for the other two lines, at least one of them should make the least bit of sense to you. You should know by now about variables and if statements and understand what this line is doing: if ( $num > 0 ) As for this part of the code: function deleteRecord( $dbc ) It is declaring a function, but the function never runs, so none of the code inside the function is doing anything. You need to add some code that explicitly runs this function.
  17. What does this line do? $q = 'DELETE * FROM users' WHERE id = '$user_id'; And this one? $r = mysqli_query( $dbc , $q ) ; And these two? $num = mysqli_num_rows( $r ) ; if ( $num > 0 ) Can you describe to me how functions work?
  18. Please describe what each of those lines of code is doing and why it is needed. I can't help you learn if I don't know which parts you don't understand.
  19. The code in your post above has syntax errors, but even if it did not, it would not do anything because the function is not being invoked. We're going to have to go through exercises to make sure you understand all of the code that you're copying. Please go line by line and describe to me exactly what each line does and why it's there. Here is the tutorial page for the SQL delete statement: https://www.w3schools.com/sql/sql_delete.asp Please read it any try to understand it, do not just copy the code.
  20. Instead of float:right, use text-align:right. I'd recommend using a stylesheet for your CSS instead of style attributes.
  21. It means that you can use "$0" as a variable in the console to reference the currently selected element.
  22. You forgot a closing quote for the href attribute.
  23. It won't work if you run the HTML file from your desktop because browser security settings prevent AJAX requests from local files. You have to test this in a server environment.
  24. Which content management system is that? The "CSS Class Name" field is used to put a value into the element's class attribute, it doesn't let you directly use CSS rules. You will need to find some settings that let you include a stylesheet.
×
×
  • Create New...