Search found 10 matches

by Deelight
Wed Jul 20, 2005 3:07 am
Forum: PHP - Code
Topic: Arithmetic
Replies: 4
Views: 535

Thanks for the great indepth explanation guys, this has been helpfull :)
by Deelight
Tue Jul 19, 2005 10:21 am
Forum: PHP - Code
Topic: Arithmetic
Replies: 4
Views: 535

Arithmetic

Hello people

I have a little issue with PHP cutting off my decimals.

Code: Select all

<?php
$var1 = 5.00;
$var2 = 5.50;
print $var1 + $var2;
?>
This will print 10.5 but I want it to print 10.50
How do I make sure I always have 2 decimals behind the point?

Thanks :)
by Deelight
Tue Jul 05, 2005 4:54 pm
Forum: PHP - Code
Topic: Setting a timeout
Replies: 16
Views: 2971

I will give it a try and let you guys know.
by Deelight
Tue Jul 05, 2005 11:15 am
Forum: PHP - Code
Topic: Setting a timeout
Replies: 16
Views: 2971

np, if you know anything else let me know :)
by Deelight
Tue Jul 05, 2005 11:07 am
Forum: PHP - Code
Topic: Setting a timeout
Replies: 16
Views: 2971

We just talked about that burrito. Note: The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that happens outside the execution of the script such as system calls using system(), the sleep() ...
by Deelight
Tue Jul 05, 2005 10:53 am
Forum: PHP - Code
Topic: Setting a timeout
Replies: 16
Views: 2971

I tried it Lostboy :) but ran into some problems. The sleep() function works in this: <?php //$result = exec("whois -h whois.website.ws thisdoesntexist123noway0.ws", $response, $status); sleep(10); if (!$response) { print "Error while contacting server. Try again."; } else { prin...
by Deelight
Tue Jul 05, 2005 9:11 am
Forum: PHP - Code
Topic: Setting a timeout
Replies: 16
Views: 2971

sleep() delays program execution and I don't see how that helps me terminate an exec() after a given number of seconds. But maybe I am wrong..... can you tell me how this would help me?
by Deelight
Tue Jul 05, 2005 8:45 am
Forum: PHP - Code
Topic: Setting a timeout
Replies: 16
Views: 2971

I read about error handling in the manual and thought I might get it to work with set_time_limit(). But I saw the following: Note: The set_time_limit() function and the configuration directive max_execution_time only affect the execution time of the script itself. Any time spent on activity that hap...
by Deelight
Tue Jul 05, 2005 5:46 am
Forum: PHP - Code
Topic: Setting a timeout
Replies: 16
Views: 2971

Thank you and yes I have :) "Set the number of seconds a script is allowed to run. If this is reached, the script returns a fatal error." The problem with this is that it returns a fatal error, I would like to output a message to the user instead. I don't know how. Another thing I should a...
by Deelight
Mon Jul 04, 2005 6:53 pm
Forum: PHP - Code
Topic: Setting a timeout
Replies: 16
Views: 2971

Setting a timeout

Hello People, I'd like to add timeout functionality to the following code: <?php $domainName = "thisdoesntexist123noway0.ws"; $result = @exec("whois -h whois.website.ws ".$domainName, $response, $status); if (!result) { return "Error trying to contact server. Try again."...