[PHP] Working with dates

2003-03-17 Thread Brad Harriger
I have two variables, $StartDate and EndDate that contain values read 
from MySQL Date fields.  How can I determine if a value entered by the 
user is between the two dates?  I'm using PHP 4.0.6.

Thanks in advance,

Brad

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] LDAP authentication to NDS

2003-02-17 Thread Brad Harriger
Is there any way to find out what privileges a user has to an NDS object 
throught LDAP?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Alt tags in rollover buttons

2002-10-17 Thread Brad Harriger

Is there any way to create ALT tags in secondary nav bars with rollover 
images?  (NOF 7)

Thanks in advance,

Brad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Setting date fields in mysql queries

2002-10-03 Thread Brad Harriger

I ran the query in PhpMyAdmin.  It work fine.  It still doesn't work 
when I try to run it in another script.

Frank wrote:

 
 Hi,
 
 it's a great tip to install PhpMyAdmin - or phpPgAdmin for PostgresSQL - 
 this will only take you at most half an hour even for a newcomer.
 
 You can then easily test queries, see any error messages and see what 
 result they have on tables.
 
 In this case I'd echo out the query
 
 echo $query = UPDATE countertable SET CurrDate = '$ndate' WHERE ID = $id
 
 and try to cut-and-paste it into the query-field in PhpMyAdmin.
 
 When you say nothing happens you'd probably discover that ID is a 
 number not matching anything _or_ that $nDate and the field are not 
 proper date values ;-)
 
 Hope it helps!
 
 Frank, U5
 
 
 PHP work!
 
 Looking for PHP work over the net? Or would like to try to work in South 
 East Asia's most exiting place, Bangkok?
 Then jump to http://www.u5.com/ and fill out the Developers Form.
 We are urgently looking for new people in October 2002
 
 
 
 
 At 15:16 2/10/2002 -0400, you wrote:
 
 I have the following line in a program I'm working on:

 $query = UPDATE countertable SET CurrDate = '$ndate' WHERE ID = $id

 $ndate is a properly formated date read from a text field on a form on 
 the previous page.  When I run the query using mysql_query, it returns 
 TRUE each time, but the field is not updated.  The only explanation I 
 can think of is that there is something wrong with the date value.  
 I've echoed it to the screen and it looks fine, but the query still 
 doesn't work.  Any suggestions?

 Thanks in advance,

 Brad


 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Setting date fields in mysql queries

2002-10-02 Thread Brad Harriger

I have the following line in a program I'm working on:

$query = UPDATE countertable SET CurrDate = '$ndate' WHERE ID = $id

$ndate is a properly formated date read from a text field on a form on 
the previous page.  When I run the query using mysql_query, it returns 
TRUE each time, but the field is not updated.  The only explanation I 
can think of is that there is something wrong with the date value.  I've 
echoed it to the screen and it looks fine, but the query still doesn't 
work.  Any suggestions?

Thanks in advance,

Brad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Re: Displaying full array contents

2002-09-27 Thread Brad Harriger

OK.  Now I have something I can work with.  Thanks everyone.

Brad

Brad Harriger wrote:

 I'm trying to write a function that will display the full contents of an 
 array.  If one of the keys contains a value that is an array, the full 
 array (all indices) should be shown.
 
 As an example, given the following definitions:
 
 $Arr1[1] = Apple;
 $Arr1[2] = Banana;
 $Arr1[3] = $Arr2[];
 $Arr2[1] = Carrot;
 $Arr2[2] = $Arr3[];
 $Arr3[1] = Orange;
 $Arr3[2] = Peach;
 
 
 the output should be:
 
 Arr1:1:Apple
 Arr1:2:Banana
 Arr1:3:Arr2[]
 Arr1:3:Arr2:1:Carrot
 Arr1:3:Arr2:2:Arr3[]
 Arr1:3:Arr2:2:Arr3:1:Orange
 Arr1:3:Arr2:2:Arr3:2:Peach
 
 The closest I've come is:
 
  while (current($myArr))
   {
 if(is_array(current($myArr)))
 {
   $arrKey = key(current($myArr));
   echo Array ;
   echo nbsp=nbsp;
   $baseArray = key($myArr);
   echo key($myArr);
   echo BR\n;
   walkArray(current($myArr));
 }
 else
 {
   $arrKey = key($myArr);
   if ($baseArray != )
   {
 echo $baseArray;
 echo :;
   }
   echo $arrKey;
   echo nbsp=nbsp;
   echo current($myArr);
   echo BR\n;
 }
 next($myArr);
   }
 
 This code only echoes one dimension of a multi-dimension array.  I can't 
 find a way to reliably store more than that.  Any suggestions?
 
 Thanks in advance,
 
 Brad
 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Displaying full array contents

