Re: [PHP] At last an error message!

2002-10-31 Thread Pekka Saarinen
But with mysql_result you'll get see one CELL only. Maybe you need to use something like $dates = array(); while ($row = mysql_fetch_array( $date_result)) { array_push($dates, $row["date"]); } return $dates; - Pekka Saarinen http://photography-on-the.net - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Reversing the Colour.

2002-10-09 Thread Pekka Saarinen
t;; $color = $hex_r .$hex_g .$hex_b; return $color; } Use it like this: $my_bg_color = hexcolorshifter($my_bg_color,".8"); If you brighten a color, each channel will clip at 255, so in situations where you have light source color you will most likely have hue shifts

[PHP] Bug in PHP 4.22? (getimagesize problem)

2002-10-08 Thread Pekka Saarinen
Hi, I have a very odd problem with PHP 4.22 (no acceleration) and Apache 1.3: Getimagesize fails to see an image from URL randomly (1 out of 8 tries), although the image is definitely there (trust me) and the server is under zero load. I tried also urlExists() from http://www.php.net/manual

RE: [PHP] Re: 4.0.2 => 4.2.3, form vars are empty?

2002-09-28 Thread Pekka Saarinen
a few minutes task to search and replace all sources to convert them to $_GET and $_POST. For commonly used $PHP_SELF I use this: if (isset($_SERVER)) $PHP_SELF = $_SERVER['PHP_SELF']; $scriptname = basename($PHP_SELF); This way users don't have to select from two source ve

Re: [PHP] Mail() function problem

2002-09-10 Thread Pekka Saarinen
g correctly and your server rejects the mail as it cannot verify the sender host. Also, many (well configured) servers do not send when there is no live account for that sender. - Pekka Saarinen http://photography-on-the.net - -- PHP General

Re: [PHP] using print instead of echo

2002-09-07 Thread Pekka Saarinen
rom odd coding styles you might also use eval :) $variable1[0]="one"; $variable2[0]="two"; $variable3[0]="three"; $variable4[0]="four"; $j=1; while($j<5){ eval("print \"\$variable" . $j . "[0]\";"); $j++; } - Pekka Saarinen http://photography-on-the.net - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] ARRAY_PUSH with $key

2002-07-18 Thread Pekka Saarinen
insert time was: " . $diff1 . "s"; $start = getMicrotime(); $array2 = array(); for ($n=0;$n>=1;$n++) { array_push($array2,$n); } $stop = getMicrotime(); $diff2 = $stop - $start; print "array_push time was: " . $diff

Re: [PHP] gd ->1:image resolution 2:font quality

2002-07-12 Thread Pekka Saarinen
y just place one pixel on selected resolution matrix. The talk "Mac is 72" and "PC is 96" has no meaning because screen dpi changes with resolution and monitor image size adjustments. - Pekka Saarinen http://photography-on-the.net

Re: [PHP] Linked drop down selection lists and dynamically generated links

2002-07-07 Thread Pekka Saarinen
At 7/7/2002, you wrote: >Is there any way of doing this so within a single page? > >Can this be done using only PHP or do I need to use Javascripts? >Where would I be able to find examples of code which does this sort of >processing? Hi, I would do it in PHP, because you can never ever rely on J

Re: [PHP] Re: Sort with PHP or SQL?

2002-07-06 Thread Pekka Saarinen
At 7/6/2002, you wrote: >SORT BY and ORDER by I mean LIMIT and ORDER BY of course Time for some more coffee. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Re: Sort with PHP or SQL?

2002-07-06 Thread Pekka Saarinen
g a choice to use PHP for pagination and sorting on "own server RAM/CPU" may by beneficial. I also believe that anything that produces less load to MySQL is good. This is just my experience: I believe in empirical research :) Pekka - Pekka Saarinen http://photography-on-the.net - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] PHP 4.2

2002-06-23 Thread Pekka Saarinen
erver users have no means to set PHP.INI to their liking so changes like that should be done in longer time span to let developers update the software _before_ changes in PHP happen. Pekka http://photography-on-the.net/ - Pekka Saarinen http://photography-on

Re: [PHP] Speed tests? RAM usage displays?

