Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. 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.
  2. 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.
  3. 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.
  4. 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);
  5. 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.
  6. 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.
  7. 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?
  8. 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.
  9. It sounds like OP wants to call all three functions. Not just one of them.
  10. I should probably read the rest of the thread, but I could imagine a legitimate use case: a third-party service that acts on behalf of some company but itself stays mostly in the shadows. Salesforce does it. Various payment providers and gateways have something like it (like the one my health insurance company uses). It makes sense for those services to be sending email that looks like it's from the hosted company rather than the service's own domain. With that said, those are the kinds of situations where the hosted company should set up emailing properly - by creating SPF/DKIM records to validate the service's mail servers (as providing email server information would be iffy). It's a concept that's so frequently abused but still possible to use legitimately.
  11. Well-developed, free, open-sourced code that happens to do exactly what you want and precisely how you want to do it? If I put it that way, does it make it clearer as to why you haven't found it yet? HTML 5 has a drag and drop API you would use to get the file uploaded. Storing the file works just like any other file upload. Expiration is a matter of using a cronjob to run a script which finds and deletes old files.
  12. Is this really a PHP question?
  13. I wouldn't think there's anything wrong with it. May be suspicious, to the receiver. Consider putting some kind of notice within the email indicating that it was sent by you on someone's behalf. "Report abuse" kind of thing. If that even makes sense. I assume bigcorporation.com is the domain of the email who you're claiming to send as? This is part of spam filtering, and can easily get your emails filtered out, so if that's going to be a problem then you need to re-think what you're doing and how. Two things you can do to avoid it: 1. Send using the user's actual emailing service, which will require information they don't know and information they might not want to give you. 2. Set up domain verification. DomainKeys (DKIM) and SPF validation are the mechanisms for that, but to do verification the user needs to alter the DNS records for their domain to indicate that your email server is allowed to send emails on their behalf. In other words, you can't really do anything about it. With that said, there is a third option: 3. Don't claim to be sending from their email address. You'll avoid the verification problem because you're not attempting to act on behalf of anyone. Again, this may or may not make sense/be viable for your uses. A little notice at the bottom of the email, "This email was sent on behalf of from . Report abuse, etc." would be a good idea.
  14. But wouldn't that mean the source you scraped from had "\E8" too? That would be odd. If not then there was a problem with your scraper...
  15. This isn't the kind of stuff where you can copy some code you find online and have it up and running in an afternoon. It involves actual learning. And time spent learning. Are you willing to do that?
  16. elseif($targetDate $targetDate will always be before (less than) $runningDate. Maybe you mean to use $time?
  17. "No such file or directory" Obviously it's not talking about the file - that isn't supposed to exist yet. So could it be that the directory does not exist?
  18. $link = mysqli_connect("", "", "", "");Besides not specifying a server host to connect to, the username to connect with, or the password for the user, all of which are BAD THINGS, you aren't specifying the default database. Either that table mentioned in the error message really does not exist, or you need to specify the correct default database when connecting.
  19. All you have in that form is two textboxes. Are you really sure you need a preview for them? Whatever. Use two buttons in the form: one to submit normally, one to go to a preview mode. If the user clicks the preview mode button then you don't process the form like you would have but instead show the form information in some "preview" form or another.
  20. I disagree about the "this is more of a PHP question and not really a SQL question" part. That's more like it. It doesn't matter who executes a query. What matters is who you entrust to maintain data integrity: do you want your application's code to do all the work, or do you want your database to do all the work? Programmers typically prefer the former, DBAs typically prefer the latter. Both have advantages and disadvantages. My preference: do it in code. It's highly visible, easy to change, and with proper modelling needs only be implemented in one place in code.
  21. PHP only executes on one server at a time, so it doesn't matter if there's more than one server running this code. So basically, I'm saying these things like "put the file in one specific location" and "if you stored the location somewhere then look up that location again later" and you're saying those don't work. That's a problem because you don't really have any options besides that. Something has to give.
  22. Umm... So, like, you'll have a file in /thismonth, and then move it into /lastmonth, and then move it into /soontobedeleted? Don't do that. If you want files in a directory according to the month, use a directory name for the month. Like "november-2015" or something. And then don't delete it later. If you really do have to delete it, delete the directories from 2+ months ago. Now, you say that you know where the files went and that you store that location to retrieve it later. What's stopping you from retrieving it now?
  23. So there's S.us, www.S.us, and www.PL.com. Those work. PL.com does not. It's like I said: www.PL.com is using the right certificate which is why it works. However PL.com is using the [www.]S.us certificate. Using Chrome, I get the warning, click the "Advanced" link, and it says Make the PL.com site use the exact same certificate information as the www.PL.com site. Telling us a site because it's having problems, and especially because someone asked for it, is not advertising It's more about posting links in places where they don't belong.
  24. Well, perhaps you could stop putting these files all over your server and pick just one place for them. Path is known at creation time? Good. Path is only known at creation time? Well then the file just got lost because there is literally nothing else that knows the path to the file. So you should probably record that path somewhere during creation so you can retrieve it again later.
  25. "Accessible online" as in "online somewhere that is accessible by me". A shorter way of saying "is this on a website somewhere that I can enter into my browser and visit in an attempt to look at the certificate myself so as to give you a straight answer instead of telling you various things to do".
×
×
  • 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.