Jump to content

scootstah

Staff Alumni
  • Posts

    3,858
  • Joined

  • Last visited

  • Days Won

    29

Everything posted by scootstah

  1. Did you give your form an ID, like so? <form id="form-name" class="form-inline" style="text-align:center" onClick="fetchfromMysqlDatabase();" >
  2. Since you're already using jQuery, use a jQuery-style event handler and then de-register it after it runs. $(function(){ $('#form-name').on('click', function(){ fetchFromLysqlDatabase(); $(this).off('click'); }); });As per my example, you'll need to give your form an id (I used form-name), or modify the selector.
  3. From the user agent. $_SERVER['HTTP_USER_AGENT']
  4. How many emails do you actually need to send per month? Because 700/min is like 30million per month. What are you doing that requires that much email volume? You're going to run into tons of headaches building this out yourself. You'll most certainly be hitting spam traps with that kind of volume. Personally I don't mess with email myself. I use SMTP or pay someone else. Email sucks. My advice is to find a consultant who has experience with large scale email infrastructure and go from there.
  5. You can spend your money over here. Otherwise, we're not going to "do it for you". You have to put forth some effort on your part.
  6. This is not a PHP problem. PHP simply requests that the system send mail; it has no control after that. The problem is likely with your mail server. I'd recommend you try an SMTP service to send that kind of volume. Setting up the infrastructure for that is not trivial.
  7. http://forums.phpfreaks.com/topic/273121-readme-php-resources-faqs/?do=findComment&comment=1405508 Read this and see if it applies.
  8. Just a tip, read the manual.
  9. A blank white page is generally a fatal error. You'll want to enable error reporting in your php.ini and not at the top of your script. If it is a fatal compilation error you will only see it if errors are enabled in your php.ini.
  10. Yes, I would recommend XAMPP if you don't know how to properly configure the stack independently. Only for development, though. Don't use XAMPP for production.
  11. Here's an example using jQuery: http://jsfiddle.net/9vsoqs5t/ Room for improvement, but that should get you started.
  12. It's "safer" on shared hosting because often times shared hosting stores all PHP sessions in the same place. So if somebody was able to get access to that directory, they could steal everybody's sessions, basically. There are many ways to store sessions, and you don't necessarily have to use databases to circumvent this problem. You could simply change the session save directory to a directory that is part of your hosting. Usually shared hosts have chroot'ed directories that cannot be accessed by anyone except your account user. Storing sessions in a database is an easy fix for when your servers sit behind a load balancer. It can be a pit of a pain to get the default file-based setup working that way. Another way is to use a cache like Redis or Memcached.
  13. Yep, works here: php > var_dump(html_entity_decode(''', ENT_QUOTES) === "'"); bool(true)Would have tested earlier but I had to download php on this laptop.
  14. "Dying" does not mean anything. We cannot problem solve from "it's dying". Is there an error? What is the expected server response? What response are you getting?
  15. You need the ENT_QUOTES flag on, I believe.
  16. http://php.net/manual/en/function.html-entity-decode.php http://php.net/manual/en/function.htmlspecialchars-decode.php
  17. The JSON that you are inputting is not valid JSON, so json_decode() is probably failing. It should be: curl -X POST -H "Content-Type: application/json" -d '{"foo":"bar"}' http://nyctelecomm.com/hooker/
  18. mbstring.dll is not MySQL. It is Multibyte String.
  19. OVH is fairly solid but absolutely zero support, except for hardware/network issues. You're completely on your own. I would recommend Heroku or DigitalOcean for a cheap VPS. If you don't have much experience managing a server then Heroku is perfect.
  20. In terms of actual bandwidth, like the size of the response, you're talking minuscule. Above I was talking more about server resources, like minimizing the number of requests for data and minimizing the impact of the requests for the data. The problem you'll likely run into first is too many requests per second to your server. The three items I listed above will help with that. EDIT: The thing you have to understand with AJAX is that you're basically multiplying your user count. Without AJAX, you'd have one server request per page load. With a modern AJAX-heavy frontend application, you basically have a static HTML page with a whole bunch of AJAX calls to get data from the server. You usually break your page down into small sections and then independently request data for those sections. So where you had one server request per user before, now you have 5-10+ server requests per user. It's easy to get carried away and not think about what is happening in the background. But, that doesn't necessarily apply to you for this specific case, just wanted to throw that out there.
  21. Yeah, that SO post pretty much gives you exactly what you're asking for.
  22. Perhaps they used multiple cursors. If you hold alt and click somewhere you can get multiple cursors. So, for example, they could have held alt and highlighted the variable in multiple places and then replaced them all at once.
  23. $json_file = file_get_contents($feedURL);This is probably failing. You must turn on allow_fopen_url in your PHP.ini to use URL's in file_get_contents(). An alternative is to use CURL, like so: $ch = curl_init('https://www.googleapis.com/youtube/v3/search?part=snippet%20&q={$q}&type=video&key=AIzaSyAtuq6UNWVrGvElJZxXOMGrB7mnh9yczuM'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $json_file = curl_exec($ch); curl_close($ch); $jfo = json_decode($json_file); if (json_last_error() == JSON_ERROR_NONE) { // good to go }
  24. What does "not work" mean?
×
×
  • 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.