Jump to content

requinix

Administrators
  • Posts

    15,227
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. So in other words you downloaded a lot of data from a website, apparently about its users, and you want to import that into your own database? Care to elaborate on why?
  2. There are a few ways that depend on server configuration, so unless you have full control of your web server you should use the most reliable and most portable technique: Make a command-line script to do what you want. If it needs arguments then they should be passed as command-line arguments (which you can get with $argc and $argv). Then in the original script you call it like `php -f /path/to/script.php -- other arguments you need to pass to it &`; The trailing & is what makes the script run in the background. Other solutions include: - Ending the response so everybody else thinks the script is done. I've had mixed luck getting that to work consistently. - Using process-level control (like popen) to run PHP, like the command does above. Sometimes these functions are disabled, and most commonly on shared hosting servers. - Forking a process, but this almost never works due to extensions and functions being disabled, or the server (eg, Apache) not supporting the kind of operations forking entails.
  3. So hungry... but it's not even 11 yet D: This topic has been moved to mod_rewrite. http://www.phpfreaks.com/forums/index.php?topic=360284.0
  4. Then you need mod_rewrite, not Redirect or RedirectMatch. RewriteEngine on RewriteRule ^example-(\d+)\.html$ /$1.html [L,R] [edit] I'm totally wrong: you can do it with RedirectMatch too. Check the manual page for an example how.
  5. Define "working".
  6. Have you considered a simple UPDATE table SET field = field - 1 WHERE field > value you just deleted
  7. This topic has been REPLACEd INTO MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=360250.0
  8. You didn't escape the quotes in the link HTML.
  9. You can't put port numbers or paths into DNS. Only hostnames and IP addresses. You have three options: a) Have people change the configured location of the Exchange server in their clients b) Make www.sitename.com resolve to the XXX address, or move Exchange to that machine c) Have the www.sitename.com server proxy requests for www.sitename.com:81/exchange/ to the new location. This is a bad choice
  10. Should the $settings[0]= line be just $settings=?
  11. Warning: explode() expects at least 2 parameters, 0 given Surely I'm not the only one who thought that...
  12. In your database or wherever, categorize images according to the criteria you want. Then in the code your query can pull (randomly) from images that are in some specific category. Or you can go a more complex but more flexible route and use date and time ranges for each image then pull (randomly) from whatever is in the range. I also recommend designing the randomization process so that whatever image it picks stays for a while - like an hour or so. Otherwise every page load could pull up a different image and that could be quite distracting for your users. If you're worried about the additional complexity then let me tell you that it would be a very trivial modification. Stop for a lunch break? (At 3am?) A holiday? But the Internet doesn't have lunch breaks or holidays...
  13. if (item is not "do not replace") { update database with new item }
  14. You're saying this "do not replace" code is already written and ready to be used? Then add a Whatever you want it to say into the SELECT - probably as the first option.
  15. Here is a good place to look for answers.
  16. Excluding holidays, 40 business days = 8 whole weeks. It's a rather convenient number. So no special logic required.
  17. Yeah: what you expect a switch to help with. I don't see why you're thinking about using one.
  18. Unless he include()s it, which he does. PHP assumes any file given there has PHP to execute regardless of extension. Using something that inspects headers (like Chrome or Firebug) can you see when the cookie is being set?
  19. As long as all your teachers have unique names then sure. Otherwise you'll have to incorporate something unique into the URL (such as an ID number like in what I posted). "URL rewriting". Search around for those terms, there's plenty of material out there to learn what it is and how to use it. Note that you'll have to write a PHP script which accepts the teacher's name instead of their ID number, like profile/teachers/index.php?teaName=vivek%20obroi Then you can use URL rewriting to convert profile/teachers/vivek%20obroi.html to that.
  20. I don't think you mean what you're saying. I think you mean you want friendly URLs like /teacher/21/Bob. Is that it?
  21. \p is only available in UTF-8 mode, which you specify with the /u flag. And +1 to what Psycho said. That filter_var line is way overcomplicated.
  22. Then you should probably fix that. What's your code now?
  23. If all you want to do is omit file extensions then Options +MultiViews in a .htaccess is enough. There's also a mod_rewrite solution that's more annoying. If you actually want to change the URLs into something different then "URL rewriting" is what you should be searching for.
  24. Side comment: your table is a bit off and your signs are backwards (from what I can tell). Such a table normally looks more like Balance: $300 ID | Message | Amount | New Balance ---+---------+--------+------------ 5 | Paid | -$500 | -$200 4 | Debt | $100 | -$100 3 | Debt | $100 | $0 It starts off with an initial balance and changes for each transaction. But that's irrelevant. For the initial problem, just do the math as you run through the results. $pay_balance -= $pay_amount;
  25. Well, there's </pre> <form action="'activate.php" method="'post'"><
×
×
  • 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.