Jump to content

requinix

Administrators
  • Posts

    15,071
  • Joined

  • Last visited

  • Days Won

    414

Posts posted by requinix

  1. That would mean the value of "n" from the Javascript would be 0 or something that cannot be converted to a number. Right?

     

    So what is the actual value of n during those requests? Or alternatively, what does the AJAX request look like in terms of the form data submitted (which you should be able to get directly from the browser).

  2. Looks like you did a

    print_r(get_object_vars($this))
    Right?

     

    1. The thing you printed is an array, because that's what get_object_vars does. But $this is an object.

    2. "config" is the thing inside it.

    3. It is an object (a Config object).

    4. "config" is (again) the next thing inside it.

    5. It is an array.

    6. "sess_expiration" is one of the values you want.

     

    Objects use -> and arrays use [].

    $this->config->config["sess_expiration"]
  3. One of two things is true:

    1. Your "constants" file is not defining constants. It is defining variables. Variables do not work like constants: variables defined outside a function are not available inside the method.

    2. Your constants file is actually defining constants, meaning with define() or const, but you're trying to use variables instead.

     

    Because as you can see,

    Access denied for user ''@'localhost' (using password: NO)
    you are definitely not passing "root" as the user nor providing the password.

     

    As for why the error message is not in your logs, that's because it's output. Actual output. From the code. It outputted the message.

    print "Error!: " . $e->getMessage() . "
    ";
    Right there.
    • Like 1
  4. If you have stuff written from back when register_globals was acceptable then it's been a very long time and your code probably needs a once-over. Not just for this problem but potentially others.

     

    Otherwise the best thing you can do is fix the code. Really. It might take a while but all you need is stuff like

    $variable = (isset($_GET["variable"]) ? $_GET["variable"] : "reasonable default value");
    or

    if (isset($_GET["variable"])) {
    	$variable = $_GET["variable"];
    } else {
    	// show an error
    }
  5. Ah, hosting support...

     

    Form inputs only work if you give them names. The IDs are just for the client side - mostly Javascript.

    <form method="post" action="#">
    <input type="text" id="date1" name="post1" size="8">
    <br />
    <input type="text" id="date2" name="post2" size="8">
    <br />
    <input type="submit" name="submit">
    </form> 
  6. Two options:

     

    a) Compare using timestamps. If you're only doing this in PHP then sometimes that's easier, and the fact that it's just straight numbers makes it easier to understand.

    $renewaldate = time();
    if ($organisationsize == "Up to $3M" && $membershipyear = '2016' && $renewaldate >= mktime(0, 0, 0, 2, 15, 2016)) {
    b) Compare using date strings. There are three conditions you must satisfy for this to work:

    1. Reading left to right, each number in the string (eg, hour, month) must be a larger unit than the next. So you can do year/month/day (year>month>day) but not year/day/month (year>day

    2. Every component must be a number, and each number must be padded (with zeroes) to the largest length. For example, days can max out at two digits long, therefore every day must be padded to two digits. So no 'D' (day name) or 'j' (unpadded day number).

    3. Both strings must use the same format string. You can't compare YYYY/MM/DD with YYYY-MM-DD.

    In practice that means you'll probably use one of two formats: YYYY-MM-DD ("Y-m-d") or YYYY-MM-DD HH:MM:SS ("Y-m-d H:i:s"), and the exact separator character doesn't matter.

  7. When someone has gone to that much trouble to hide code it is pretty much always a backdoor hacker script.

    Either an exploit, or legitimate code that a seller wants to "protect" from prying eyes.

     

    blmg2009, there's good news and bad news. The bad news is that we can't help you decode something that's under license, which the stuff you posted is. (Normally I would remove licensed code, but what you posted isn't... well, it's harmless to have exposed.) The good news is that you want to understand how it works, not to break it apart. A fine line indeed.

     

    It's a horrible practice and wastes system resources doing a lot of stupid work, but some people think it's what they have to do to protect their code. Maybe they don't know much about licensing, or maybe they think it's truly effective, or what else I don't know. But the basic idea is to be able to give someone some code that works without being readable by a human.

    With PHP that's typically some combination of base64_decode() and gzinflate() that ultimately produces some code which can be eval()ed. Do that over and over again and eventually you get actual code that does actual stuff. It's like layers of an onion, except peeling onions isn't as painful.

    • Like 1
  8. The nginx server needs to be listening on your LAN address too. As in 192.168.1.x.

    And the port for the firewall rule is the one that nginx uses. 8080. Your computer doesn't know anything about what the router is doing.

     

    i just added a rule in firewall for port 80 to be public, but i noticed there is a few other things that operate on port 80 in my firewall....so should i make it unique?

    What do you mean? What things? Make what unique?

     

    If there isn't already a rule set up for nginx then you'd need to make one: make a new firewall exception for a particular program (and find nginx.exe or whatever) so the rule doesn't grant access to everything, then allow access to port 8080 and any remote host.

    • Like 1
  9. There was a problem where all new users were required to have admin approval to validate an account. This has been changed back to something reasonable.

     

    New users from here on: upon registration you should receive an email. Please follow the instructions to approve your account.

    Existing users who are unapproved: click the Resend link in the top-right to get the email. Follow those instructions too. Should work.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.