Jump to content

justsomeguy

Moderator
  • Content count

    30,199
  • Joined

  • Last visited

  • Days Won

    398

justsomeguy last won the day on November 22

justsomeguy had the most liked content!

Community Reputation

973 Excellent

6 Followers

About justsomeguy

  • Rank
    More Human Than Human
  • Birthday 06/03/1979

Contact Methods

  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Location
    Phoenix

Previous Fields

  • Languages
    Focusing on PHP and JavaScript

Recent Profile Visitors

273,666 profile views
  1. How to compare two numbebrs

    Yeah that's what you're telling it to do, convert the the first 2 characters to a number and check if it's greater than 8. If that's not what you want to do, what do you want to do?
  2. touchstart and click on refresh only

    Any Javascript errors will be on the console. You can also add some console.log statements in that code to have it print out what it's doing and verify.
  3. Date time not working...

    You have to realize that when you tell it Sunday, it's going to get the next Sunday. If you run that at Monday at 1am, and tell it you want Sunday, it's going to get the next Sunday, not yesterday. You may need more logic to figure out what you want. For example, get the current day of the week first and go from there. If the current day is Sunday, and it's after 9:55, or the current day is Monday and it's before 1:30, then do whatever you want to happen.
  4. Two Forms, Two Actions, Same Page

    I don't think your question is worded correctly, $_POST is available on every request but your browser will only send one request at a time. Meaning you can only submit one form at a time. Anything that you want to be submitted all needs to be in the form. Of course, you can use Javascript to add or remove form elements if you want to build an interface like that. But each request to the server is only 1 request, you don't send multiple requests at the same time other than if you're using ajax to send a bunch of requests, but even so that's not the best idea. If you find yourself sending multiple requests in a short period you probably need a more efficient design, requests have overhead. If you're just asking how you can structure a page with multiple forms where you can figure out which form was submitted, there's a post about that here: http://w3schools.invisionzone.com/topic/12509-php-tips-and-tutorials/ I would assume that the trigger would update the timestamp, but the final word there is to just test it.
  5. How to compare two numbebrs

    If you want to read the first 2 characters you can use left: https://www.w3schools.com/asp/func_left.asp You're comparing characters and numbers. When you do that it converts the characters to numbers, and if you look at a character table, "A" is 65 and "a" is 97, so it's never going to be less than 8. If you want to compare them like numbers then convert the characters to numbers first. You can use CInt. https://docs.microsoft.com/en-us/dotnet/visual-basic/language-reference/functions/type-conversion-functions
  6. touchstart and click on refresh only

    There's not really enough context to suggest what the problem is, but the first step is to make sure you're finding Javascript error messages if there are any.
  7. why the damn (')?

    ORDER BY order You should have noticed that when you were writing the code, ORDER is obviously a reserved word. If you're going to use reserved words as identifiers then you need to surround them with backticks so that MySQL knows you are referring to an identifier instead of the reserved word.
  8. Date time not working...

    You don't need to change the first 3 lines of your original code. You only need to change the if statement. The getTimestamp method does not accept any parameters. http://php.net/manual/en/datetime.gettimestamp.php
  9. Select statement with And & Or at the same time

    That list of ORs isn't going to do anything (or, more specifically, it's going to return every row where any of those 5 columns are not empty). If you want to test if a certain value is in multiple columns you need to spell it out: Col1 = '$ses_memberID' OR Col2 = '$ses_memberID' OR ... You should also use parentheses to group the OR and AND operators to be explicit about what you're telling it to do. Lastly, you should use prepared statements whenever you need to put data in a query.
  10. This forum offers a copy button when you select text. If the user selects the text themselves then you don't have to do anything, you can just tell the browser to copy it, the hard part is getting the text selected.
  11. form validation

    Again, I'd strongly recommend looking into prepared statements. There's no reason to learn the wrong way to do something, then have to unlearn that and learn the right way. Just start with the right way. That means using prepared statements any time a query has data in it (or, for good practice, just every time). Like I said, mysqli supports prepared statements, but they're easier with PDO.
  12. SELECT JOIN - A Failed Query

    Yeah, I wouldn't think that the aliases would expand over the union because each of those select queries stands alone.
  13. Web Standard X11 (Primary Digital Named Colors)

    I just don't agree with that. Color names are over-rated in a global world. Instead of trying to figure out what someone means when they tell me they want the background to be dunkelgelb, they could just tell me to use #938200 or whatever the specific value is. Mathematics is the only universal language we have. Trying to tack on words in various languages that everyone doesn't even speak or understand as a replacement for a concise definition is not progression, it is regression.
  14. form validation

    You hash the password prior to inserting in the database, but you add it to the database like any other value. You wouldn't insert the plain text password from $_POST, you hash that password, get the hashed value, and then insert that hashed value into the database. I would recommend that you learn how to use PDO for the database work though. You need to use prepared statements when you're putting data in a query, and PDO is just easier and less complex for prepared statements than mysqli. http://php.net/manual/en/pdo.prepare.php http://php.net/manual/en/pdostatement.execute.php
  15. What does this code do?

    It just sets a variable to another value. That value comes from $_GET, which holds all of the values that were included in the URL.
×