justsomeguy

Moderator
  • Content count

    29,937
  • Joined

  • Last visited

  • Days Won

    367

justsomeguy last won the day on August 12

justsomeguy had the most liked content!

Community Reputation

916 Excellent

6 Followers

About justsomeguy

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

Contact Methods

  • Website URL
    http://
  • ICQ
    0

Profile Information

  • Gender
  • Location
    Phoenix

Previous Fields

  • Languages
    Focusing on PHP and JavaScript

Recent Profile Visitors

266,364 profile views
  1. 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.
  2. 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.
  3. 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.
  4. 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?
  5. 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.
  6. 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.
  7. 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.
  8. 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 "127.0.0.1root" 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.
  9. 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?
  10. 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.
  11. 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.
  12. If I search for "php oop crud tutorial" it shows several results, what are you looking for that isn't there?
  13. 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?
  14. What do you mean by "core-php"? Just regular PHP?
  15. 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.