Jump to content

justsomeguy

Moderator
  • Content count

    29,960
  • Joined

  • Last visited

  • Days Won

    368

Everything posted by justsomeguy

  1. Feedback on database design

    I'm talking about the columns in the game table, not the gametag and gameplatform tables. The unique constraint on something like the gametag table should be the gameID and tagID, not an autonumber. The combination of the gameID and tagID is what needs to be unique, you wouldn't want multiple records with the same values for those fields. That's why it should be the primary key, and making it the primary key will also help with searching.
  2. The $_SESSION Variable - Who Owns It? Where Is It Stored?

    All options have multiple ways to get set, and a default. You can create a phpinfo page to check the local and master values of every setting. They describe the default behavior, your configuration might differ. That will be the session.cookie_lifetime option. http://php.net/manual/en/session.configuration.php
  3. Localhost

    Maybe you didn't do the port fowarding thingy correctly, or maybe your ISP is just blocking incoming traffic on port 80.
  4. Feedback on database design

    Are the GameTagID and GamePlatformID columns in the game table left over from something else? It doesn't look like those are necessary. For the gameplatform and gametag tables, I would get rid of the int primary key and make both of the other columns part of the primary key, so that you can enforce unique data there.
  5. Subir archivo en la misma página

    If you want to upload a file using ajax, the best way to do it is to use the FileReader object. https://developer.mozilla.org/en-US/docs/Using_files_from_web_applications
  6. Please help a newbie

    Instead of printing your own error message, print the actual error message from MySQL. http://php.net/manual/en/mysqli.error.php
  7. The $_SESSION Variable - Who Owns It? Where Is It Stored?

    The location of the files is also configured in php.ini, in session.save_path. On our servers, for example, it stores session files in /var/cpanel/php/sessions/ea-php56 when the account is running PHP 5.6. This is not significant to a PHP programmer though, it's not important how the data actually gets stored unless you're trying to write your own session storage handler (and the vast majority of programmers have no reason to do this). The important part is that it works.
  8. something I cannot understand in javascript code

    Well, if you know what a subset is, and you know that this function finds subsets, then you should be able to figure out the answers to some of those questions. It's the number of possible subsets. That's how it determines which elements to pull from the source array for each subset. If you run the version I posted with all of the output it makes it more obvious. That's backwards, it subtracts 1 from the array length, and that is the index of the last element in the array. It's the minimum size for the returned subsets. Passing 2 means they aren't interested in the subsets with a length of 0 or 1.
  9. The $_SESSION Variable - Who Owns It? Where Is It Stored?

    That's configured in php.ini. The default is to use file storage, so it creates a text file for each session ID that contains the contents of the session. This is why you can only store scalar values in the session, and not resources like an open file handle or database connection. There are also a series of functions that allow you to create your own session handlers, for example you could use those to store all session data in a database. On the user's computer, and again this is configurable, the default is to use a cookie to send the session ID to and from the server.
  10. Need Two Slideshows — Both with Arrow and Dots

    You need to add the second parameter when you call currentDiv, like you did with plusDivs. In order for the function to highlight the correct dot, each of those dot elements needs to specify which slide show it belongs to, so that showDivs can get the correct set of dots. One way would be to add a class name or data attribute to the dot container elements, or to the dot elements themselves.
  11. Please help a newbie

    There's an or statement after that line.
  12. creating database

    How do you open the terminal window?
  13. Please help a newbie

    Do you see your error messages? You can have it print the actual error message from MySQL: http://php.net/manual/en/mysqli.construct.php
  14. Load Page with Filler Update

    It sounds like the regular use case for PHP. You can have PHP send to the browser any content you want, PHP can output any text content like HTML, CSS, Javascript, etc, you can have it output an image, a PDF document, whatever you want. So it sounds to me like you're describing the general use case where PHP gets some sort of post or get data as input and produces HTML as output. You can have your HTML right in the PHP code so that it just prints whatever you tell it to, or you can have it load partial HTML templates in other files, fill in whatever data you want, and assemble the various parts into the final markup.
  15. something I cannot understand in javascript code

    Like that page says, it returns all subsets longer or equal to a certain length. Do you understand what a subset is?
  16. Load Page with Filler Update

    No, browsers send requests to the server, and the server sends a response back to the browser. The browser initiates the connection, not the server. The server just handles connections that get sent to it. You use ajax when you have a page that is already open and loaded, and you want to change some content on the page from the server without refreshing the entire page. You can see it on the forum when you submit a new post and it just adds it to the thread but doesn't refresh the entire page, it sends an ajax request to the server with the post content, the server responds with some sort of response that the Javascript is looking for (maybe HTML markup, maybe a JSON object, etc), and then the ajax callback function updates the page based on the server response. If it's on a separate domain that's going to be an issue, browsers block ajax requests to domains other than the originating domain for security reasons. The way to bypass that is to send the ajax request to a local PHP page, which will act as a proxy to send the request to the remote server, get the response, and send it back to the originating page. It's important to note in that case that the request to the remote server comes from the PHP server, not the user's browser. I'm still not clear on exactly what you're trying to do. It sounds like you just want a user to click a link on some other website, to your server. Like, a regular link like any other link on the internet, that goes to your server, and the user's browser loads the URL on your servers and sees whatever you want them to see. Just like any other link on any other website. Is it any different than that?
  17. Load Page with Filler Update

    What are you, specifically, referring to here. Are you talking about using Javascript to load content via ajax? Are you talking about PHP getting data from a database, or sending a request to a remote server or something, and then using that data when it builds the response for the browser? I'm not sure why it's significant that the source is external, I assume by external you mean a remote server separate from the web server handling the request. If you're saying the page isn't loaded by the browser yet, then nothing can happen until the browser sends a request for the page and gets a response from the server. What other purposes? What's the main purpose of this page? Why not? I think we're beyond the discussion of abstract concepts and it's time to get specific.
  18. Problem Connecting to MySQL

    If the server sends a 404 response that means it cannot find the file you are looking for. The contact.php file is not on the web server where you're looking for it, it doesn't have anything to do with the code in the file unless the server is configured to respond with a 404 for other errors for some reason.
  19. Load Page with Filler Update

    I'm just not sure what you mean by that. "Call a page", do you mean get the HTML contents of a page and do something with it? Are you saying you want to send an ajax request or something, get the response, and add it to the current page? That's possible.
  20. Load Page with Filler Update

    This is a bit abstract, can you show your code and what you're trying to do? What do you mean by the host page?
  21. Feedback on database design

    You can post that stuff here.
  22. Basic Push Menu with jQuery

    How about setting overflow-x?
  23. How to call method

    myMethod just contains a string, it's not a function. It looks like you can use GetRef to get the function by name. e.g.: f = "OpenApplication" func = GetRef(f) func(url)
  24. I'm saying that this line: $con = mysqli_connect('mysql service db ip' . 'root', ''); Is telling it to connect to "mysql service db iproot" and send a blank username, and to use the default password as configured in php.ini. If you replace it with an IP address, like 127.0.0.1, then you're telling it to connect to "127.0.0.1root". Adding "root" to the end of it breaks the IP address. Because you have a period there instead of a comma, and a period is a string concatenation operator. You aren't passing 3 values to mysqli_connect, you're passing 2. I'm not sure how else I can say that any clearer. If you don't know what string concatenation is then you need to start with the PHP basics, it's one of the basic operators.
  25. Accessing my Localhost from other computer

    If you want to look into it, figure out which router you have and look up how to configure it (there should be a web page GUI), and then you need to set up port forwarding, to forward traffic on port 80 to your server's IP address. You'll also want to make sure that computer uses a static IP from the router instead of getting a dynamic IP every time so you don't have to change the port forwarding rules.
×