• Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by justsomeguy

  1. 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)
  2. 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, then you're telling it to connect to "". 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.
  3. 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.
  4. Well, unless you really do want to append "root" to the end of the hostname (which would never work if you're using an IP address for the host) and use a blank username, the code you have is wrong.
  5. I'm not really clear what you're asking. If you're handling the request with PHP, then you can get the input data, do whatever you need with the database, load a template or something and populate it, and then I guess load another template for the rest of the page and insert the other template before sending the response to the browser. Are you already using some kind of template engine?
  6. Right, I said if they are *not* on your local network, then you need to configure your internet-facing router. You also have to make sure that your ISP doesn't block inbound port 80 traffic for your account, sometimes they do that on home service accounts. If they are on your local network then they just need to use your computer's network name or local IP as the domain name.
  7. You can look up any built-in PHP function or class in the manual: http://php.net/manual/en/mysqli.construct.php If you don't know the difference between what a period and comma do, then you should start with the basics of the language before trying to write code like this. A tutorial that is just telling you what to type probably isn't teaching anything.
  8. If it's someone who is not on your local network then you need to configure your router to forward traffic on port 80 (at least) to your computer. It doesn't work by default because your router doesn't know what to do with incoming HTTP traffic.
  9. The 3 parameters to mysqli_connect are the host, username, and password. You have a dot between the host and username instead of a comma, so you are concatenating those into 1 string and passing that as the host. So you're passing "" as the host name. That's wrong. Then you're passing an empty username and no password, because you're only passing 2 values instead of 3. You can also pass the database name as the 4th parameter instead of using mysqli_select_db. The reason why PHP doesn't complain about that error is because all of the parameters to mysqli_connect are optional, so it doesn't care that you're only passing 2. It looks up the default values in the PHP configuration if they aren't passed.
  10. Are you sure your code isn't the problem? $con = mysqli_connect('mysql service db ip' . 'root', ''); You're concatenating the IP address with the username?
  11. You could have separate database tables for user types and permission lists, so that you can build some pages to create new user types and specify the permissions for each one, and then you can pick a user type for each user to give them those permissions.
  12. Session_register hasn't been there since PHP 5.4: Your code won't work in PHP 7 either, because you're using the old mysql extension, which is not in PHP 7. You need to update that to something modern, and you need to use prepared statements so that your code isn't vulnerable to SQL injection attacks. You should also consider using PHP's built-in password hashing functions, md5 hasn't been considered cryptographically secure since the mid 90s.
  13. If I search for "php oop crud tutorial" it shows several results, what are you looking for that isn't there?
  14. Format that code so it's readable, and add some console.log statements to have it print out what it's doing. function subset(arra, arra_size) { var result_set = [], result; for(var x = 0; x < Math.pow(2, arra.length); x++) { console.log('x is ' + x); result = []; i = arra.length - 1; console.log('i is ' + i); do { console.log('(1 << i) is ' + (1 << i)); console.log('x & (1 << i) is ' + (x & (1 << i))); if( (x & (1 << i)) !== 0) { result.push(arra[i]); } } while(i--); console.log('result:'); console.log(result); if( result.length >= arra_size) { result_set.push(result); } } return result_set; } Do you understand the purpose of that code, do you understand why it returns what it does for the input?
  15. What do you mean by "core-php"? Just regular PHP?
  16. When it says the connection timed out, that usually means it can't reach the database server. Maybe it's a firewall issue, maybe you're just not using the right name.
  17. The page itself opens, but the developer tools show a 404 on one of the Javascript files I think.
  18. There's a 404 for one of the files on that page, is that the problem? Does this have anything to do with XML?
  19. I don't think any header will tell you if a user exists or not. The original redirect is just because they're redirecting you from http to https. I wouldn't assume that Facebook will send a header telling you whether or not something exists on their site. Facebook does have an API, I haven't looked deeply into the capabilities but I would imagine that most things which people need would be supported in their API.
  20. 302 is a redirect. I don't think redirect would be "true", I think that would be false. Maybe you can check the location header to see where it's trying to redirect to and base your conclusion on that.
  21. One problem with that code is that the variable num is not defined inside the Display function, so you're passing an undefined value to Numbers. How do you call those functions from the interface though, how are those buttons and the click handlers defined?
  22. I suppose you could block your browser from downloading the Javascript files to do that on that site, but other things on the site might stop working also. You'll need to inspect the Javascript code to see what it specifically does when you reach the end, and write code for an extension like Greasemonkey or some other way to have your browser execute your code on that site which will essentially do the same thing on load instead of on scroll.
  23. HTML is the markup language that web browsers use to render things like tables, buttons, images, etc. HTML defines the structure of a web page. PHP runs on a web server and is how a user interacts with a web site. Any time a browser sends data to a web server, like through a form, or cookies, or variables in a URL, a server-side language like PHP is needed to use that data however you want to use it. PHP can output HTML so that the browser renders the page that is produced by the output of the server-side language. XAMPP is a development package that includes the Apache web server, PHP configured for use by Apache, the MySQL database configured for use by PHP, and phpMyAdmin, which is a PHP program that gives you a GUI for managing MySQL. The alternative to a package like XAMPP is to install your own web server, download and install PHP and configure it and the web server to work together, download and install MySQL and configure it yourself, etc.
  24. Yeah, that looks pretty stupid. Seems like you could accomplish the same thing with this: while ($this->update_table_structure()); You don't need a body of the loop at all. Also a question is why "update table structure" needs to be called multiple times sequentially instead of just once.
  25. If sendKeys expects a charsequence, why are you passing an int to it? Shouldn't you do something with that random number, like converting it to a character, before passing it to sendKeys?