Jump to content

requinix

Administrators
  • Posts

    15,066
  • Joined

  • Last visited

  • Days Won

    414

Everything posted by requinix

  1. 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. 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.
  2. I'm not sure I understand what you're saying. Are you telling us to give you the code to do this?
  3. 1. The server has to be listening on your LAN IP address. 127.0.0.1 will only work for connections from the same computer. 2. Make sure your firewall allows inbound connections to that port. 3. Set up a port forwarding on your router from whatever port to your LAN IP address (and port).
  4. 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.
  5. I just email them to myself. For real. An actual email account. Is there a particular reason you aren't doing that?
  6. Is #RETURN A LIST OF WHICH USERS ARE INDICATED IN THE PAGE_HIT TABLE $stmtvisit = $db->prepare('SELECT * FROM sys_page_hit WHERE memberID = $_SESSION[memberID]'); $stmtvisit->execute; $results = $stmtvisit->fetchAll(PDO::FETCH_ASSOC); echo $results;that code still around? Because there are a couple big problems with it.
  7. Why the heck are you sending emails from within the database server?
  8. Why did you comment out the return false? Don't you want it to return false for all the other cases that it didn't return true?
  9. The hash is invalid. It's probably something wrong in your code.
  10. I can guess, but I'll ask anyways: What's your code now?
  11. So you're seeing that "thank you for your email" message but not receiving the email? Did you change anything after taking the code from the original test script (where you got the email using PHPMailer) and copy/pasting it into the script that handles the contact form? And I assume the values for Username and Password and From are all correct in your real code and you edited those just for posting it here?
  12. onfocus="this.readonly=false;" readonly is a boolean attribute on most s. Unless you want to actually remove the existing readonly attribute. The primary difference is what would happen if the form is reset. this.removeAttribute('readonly')
  13. Alright. Use a DateTime for the chosen date and diff it to starting date. That will give you a DateInterval which can tell you how many days are between the two dates. Since you don't care about the number of cycles between the two dates (k from before) all you have to do is use modulus to get the day number (d). Which needs a bit more of an explanation. Say the diff is 108 days. The most obvious course of action is to +1 (because the starting date is day #1 and not day #0) and %15 to get 4. That's not quite right. Say the diff is 14 days. Smaller number. +1 is 15 and %15 is 0. That's not right: you need to get 15 and not 0. You could say "if result == 0 then result = 15" but there's an easier way: ($diff % 15) + 1What you're actually doing is taking the diff, +1 because of the starting date, then doing a trick where you -1 then %15 then +1. Watch: (14 % 15) + 1 = 15which is the result you wanted. And (108 % 15) + 1 = 4like before. $pattern = 15; $start_date = new DateTime("2015-12-14"); // day 1 // Day 15 = 2015-12-29 $chosen_date = new DateTime("2016-03-30"); $difference = $chosen_date->diff($start_date)->days; $day_number = ($difference % $pattern) + 1; If($day_number == 13 || $day_number == 15) { Echo "possible outcome. Day $day_number."; } Else { Echo "not possible, day $day_number"; }
  14. Okay, so I think I figured out what you want. $start_date is the first date. You may have picked it arbitrarily, I don't know. 14 days later is the end of that cycle (1+14=15), and 15 days later (2015-12-30) is actually day 1 of the next cycle. Now you have a $chosen_date. That's going to be 15 * k + d inclusive days between it and the starting date, where k is the number of complete cycles between them and d would be the day number. As an example, with 2015-12-31 it's 17 = 15 * (1) + (2), meaning 1 complete cycle and the date is day #2 in the cycle. If the chosen date is 2016-03-30, that's 108 days later or day #109 (1+108) of the cycle. 109 = 15 * (7) + 4 and so the date is day #4 of whatever cycle. Right?
  15. Yes, that's the code. Currently it says "if not using HTTPS then redirect to the https:// version of the page". That needs to be modified to say To get that new condition you can use RewriteCond %{REQUEST_URI} !^/index.php?route=ebay/openbay/(which assumes that this site is not located in a subdirectory underneath the domain) added next to the existing RewriteCond.
  16. There is so much more to doing emailing properly, and so many ways it can go wrong. Do yourself a favor and get yourself a copy of PHPMailer. (There are other things but it's the most popular.) There are tons of examples and plenty of documentation on how to use it, and it will take care of everything for you.
  17. As mentioned earlier, mysqli_stmt::get_result() is only available with the mysqlnd driver. If you don't have that method then you are using the old libmysqlclient, which is unfortunate. If you keep with the mysqli extension then you'll have to go the long way to get results, meaning bind_result() and fetch() and all that. Speaking of that, your problem with $user. mysqli_stmt::fetch() only returns true/false/null as to whether there were any more results to fetch. To get actual data you need to bind the result values to variables, just like how you bound input values to variables. Each time you call fetch those variables will be updated with appropriate values.
  18. No, it's a float value. Okay. Like I said: you have a function that returns true if something is inside the range, so it should be a simple matter to make it return true if something is outside the range. Change your comparisons so that the page value is = max.
  19. Using strictly PHP and GD? Well yeah, sure it's possible, but here are all the GD functions available to use and none of them do what you want. Meaning you'd have to do the edge detection* or masking yourself. Bite the bullet and use something like ImageMagick instead. It does come as a PHP extension but more commonly you invoke the command-line program. It's powerful and I'm sure it can at least do the second method, if not both. * GD can do edge detection, where it creates an image showing edges, but it won't work for arbitrary points on an image so you couldn't rely on it.
  20. strtoupper() is a function that already exists. You don't make it yourself. It takes a string as an argument and returns a string. What it returns is uppercased. echo strtoupper(TextFunctions::$string);
  21. If it correctly returns true for values inside the range, and you want it to now return false for values outside the range, I would expect that all you'd have to do is do an else { return false; }. If that's not it then, What table? What data? Where are all those values coming from? How is the function supposed to return both true/false and something like "1,2,3,7,8,9" (which I assume is either a string or an array)? All that your code demonstrates is 1. Get the min and max values from the form. 2. Get data item 11 (whatever that means) as the page number. 3. Return true if the min and max fit those criteria.
  22. So to spell out what Jacques sees, That error message is being shown with some sort of Javascript code. It isn't a browser thing. Now, the most reasonable way that would happen is because your form did an AJAX request, but the response had an error. Specifically, the unexpected It just so happens that the very first character in your PHP code (which generates the AJAX response) is a The best thing to do is to fix the to use the standard, long-form <?php opening instead. If that doesn't do it, use Chrome's Network tab to see exactly what response was being returned during the AJAX; to catch the request you need to open the Network tab, or at least the inspector window, before submitting the form.
  23. Your question does not make sense. Where is 1,2,3,7,8,9 coming from? What does this have to do with the code you posted, which clearly only tries to return true?
  24. myMethod is supposed to be inside the class body, like with getProducer and ShopProduct. Buuut I'm pretty sure that whole class is just supposed to be a visual example. Not actual code you use.
×
×
  • 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.