[PHP] ob_start callback preg_replace

2004-06-02 Thread John Kaspar
Can someone help me with preg_replace? I want to convert all numbers either 8 or 9 digits in length, into a link. Such that when it sees: John Doe, 456890123, is a new employee. It converts it to: John Doe, a href='employee.html?id=456890123'456890123/a, is a new employee. function

[PHP] Re: clearing new pages

2004-05-26 Thread John Kaspar
I put this at the top of long pages, $processing = span id='processing' processing, please wait ... /span ; echo $processing; flush(); Then put this at the bottom, $hide = script language='javascript' if (document.layers) { processing.visibility='hide' } else if

[PHP] Re: Perfect Squares

2004-05-25 Thread John Kaspar
Try taking the square root of the variable $sqrt = sqrt($var); then compare the number of decimal places. if (strlen(strstr($sqrt,.)) = strlen(strstr($var,.))) { // perfect } Just guessing of course. On 5/25/2004 5:06 PM, Stephen Craton wrote: I'm in a bit of a pickle. I need to find out

[PHP] multi array wildcard

2004-05-24 Thread John Kaspar
Is there a shortcut way to turn an subelement in a multi-dimensioned array into a regular array. For example, here's my array: // print_r($users) Array ( [1] = Array ( [name] = John [email] = [EMAIL PROTECTED] ) [2] = Array (

[PHP] Re: multi array wildcard

2004-05-24 Thread John Kaspar
[$key] = $sub_array[$return_key]; } } return $ret_array; } On 5/24/2004 4:32 PM, John Kaspar wrote: Something like $users[*]['name'] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: other eyes

2004-05-24 Thread John Kaspar
$search_usename $search_username you're missing an r On 5/24/2004 5:55 PM, Bob Lockie wrote: I can't see it. Maybe other eyes will help. :-) Why does search_username.1 show the data that was posted with the form but search_username.2 is empty? $search_usename =

[PHP] Re: Variables inside a function

2004-03-08 Thread John Kaspar
use the global keyword... http://www.php.net/manual/en/language.variables.scope.php On 3/7/2004 6:17 PM, Nathan Croker wrote: I am relatively new to PHP. But something I can't seem to make work is when I call one of the functions I have made and a variable is set inside that function eg.

[PHP] Re: syntax help

2004-02-13 Thread John Kaspar
If you want to actually want the variables $flyertotal, $emailtotal, and $phonetotal, use the line: ${$array[0].total} = $row[0]; But as you defined $array, that will actually create the variables $Flyertotal, $Emailtotal, and $Phonetotal (note the caps). On 2/13/2004 6:10 AM, Bob pilly

[PHP] update password cookie

2003-09-18 Thread John Kaspar
When my users log in, they enter their username and password, and click a checkbox to remember the login in the future. If the remember checkbox is left unchecked, the cookie expire is set to zero. I also have a page where they can change the password. My question is - how do I update the

Re: [PHP] update password cookie

2003-09-18 Thread John Kaspar
I'm just storing its hash. Then comparing it to the database hash. Is that bad? Is there a good write-up somewhere discussing authentication techniques that you could recommend? Yahoo makes you reenter your password every time you reopen your browser. I'll check other sites though. Thanks

[PHP] Re: Multidimensional arrays

2003-07-18 Thread John Kaspar
$sql = select id, name from customer; $rs = mysql_query($sql) or die(sql=$sql = .mysql_error()); while ($row = mysql_fetch_assoc($rs)) { $custarray[] = $row; } /* $row is an array with the elements 'id' and 'name' $custarray becomes a multi-array indexed starting a 0 e.g.