2002-06-21 Thread Pekka Saarinen
At 6/21/2002, you wrote: >PS> What about execution time in ms (with breakpoints)? >PS> And is there way to measure MySQL query speed in ms? > >u can use microtime function > > function getMicrotime() > { > list($usec, $sec) = explode(" ",microtime()); > return ((float)$usec

[PHP] Speed tests? RAM usage displays?

2002-06-20 Thread Pekka Saarinen
Hi, Is there any way to determine script's memory usage? What about execution time in ms (with breakpoints)? And is there way to measure MySQL query speed in ms? Thanks Pekka http://photography-on-the.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www

Re: [PHP] simple array question (Am a Newbie kindly excuse.)

2002-05-10 Thread Pekka Saarinen
>Which gives out the output: >Tesing arrays: >ryan1, >ryan1.2, >ryan2, >ryan2.1.1.1.1.1, >ryan3, >ryan3.2, > >my question/problem is simply this: how do i stop the last comma from >coming? Hi, See http://www.php.net/manual/en/function.implode.php Pekka http://photography-on-the.net/ -- PHP

Re: [PHP] Page Numbers

2002-04-30 Thread Pekka Saarinen
At 4/30/2002, you wrote: >At 4/30/2002, you wrote: >>Any one know how to display, go to page number on a record list page >> >>eg >> >> > >Here's a very simplified demo of dropdown+arrows paging code I did for my >gallery software. >It might not be the most clever code around, but it works, and s

Re: [PHP] Page Numbers

2002-04-30 Thread Pekka Saarinen
At 4/30/2002, you wrote: >Any one know how to display, go to page number on a record list page > >eg > > Here's a very simplified demo of dropdown+arrows paging code I did for my gallery software. It might not be the most clever code around, but it works, and scales well. All you need to edit i

Re: [PHP] simplify if/then statement

2002-04-27 Thread Pekka Saarinen
Hi, Make an array $arr of all the states and loop $state = "AR"; $arr = array(); array_push($arr, "AL", "AR", "AZ"); foreach ($arr as $key => $value) { if ($state == $value){ include("Calc$value.class.inc"); } } Cheers, Pekka http://photography-on-the.net/ At 4/27/2002, you wrote: >H

[PHP] Predefined variables in PHP 4.2 vs. older version

2002-04-25 Thread Pekka Saarinen
n and have $PHP_SELF replaced with $_SERVER['PHP_SELF'] when executed in 4.2 or newer? This way I would avoid putting out separate versions for PHP 4.2 or newer. Thanks, Pekka http://photography-on-the.net/ee/ ----- Pekka Saarinen http://photography-on-the.net -

[PHP] Ways to promote PHP applications?

2002-04-21 Thread Pekka Saarinen
Hi, Do you have any good sites which list (and review) php applications? I already know http://www.hotscripts.com/PHP/Scripts_and_Programs/ and http://php.resourceindex.com (they update the content two moths late!). Thanks, Pekka http://photography-on-the.net/ee/ -- PHP General Mailing Lis

Re: [PHP] how to seek and convert an email address to mailto link

2002-03-20 Thread Pekka Saarinen
At 3/20/2002, you wrote: >$newstr = preg_replace('/\b(\S+@\S+)\b/', >'mailto:\1";>\1', $oldstr); > >Take the time to learn Perl-style regular expressions. You can practically >write Photoshop with them. > >miguel Thanks! It seems to work fine. If I had time I'd try to learn regexp, but first

Re: [PHP] how to seek and convert an email address to mailto link

2002-03-19 Thread Pekka Saarinen
At 3/19/2002, you wrote: >Hi, >I think the following lines could help you : > >$line = "Foobar foobar [EMAIL PROTECTED] foobar foobar"; >list($var1,$var2,$var3,$var4,$var5) = explode(" ",$line); >echo "$var1 $var2 mailto:$var3";>$var3." ".$var4." ".$var5"; >more or less... i am a newbie in this st

[PHP] how to seek and convert an email address to mailto link

2002-03-19 Thread Pekka Saarinen
Hi, I need to search text for @ and replace the mail address around it (i.e. text between previous and following spaces) so that if I have text Foobar foobar [EMAIL PROTECTED] foobar foobar. It'll convert it to Foobar foobar mailto:[EMAIL PROTECTED]";>[EMAIL PROTECTED] foobar foobar. Anyone?

[PHP] Odd parse speed problem in 4.06/Linux/Apache

2002-01-30 Thread Pekka Saarinen
d = microtime(); // PRINT PERFORMANCE NOTE print "TABLE HEADER: "; echo CheckTime($start, $end); --- PS. Is there some other timer code available? Thanks for any insight, Pekka Saarinen -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]