2002-09-26 Thread Brad Harriger

I'm trying to write a function that will display the full contents of an 
array.  If one of the keys contains a value that is an array, the full 
array (all indices) should be shown.

As an example, given the following definitions:

$Arr1[1] = Apple;
$Arr1[2] = Banana;
$Arr1[3] = $Arr2[];
$Arr2[1] = Carrot;
$Arr2[2] = $Arr3[];
$Arr3[1] = Orange;
$Arr3[2] = Peach;


the output should be:

Arr1:1:Apple
Arr1:2:Banana
Arr1:3:Arr2[]
Arr1:3:Arr2:1:Carrot
Arr1:3:Arr2:2:Arr3[]
Arr1:3:Arr2:2:Arr3:1:Orange
Arr1:3:Arr2:2:Arr3:2:Peach

The closest I've come is:

  while (current($myArr))
   {
 if(is_array(current($myArr)))
 {
   $arrKey = key(current($myArr));
   echo Array ;
   echo nbsp=nbsp;
   $baseArray = key($myArr);
   echo key($myArr);
   echo BR\n;
   walkArray(current($myArr));
 }
 else
 {
   $arrKey = key($myArr);
   if ($baseArray != )
   {
 echo $baseArray;
 echo :;
   }
   echo $arrKey;
   echo nbsp=nbsp;
   echo current($myArr);
   echo BR\n;
 }
 next($myArr);
   }

This code only echoes one dimension of a multi-dimension array.  I can't 
find a way to reliably store more than that.  Any suggestions?

Thanks in advance,

Brad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Displaying full array contents

2002-09-26 Thread Brad Harriger

Debbie,

Yes.  I could use recursion, but what's really hanging me up is keeping 
track of how deep into an array I am.  It should be fairly simple, but I 
seem to be having a brain freeze.

Brad



Debbie_dyer wrote:

 You could use recursion example:-
 
   function printArray($arr) {
 for ($i =0; $i  count($arr); $i++) {
   if (!is_array($arr[$i])) {
 echo $arr[$i];
   }
   else {
 printArray($arr[$i]);
   }
 }
   }
  
 $arr = array(Orange, Peach, Apple);
 $arr2 = array(Banana, $arr, Pear);
 $arr3 = array($arr, $arr2);
 
 printArray($arr3);
 
 Debbie
 
 - Original Message - 
 From: Brad Harriger [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Sent: Thursday, September 26, 2002 6:50 PM
 Subject: [PHP] Displaying full array contents
 
 
 
I'm trying to write a function that will display the full contents of an 
array.  If one of the keys contains a value that is an array, the full 
array (all indices) should be shown.

As an example, given the following definitions:

$Arr1[1] = Apple;
$Arr1[2] = Banana;
$Arr1[3] = $Arr2[];
$Arr2[1] = Carrot;
$Arr2[2] = $Arr3[];
$Arr3[1] = Orange;
$Arr3[2] = Peach;


the output should be:

Arr1:1:Apple
Arr1:2:Banana
Arr1:3:Arr2[]
Arr1:3:Arr2:1:Carrot
Arr1:3:Arr2:2:Arr3[]
Arr1:3:Arr2:2:Arr3:1:Orange
Arr1:3:Arr2:2:Arr3:2:Peach

The closest I've come is:

  while (current($myArr))
   {
 if(is_array(current($myArr)))
 {
   $arrKey = key(current($myArr));
   echo Array ;
   echo nbsp=nbsp;
   $baseArray = key($myArr);
   echo key($myArr);
   echo BR\n;
   walkArray(current($myArr));
 }
 else
 {
   $arrKey = key($myArr);
   if ($baseArray != )
   {
 echo $baseArray;
 echo :;
   }
   echo $arrKey;
   echo nbsp=nbsp;
   echo current($myArr);
   echo BR\n;
 }
 next($myArr);
   }

This code only echoes one dimension of a multi-dimension array.  I can't 
find a way to reliably store more than that.  Any suggestions?

Thanks in advance,

Brad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] LDAP Authentication problem

