Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


justsomeguy last won the day on October 19

justsomeguy had the most liked content!

Community Reputation

1,083 Excellent

About justsomeguy

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

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Location

Previous Fields

  • Languages
    Focusing on PHP and JavaScript

Recent Profile Visitors

287,975 profile views
  1. justsomeguy

    Array declaration

    You can use redim to set a different length.
  2. justsomeguy

    get session cookie value from the browser

    Just to get your terminology right, that's not a session cookie. A session cookie is a cookie with an expiration of 0, which the browser removes when you close the window. If you want to see what the browser has saved, in the Firefox developer tools, for example, there is a Storage tab where you can see things like the cache, cookies, local databases, etc. In the list of cookies, if the "Expires On" column says "Session", then that's a session cookie. A cookie with an expiration date is not a session cookie. If you want a cookie which stays until removed by the user, set an expiration date far in the future. You can also use localStorage to store the same information. Many websites do that, if you set cookies or localStorage then you can ensure that you're tracking individual web browsers instead of something more vague like entire IP addresses. Many sites that don't necessarily require a login store any individual user preferences in cookies. Otherwise, if a user is logged in then the site will usually use a database. Using the PHP session to track users works fine as long as you only care about saving data for that individual website visit. If you want the data to still be there the next time they visit, don't use the session, use cookies or localStorage. Also, there are ways to try to "fingerprint" a browser so that you can more accurately determine if they are unique, but again in a large organization with tight group policies, all of the browsers might be the same. But Javascript will expose a lot of information about a browser that you can use to try to determine if this is a new unique browser or not. You can learn more about that here: https://amiunique.org https://panopticlick.eff.org
  3. justsomeguy

    user id

    That code is syntactically correct, but it doesn't do what you think it does. This reminds me of trying to actually speak a different language. My wife speaks Portuguese and Finnish. I feel like this is like me learning a few basic nouns and verbs and then trying to travel to Brazil or Finland and hold an entire conversation with someone without ever taking a class or reading a book, just watching a few videos of native speakers talking. Other than the fact that the code will actually execute now, even though it would show several warnings, your SQL query isn't going to return any results (or, more specifically, it's going to return every user who doesn't have an email address). Can you see why? Since that code will actually run, I suggest you actually run it, look at the warnings from PHP, and try to figure out what the problems are.
  4. justsomeguy

    newbie wants to learn - brand new website

    I'm not familiar with blogspot hosting, but you may need a different hosting plan where you can just upload all of your own files instead of using a web-based editor. Again, I don't know if they offer that or not.
  5. justsomeguy

    user id

    But you don't know the basics, so it sounds like that's exactly what you need to read.
  6. justsomeguy

    JavaScript function collision?

    If you can paste the relevant code directly on the forum that would be better than asking people to download a zip file. If you want to actually run functions simultaneously, I would imagine that using setTimeout with a timeout of 0 would create a child thread to run each one. I don't know what you're thinking about in jQuery, but jQuery does use method chaining quite a bit. That's not simultaneous though, that's sequential.
  7. justsomeguy

    A Flexible PHPMailer Factory Class with Traits

    If that method is different in each child class, then that's how you do it. Everything uses the same stuff except whatever needs to be different, which you would make abstract methods. The goal is so that you don't need to duplicate the same code among classes, all of that goes in the parent class and then only the code that changes is in the child classes.
  8. justsomeguy

    user id

    I was just thinking about this and had a question - specifically which parts of the book HAVE you read?
  9. justsomeguy

    user id

    Well, you think that maybe you should start with the basics? I mean, we've explicitly said multiple times in this and your other threads what you need to do and it doesn't sound like it's getting through. You're obviously missing the basic information. And, if you can't or don't want to configure PHP to display all errors in the config file, then copy and paste your code here to notice that it has an error which will stop any code from running, including those first couple lines that make sure that all error messages will be displayed: https://www.piliapp.com/php-syntax-check/ If you don't fix that error then the code will not execute at all, there will only be an error message in an error log sitting ignored on your server somewhere.
  10. justsomeguy

    Export From SQL to flate file

    Look at the documentation for whatever you're using, you're using a command called Export-Csv. Look at the options for it.
  11. justsomeguy

    user id

    You have syntax errors in your echo line, the quotes aren't right. You need to fix that for the code to run at all. You also have a return statement, do you know what return does? If you don't, look it up. Importantly, it stops code execution. You really need to re-read the sections in the book on variables. You're trying to use a variable called $user_id, but you never create the variable and set a value for it. You have the user ID available, you're just not using it, instead you're trying to use a non-existent variable called $user_id. The name doesn't matter, either, it doesn't matter that your database has a column called user_id if you're thinking there's some sort of connection there. There is no connection. The names are arbitrary. If you don't create a variable called $user_id and set a value, then it doesn't exist. There's no magic to that, it's not complex - if you don't create it, it doesn't exist.
  12. justsomeguy

    Installing MeCab

    If you're talking about the server that you have an account on, you're limited to only accessing your home directory, nothing outside of that.
  13. justsomeguy

    user id

    Are you running and testing the code? You should do that, and make sure you've got error messages enabled: ini_set('display_errors', 1); error_reporting(E_ALL);
  14. justsomeguy

    GreenSock AP - Parameter Specification

    If you have an existing object that you're trying to set a property for, yes that's how you set it. I don't have a word for that, but it's a decrement operation. Not necessarily in this case though, because it's just a string of text. The string of text only has whatever meaning their code gives to it. Maybe that's given as a value to the built-in CSS animation properties though. Operators like +=, -=, *=, /= etc are all used. It's just shorthand. These are equivalent: x = x + 1 x += 1 Those kinds of operations are used so frequently that it was decided to make a shortcut operator for it, like was done for ++ or --.
  15. justsomeguy

    user id

    I don't know if you're overthinking it, or what. You need to get certain data from the database, at least the first name and last name, right? So, your SQL query needs to specify that data to get. You have the user ID, right? So, you use that to look up the appropriate user in the database. Your SQL query needs to specify that you are looking for a user with a specific user ID, not a specific email. You should already know where you get the user ID from, because it's been mentioned many times, in this thread and your others. You really need to make an effort to understand what the existing code is doing and why, what you're trying to do, and then how to modify the existing code to get it to do what you need it to do. You already have a SQL query where it looks up a user based on certain criteria, all you need to do is change those criteria for your needs. It's not a difficult solution, and you're probably overthinking it.