-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
0xc000007b is generally a problem of mixing 32- and 64-bit applications with DLLs. Are you sure you downloaded the right files and extensions?
-
How to interrupt function execution after X seconds?
requinix replied to helices's topic in PHP Coding Help
Well then, if that's your code: 1. You're missing an opening <?php tag 2. $prog is undefined 3. $fd is undefined 4. $pipes is undefined 5. $ldir is undefined 6. You don't do anything with $proc I'm not asking for a single line of code where you think the problem is. I'm asking for ALL of your code. -
How to interrupt function execution after X seconds?
requinix replied to helices's topic in PHP Coding Help
What's your code? That should not block, or at least not for long. What you do or don't do afterwards may cause problems. It does not require ticks, but depending on what you do in your code the alarm signal may not be handled without using ticks. Again, depends on your code. -
You're using PHP to run a batch file to run an application? Post code.
-
How to interrupt function execution after X seconds?
requinix replied to helices's topic in PHP Coding Help
Ticks aren't deprecated... Either ticks won't help you because you're waiting on an external process to complete, or ticks can help because you have code that's actively running but then you don't need ticks in the first place. Apparently it's the latter. Besides, ticks only work in certain PHP setups. What's your code? -
Rather than use the hammer you know to hammer in a screw, learn to use a screwdriver. Install ntp/ntpd/whatever the name of the package is called on your (presumably Linux) distro. And make sure the system is using the right timezone. That's it.
-
unable to override php's default exception Messages
requinix replied to ajoo's topic in PHP Coding Help
Make sure you're still logging those errors, though! You may not want the error message to appear on your site but you certainly should be aware of any problems. -
Apache needs the slash if you want it to serve whatever DirectoryIndex file (eg, index.php) automatically. If you want to turn the slash off then you have to (a) add it back yourself or (b) do the work of serving the index.php yourself. # do not automatically append slashes to directories DirectorySlash off # do automatically use index.php RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^.*[^/]$ $0/index.php [L]
-
The most appropriative way of using data formats
requinix replied to web_craftsman's topic in PHP Coding Help
Guess not. -
having 6 random numbers output different numbers
requinix replied to cloudll's topic in PHP Coding Help
You can avoid a loop with $my_numbers = array_rand(array_flip(range(1, 100)), 6);or the cleaner $rand_nums = range(1, 100); shuffle($rand_nums); $my_numbers = array_slice($rand_nums, 0, 6);There won't be much of a difference if you're only getting 6 numbers out of 100, but if you tried more like 6/7 or 90/100 then you'd notice a big one. -
Then they didn't get the initial setup correct. What your extension_dir setting and what extensions (as in the actual extension= or zend_extension= lines) are you trying to load?
-
The first error is something you should contact your hosting company about. Unless you went out of your way to configure a PHP extension? The second depends on the code so posting that file (config.php) would help.
-
Done.
-
Trying to generate a random number whilst waiting for a future date
requinix replied to Paulp51d's topic in PHP Coding Help
That's a pretty complicated way of doing a loop until a time has passed. $future = mktime(16, 0, 0, 6, 14, 2015); while (time() < $future) { echo rand(0, 300); }That will generate a lot of numbers because the loop will execute very quickly. So this approach doesn't make sense to me. What are you actually trying to accomplish? -
I assume Round 2 is supposed to have Bob and Olivia? As it so happens, what you're describing wasn't quite covered by grissom or Barand. So that's awesome. Would it be enough to shuffle the list of ropers and the list of healers, pair everyone, and then "rotate" one of the lists? Like it goes M/N/O/P/Q then N/O/P/Q/M then O/P/Q/M/N and so on. The advantage is that it's really, really easy to do, but the disadvantage is that the results aren't random from one round to the next: someone can look at the assignments in one round and tell what the assignments will be in the next round.
-
Moved. Are you sure you want to use a dropdown for after they've made their selection? It's not like they can change it anymore. I suggest you reconsider whether you want to prevent the user from changing their mind, or else use Javascript to change the input entirely - like from a dropdown to a hidden input and plain text. <select name="foo"> <option value="value1">Option 1</option> <option value="value2">Option 2</option> </select> <input type="hidden" name="foo" value="value1"> Option 1
-
Is mypage a directory? If not, Apache won't automatically add slashes to files so you'd have to have something that's adding the slashes.
-
Alright, so before things get out of hand again: Let's say you have ropers - Alice - Bob - Cindy and healers - Martin - Nicky - Olivia Exactly what do you want to happen with them?
-
Selecting Correct Entries From Database
requinix replied to NalaTheFurious's topic in PHP Coding Help
Don't use the id at all. Use a LIMIT, as well as an ORDER BY to do the sorting. SELECT * FROM blog ORDER BY whatever your date column is DESC LIMIT ?, 10The ? is the starting offset but counting from 0: $start = ($page - 1) * 10. Or if you want to keep specifying the start and end as a range, LIMIT ?, ? $offset = $start - 1; $count = $stop - $start + 1;By the way, this process is called "pagination". -
You can't SELECT from a table that you're DELETEing from. Not even in a subquery. Fortunately Psycho's suggestion is better anyways.
-
A million dollor Guru ! Where is he ?
requinix replied to ajoo's topic in PHPFreaks.com Website Feedback
Not there either. But I won't stop anyone who wants to join PHP Freaks had some downtime (a couple downtimes, even) a while back. He was active before but when the site came back up he was gone. -
Why do you need the subnetID at all? You can always look up the appropriate subnet whenever you want, and without having to care about managing a subnetID column. Assuming there aren't overlapping subnets. Store the start and end of the subnet (with an index on the two) to make it easy to JOIN: JOIN subnet ON ipaddresses.ip_addr BETWEEN subnet.start AND subnet.end
-
You're missing the point. If you use arrays you can do everything you just said, except you're not fighting against PHP the whole time.