Search found 32 matches

by poeta_eletrico
Fri Jun 16, 2006 8:23 am
Forum: PHP - Code
Topic: A Real Good Solution: MULTIDIMENSIONAL ARRAY
Replies: 2
Views: 536

Re: A Real Good Solution: MULTIDIMENSIONAL ARRAY

$var = array ( 0 => array ( 0 => array ( 'model 1' => array ( '2006-01' => 31.8, ), ), 1 => array ( 'model 2' => array ( '2006-01' => 31.8, ), ), ), ); Hi Christopher, Well I really dont know what u tried to tell me with that...can u explain? Poeta_Eletrico
by poeta_eletrico
Thu Jun 15, 2006 2:43 pm
Forum: PHP - Code
Topic: A Real Good Solution: MULTIDIMENSIONAL ARRAY
Replies: 2
Views: 536

A Real Good Solution: MULTIDIMENSIONAL ARRAY

Hi, I am struglins to find out the best way to APPEND values INDEXED by KEY in a 3 dimensional array. I have previously the following array: #part 1 of 2 Array ( [0] => Array ( [0] => Array ( [model 1] => 2006-01 => 31.8 ) ) [1] => Array ( [0] => Array ( [model 1] => 2006-02 => 134.56 ) ) [2] => Arr...
by poeta_eletrico
Thu Jun 15, 2006 2:28 pm
Forum: PHP - Code
Topic: Passing variable parameters
Replies: 6
Views: 397

Re: Passing variable parameters

I have my website setup on an external webserver. I also have some pages setup on our AS/400 that are accessible via the web. The idea here is that customers go to my website and create a profile. They enter in various information including their Customer Number (custno). This information is stored...
by poeta_eletrico
Tue Nov 29, 2005 8:38 am
Forum: General Discussion
Topic: How Far With FUNCTION: INCLUDE?
Replies: 8
Views: 805

A page id and the file paths stored in an array is the better practice imo: <?php $pages = array('main', 'register', 'email', 'contact'); $pid = intval($_GET['pid']); if (array_key_exists($pid, $pages)) { include($pages[$pid] . '.inc'); } else { include('default.inc'); } ?> Hi Jenk, I did your code...
by poeta_eletrico
Tue Nov 29, 2005 8:36 am
Forum: General Discussion
Topic: How Far With FUNCTION: INCLUDE?
Replies: 8
Views: 805

Here's how I would code it. Instead of having query strings like ?add_mst=1 ?add_rsl=1 I would use a single name ?page=add_mst ?page=add_rst then in the script $page = $_REQUEST['page']; // check that $page is in an allowed list of pages if (pageallowed($page)) { include("inc/inc_{$page}.php&q...
by poeta_eletrico
Mon Nov 28, 2005 11:57 am
Forum: General Discussion
Topic: How Far With FUNCTION: INCLUDE?
Replies: 8
Views: 805

You should definitely replace it with a switch..case statement rather than a bunch of if..else blocks. Hi ! Sorry for the delay responding your post. Well, I imagine now that SWITCH would be faster than IF statement but I will consider what SHEILA respond as well. I will reorder things here and let...
by poeta_eletrico
Sun Nov 27, 2005 4:21 am
Forum: General Discussion
Topic: How Far With FUNCTION: INCLUDE?
Replies: 8
Views: 805

How Far With FUNCTION: INCLUDE?

Weirdan | Please use and tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color] Hi Guys & Girls ! I am developing a little project for my own and I am using the same page to output every link within my sit...
by poeta_eletrico
Sun Nov 06, 2005 4:44 am
Forum: PHP - Code
Topic: RESULT IN SECONDS - CONVERTING TO DAYS H M S
Replies: 13
Views: 477

This is concise: $t = 648478; // elapsed seconds $s=($d=$t-604800*($weeks = floor($t/604800)))-($h=$d-86400*($days = floor($d/86400)))-($m=$h-3600*($hours = floor($h/3600)))-($seconds=$m-60*($minutes = floor($m/60))); echo "elapsed $t seconds = $weeks weeks, $days days, $hours hours, $minutes ...
by poeta_eletrico
Fri Nov 04, 2005 4:30 am
Forum: PHP - Code
Topic: RESULT IN SECONDS - CONVERTING TO DAYS H M S
Replies: 13
Views: 477

Ok, he is not looking for a DATE, he is looking to convert, for example, 23452340958024958 seconds into 15years, 5months, 3 weeks and 22days (or what ever it actually works out to be) So the date() function is of no use. Hence his mentioning of no timestamp, so stop suggesting he use the date() fun...
by poeta_eletrico
Tue Oct 25, 2005 10:09 pm
Forum: PHP - Code
Topic: RESULT IN SECONDS - CONVERTING TO DAYS H M S
Replies: 13
Views: 477

hawleyjr wrote:Are you asking for a function to convert seconds into the number of hours, minutes & seconds?
Hi,

It s not properly a FUNCTION but the best way and reasonable one...

Poeta_Eletrico
by poeta_eletrico
Tue Oct 25, 2005 10:08 pm
Forum: PHP - Code
Topic: RESULT IN SECONDS - CONVERTING TO DAYS H M S
Replies: 13
Views: 477

foobar wrote:Use PHP's mktime() or date().
Hi,

But the format inserted, was not parsed the way that turns it possible...imagine I giving u something like

Code: Select all

$sec=234232;
Thank u for ur answer.

Poeta_Eletrico
by poeta_eletrico
Tue Oct 25, 2005 2:04 pm
Forum: PHP - Code
Topic: RESULT IN SECONDS - CONVERTING TO DAYS H M S
Replies: 13
Views: 477

hawleyjr wrote:Try using MYSQL's Date and Time functions.

http://dev.mysql.com/doc/refman/5.0/en/ ... tions.html
Hi,

I think that s not possible cos the time I have is in SECONDS not in TIMESTAMP to convert to ... I tried SEC_TO_TIME before but with no success.

Thanks.

Poeta_Eletrico
by poeta_eletrico
Tue Oct 25, 2005 12:14 pm
Forum: PHP - Code
Topic: RESULT IN SECONDS - CONVERTING TO DAYS H M S
Replies: 13
Views: 477

RESULT IN SECONDS - CONVERTING TO DAYS H M S

feyd | Please use and tags where appropriate when posting code. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color] Hi, I know that s not a huge problem tat all and I really can play with but I was imagining another way to convert a query result gi...
by poeta_eletrico
Fri Sep 09, 2005 10:20 am
Forum: PHP - Code
Topic: COUNTDOWN - GIVEN in MIN...
Replies: 4
Views: 522

the only thing you can do server-side is store information on a "best guess" of when to expect the response. (Basically, it's the time alotment you want to use plus some extra time for transmission delays and such.) If the time passes, you kill their session and redirect them or display t...
by poeta_eletrico
Fri Sep 09, 2005 10:15 am
Forum: PHP - Code
Topic: COUNTDOWN - GIVEN in MIN...
Replies: 4
Views: 522

I guess Javascript is the only way. You can try implementing AJAX in this case. But you cannot stop anyone from not counting down to 0 if the user disables JS for this reason. Hi anjanesh, Thanks for your response. But as not a programmer (experienced one) - I think AJAX is a little bit out of my s...