-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
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?
-
Execute Function but not make the browser wait for a return
requinix replied to sanchez77's topic in PHP Coding Help
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. -
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
-
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.
-
Define "working".
-
Deleting a row and renaming the remaining rows BOGGLE
requinix replied to Stavros's topic in PHP Coding Help
Have you considered a simple UPDATE table SET field = field - 1 WHERE field > value you just deleted -
This topic has been REPLACEd INTO MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=360250.0
-
You didn't escape the quotes in the link HTML.
-
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
-
Should the $settings[0]= line be just $settings=?
-
Warning: explode() expects at least 2 parameters, 0 given Surely I'm not the only one who thought that...
-
Random image according to Time of Day
requinix replied to hey_achm@hotmail.com's topic in PHP Coding Help
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... -
if (item is not "do not replace") { update database with new item }
-
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.
-
Here is a good place to look for answers.
-
How to calculate the entries within the last 40 business days?
requinix replied to TheBrandon's topic in PHP Coding Help
Excluding holidays, 40 business days = 8 whole weeks. It's a rather convenient number. So no special logic required. -
Yeah: what you expect a switch to help with. I don't see why you're thinking about using one.
-
Cookies not being read until second load.
requinix replied to narpassword000's topic in PHP Coding Help
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? -
Creating a Static HTML page from a MySQL Database and Using PHP
requinix replied to thara's topic in Apache HTTP Server
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. -
Creating a Static HTML page from a MySQL Database and Using PHP
requinix replied to thara's topic in Apache HTTP Server
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? -
\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.
-
Then you should probably fix that. What's your code now?
-
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.
-
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;
-
Well, there's </pre> <form action="'activate.php" method="'post'"><