2002-09-04 Thread Brad Harriger

I'm trying to retrieve information from an NDS server using LDAP 
functions in PHP 4.06.  I am able to establish the connection and bind 
to the server using an anonymous bind, but when I try to bind as a valid 
user, the app seems to run in an infinite loop.  I'm not sure where to 
look for the cause of this problem.  Any suggestions would be appreciated.

Thanks in advance,

Brad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Array question

2002-08-14 Thread Brad Harriger

I have a program containing an array called $thisArray.  At some point 
in the program, the value of next($thisArray) is an array ($subArray). 
How can I echo the name of the of the second array (subArray)?  The name 
of the sub array may change at any time, so I can't just hard code it.

Thanks in advance,

Brad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Debugging LDAP_connect problems

2002-07-17 Thread Brad Harriger

I'm trying to connect to a server using ldap_connect.  The connection is 
failing, but I'm not sure why.  When I try to use ldap_error() to narrow 
down the problem, I get a messaging saying ... 0 is not a LDAP link 
index at   I'm not sure what other options I have.  Any suggestions 
would be apprecieated.

Thanks in advance,

Brad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Detecting network connections

2002-07-15 Thread Brad Harriger

Is there any way I can set up a php script so that it will detect the 
login of the current Netware user on a PC and use that user's 
information to customize a greeting for the user?

Thanks,

Brad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] HTML Checkboxes and PHP variables

2002-05-29 Thread Brad Harriger

Are HTML Checkbox values handled the same way as Select Multiple tags?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Win binary needed

2002-05-23 Thread Brad Harriger

Is there a Windows binary (v. 4.06) available that has ldap support enabled?

Thanks,

Brad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] MySQL Set Type

2002-05-03 Thread Brad Harriger

How does PHP 4 handle MySQL fields that are of type SET?  Are the 
strings, arrays, or something else?

Thanks,

Brad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Program control question

2002-03-25 Thread Brad Harriger

I'm trying to debug a program written by someone else.  There are two 
files that I'm having problems with.  File A uses require_once to call 
file B.  Near the beginning of File B is a Header(Location:) that 
calls  File A.  Can anyone tell me if the part of file B that comes 
after the Header(Location:) is ever read by File A?

Thanks in advance,

Brad


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] If...Else question

2002-03-14 Thread Brad Harriger

Is it legal for an if...else statement to span PHP code blocks? Here's 
an example:

?

$a = 0;
if ($a  5) {
   $b = 50;
   $c=500;

// Take a break from php and put in some HTML

?

HTML
   HEAD/HEAD
   BODYMORE HTML CODE HERE/BODY
/HTML

?

// Now back to the PHP code

   $d = 250;
}
else {
   $e = Does not apply.
}

?

I have some code similar to this example.  When I run the code in my 
browser, I get a parse error on the last line (?).


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Using functions before they're defined

2002-02-07 Thread Brad Harriger

How does PHP 4 locate function definitions if the function is called 
before it is defined?


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php