[PHP] call to undefined function which is defined

2007-06-11 Thread Bing Du
Hi, RHEL 4 PHP 4.3.9 Apache 2.0.52 Without knowing much about the web application we use, can anybody tell me what kind of situation could trigger the following 'call to undefined function' error? PHP Fatal error: Call to undefined function: encryptchar code() in /data/www/html/typo3_src/typo3

[PHP] advice on sql injection/XSS prevention

2007-04-05 Thread Bing Du
Hi, I'm not an experienced PHP developer. We're hosting a content management system that allow authorized people to add PHP contents. Their PHP coding levels varies. Some are very security sensitive, but some are not. I want to know if PHP has any ready-to-use funtion to validate form input to

Re: [PHP] retrieve all the groups a user is memberOf from active directory?

2007-01-26 Thread Bing Du
> On Thu, January 25, 2007 3:07 pm, Bing Du wrote: >> Sorry if the top is not closely PHP related. But I need to accomplish >> it >> using PHP. >> >> I can query the attribute 'memberOf' of a user from the active >> directory >> server w

[PHP] retrieve all the groups a user is memberOf from active directory?

2007-01-25 Thread Bing Du
Hi, Sorry if the top is not closely PHP related. But I need to accomplish it using PHP. I can query the attribute 'memberOf' of a user from the active directory server with no problem. The challenge I'm facing now is how to obtain all the groups a user is member of. In many cases, a user can b

[PHP] remove html tags in text?

2006-05-11 Thread Bing Du
Hello everyone, Say, if I have a paragraph like this: == John Smith Dr. Smith is the directory of http://some.center.com";>Some Center . His research interests include Wireless Security == Any functions that can help remove all the HTML tags in it? What about just removing selected tags,

Re: [PHP] how to get the absolute path of an included file?

2006-04-28 Thread Bing Du
27; really means because file2.php is not an actual file on the filesystem. file2.php is a PHP content element in a web application. Anyway, I've figured out. Bing > 2006/4/27, Bing Du <[EMAIL PROTECTED]>: >> >> Hello, >> >> Here are the two scripts. The res

[PHP] how to get the absolute path of an included file?

2006-04-27 Thread Bing Du
Hello, Here are the two scripts. The result is 'var is' rather than 'var is foo'. My suspect is I did not set the file path right in 'include'. So in file2.php, how should I get the actual absolute path it really gets for file1.php? Is it stored in some environment variable or something? I'd

[PHP] how to keep spaces in parameters in URL?

2006-04-24 Thread Bing Du
Hello, == Foo Bar"; ?> == Then the URL showed up at the bottom border of the browser has 'name=foo'. What should I do to have 'name=foo bar' in the URL? I tried htmlspecialchars but did not see any difference. I'd appreciate any help. Bing -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] how should MS Access DATETIME be handled in PHP?

2006-04-20 Thread Bing Du
> I don't know if MS Access will behave the same, but in MySQL you can > have a query like so: > > SELECT *, DATE_FORMAT(end_date, '%d %m %Y') as end_date_formatted FROM > projects; > > And it will retrieve all columns from your projects table, plus the > extra one you've created on the fly, and it

Re: [PHP] how should MS Access DATETIME be handled in PHP?

2006-04-19 Thread Bing Du
> Do the search as Richard suggested. > > MS Access might have a similar function you can use, but you'll need > to do some searching yourself to find the answer. > Sure. I always appreciate various opinions. I've checked with an Access expert. It can be done for Access like Format([DateFieldNam

[PHP] make keys of a associative array DB field names?

2006-04-14 Thread Bing Du
Hi, Would anybody remind me how this should be achieved? This returns all the names of the fields. while( ($f = odbtp_fetch_field( $qry )) ) { echo $f->name . "\n"; } This returns the query results: while( ($rec = odbtp_fetch_array($qry)) ) { foreach ($rec as $var) { ech

Re: [PHP] how should MS Access DATETIME be handled in PHP?

2006-04-14 Thread Bing Du
> While all the data-munging in PHP is very interesting... > > Might I suggest that you just use MySQL's date_format() function to > ask MySQL to give you the data you want in the first place? > > Some purists would claim that the database is not the place to put > presentation logic, of course. >

RE: [PHP] how should MS Access DATETIME be handled in PHP?

2006-04-13 Thread Bing Du
> I expect there's actually several ways, although I'm thinking it's likely > that none of them is blindingly obvious. Personally, I think I'd be > inclined to do it like this: > >$mth = 9; >echo date('F', mktime(12,0,0, $mth)); > Interesting. Thanks a bunch for the tip, Mike. Appreciat

Re: [PHP] how should MS Access DATETIME be handled in PHP?

2006-04-13 Thread Bing Du
> Hi! > > Bing Du wrote: >> Excellent! Yes, it now does give me a clue to see what's actually in >> the >> object. print_r($rec[0]) shows: >> >> stdClass Object ( [year] => 2005 [month] => 8 [day] => 31 [hour] => 0 >> [minute] =&

Re: [PHP] how should MS Access DATETIME be handled in PHP?

2006-04-13 Thread Bing Du
> I hate list. each to his own :-) > > try this (untested): > > list($year,$month,$day,$hour,$minute,$second,$fraction) = > array_values(get_object_vars($rec[0])); > Magic! That works. In this case, I'd like to use list because I can use the vars directly (e.g. $year) rather than $arr['year'].

Re: [PHP] how should MS Access DATETIME be handled in PHP?

2006-04-13 Thread Bing Du
> apparently $rec[0] is a php object - try the following lines to > find out what's inside: > > echo ''; > print_r($rec[0]); > echo ''; > > that will probably give you a clue as to how to extract some > useful info from the object. Excellent! Yes, it now does give me a clue to see what's actually

[PHP] how should MS Access DATETIME be handled in PHP?

2006-04-13 Thread Bing Du
Hello, We have a website which pulls data from its MS Access backend database and publishes the data using Cold Fusion. The Cold Fusion code has '#DateFormat(end_date, "Mmmm d, ")#'. 'end_date' is a table column of type DATETIME in the Access DB. Now, we need to use PHP instead of Cold Fusi

Re: [PHP] help with multidimentional arrays

2006-04-12 Thread Bing Du
> On 4/11/06, Bing Du <[EMAIL PROTECTED]> wrote: >> => foreach ($sponsor_id as $sponsor => $arr) >> echo "$sponsor:"; >> foreach ($arr[$sponsor] as $project) { >> echo "$project"; >>

[PHP] help with multidimentional arrays

2006-04-11 Thread Bing Du
Hello, What I intend to do is put the database query results in a multidimentional array like this. $sponsor_id['sponsor1'] = ('project1 title', 'project2 title', 'project3 title'); $sponsor_id['sponsor2'] = ('project1 title','project7 title'); Here is the code snippet for doing that: == w

Re: [PHP] Re: make global variables accessible to functions?

2006-04-07 Thread Bing Du
Thanks for the response. > That way is secure and has nothing to do with register_globals ;) > Good. That's what I wanted to hear. I know by default some pre-defined global variables can be accessed through $GLOBALS. If I don't want end users to add their own user defined variables in the supe

[PHP] make global variables accessible to functions?

2006-04-07 Thread Bing Du
Hello, We use PHP 4.3.9. 'register_globals = Off' is set in php.ini. I've heard using 'global' could cause security problems. Is using $GLOBALS still not more secure than using the 'global' keyword? How should function foo() obtain the value of $a? === Thanks in advance, Bing -- PHP Ge

[PHP] generate database driven web pages

2006-01-17 Thread Bing Du
Hello everyone, Here is what I want to accomplish. Query the backend database and generate a page listing all the staff members in table format that has name, title, phone and office address. Staff name should be a link. Clicking the link should query the database again and use the informat

[PHP] Re: how to resolve this conflict?

2005-12-01 Thread Bing Du
James Benson wrote: You obviously need to remove the old package or compile your own from source Bing Du wrote: Hello, I've already posted it on the MySQL General Discussion list. Thought I wanted to try this list as well in case somebody knows. 5.0.11-beta-standard is al

[PHP] how to resolve this conflict?

2005-12-01 Thread Bing Du
Hello, I've already posted it on the MySQL General Discussion list. Thought I wanted to try this list as well in case somebody knows. 5.0.11-beta-standard is already running. Now I need to install php-mysql which requires mysql-3.23.58-15.RHEL3.1.i3. Here is what I did and the errors I got:

Re: [PHP] syntax checking?

2005-11-23 Thread Bing Du
Jay Blanchard wrote: [snip] Even with error_reporting set to E_ALL in php.ini, I still get 'Errors parsing file.php' using the php command with the -l option. Anyway to see more than that? [/snip] Here are some command line options http://us2.php.net/features.commandline You could run it i

Re: [PHP] syntax checking?

2005-11-23 Thread Bing Du
Bing Du wrote: Jay Blanchard wrote: [snip] How should PHP syntax be checked before execution? Anything similar to what option -c does in Perl? % perl -c test.pl [/snip] from the command line /usr/local/bin/php -i myScript.php [/snip] Ooops, sorry, should be an ell "l" /usr

Re: [PHP] syntax checking?

2005-11-22 Thread Bing Du
Jay Blanchard wrote: [snip] How should PHP syntax be checked before execution? Anything similar to what option -c does in Perl? % perl -c test.pl [/snip] from the command line /usr/local/bin/php -i myScript.php [/snip] Ooops, sorry, should be an ell "l" /usr/local/bin/php -l myScript.php

[PHP] syntax checking?

2005-11-22 Thread Bing Du
Hi, How should PHP syntax be checked before execution? Anything similar to what option -c does in Perl? % perl -c test.pl Thanks, Bing -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] how to exist within the context?

2005-11-22 Thread Bing Du
Ummm... but I don't see how that is related to my exit problem. Any pointers for me to learn more about it? Thanks much for the help. Bing Jay Blanchard wrote: [snip] [/snip] You have to POST the value back to the form. This is one of the harder concepts to grasp when programming in

Re: [PHP] how to exist within the context?

2005-11-22 Thread Bing Du
Thanks for the help. But I still got: Please enter your name! Continue processing... What I want is if no name is entered, only 'Please enter your name!' should be returned. Bing David Grant wrote: Hi, Try this: It's a hack, but it works. Cheers, David Grant Bing

[PHP] Re: username format when binding to Active Directory?

2005-11-22 Thread Bing Du
Bing Du wrote: Hello, The following script returns 'LDAP bind failed...'. "; $ldaprdn = "[EMAIL PROTECTED]"; $ldappass = "jsmithpass"; $ds=ldap_connect("ad.dept.some.edu"); if ($ds) { echo "Binding ..."; $r=ldap_bind($ds, $ld

[PHP] how to exist within the context?

2005-11-22 Thread Bing Du
Hi, One webpage has its banner, left menu and footer ect that are controled by the template. I want this php script to output the form and processing result within the page structure. Without exit, if the 'yourname' field is empty, the script would output 'Please enter your name!' fine with

[PHP] Re: can bind but cannot search?

2005-11-22 Thread Bing Du
Bing Du wrote: Hello all, The following script returns 'search failed...' after 'LDAP bind successful...'. == "; $r=ldap_bind($ds, $ldaprdn, $ldappass); if ($r) { echo "LDAP bind successful..."; } else { echo "LDAP bind f

[PHP] can bind but cannot search?

2005-11-22 Thread Bing Du
Hello all, The following script returns 'search failed...' after 'LDAP bind successful...'. == "; $r=ldap_bind($ds, $ldaprdn, $ldappass); if ($r) { echo "LDAP bind successful..."; } else { echo "LDAP bind failed..."; exit; } $filter = "(sAMAccountName=jsmi

[PHP] username format when binding to Active Directory?

2005-11-21 Thread Bing Du
Hello, The following script returns 'LDAP bind failed...'. "; $ldaprdn = "[EMAIL PROTECTED]"; $ldappass = "jsmithpass"; $ds=ldap_connect("ad.dept.some.edu"); if ($ds) { echo "Binding ..."; $r=ldap_bind($ds, $ldaprdn, $ldappass); if ($r) { echo "LDAP bind successful..."; }

Re: [PHP] add more features on working php?

2005-11-18 Thread Bing Du
Bing Du wrote: Bing Du wrote: David Grant wrote: Bing, Have you checked for a php-ldap RPM? Cheers, David Grant Bing Du wrote: Hello, PHP has already been installed through RPM. phpinfo() shows '--with-ldap'. That's the only information about ldap. I think there shou

Re: [PHP] add more features on working php?

2005-11-18 Thread Bing Du
Bing Du wrote: David Grant wrote: Bing, Have you checked for a php-ldap RPM? Cheers, David Grant Bing Du wrote: Hello, PHP has already been installed through RPM. phpinfo() shows '--with-ldap'. That's the only information about ldap. I think there should be more than t

Re: [PHP] add more features on working php?

2005-11-18 Thread Bing Du
David Grant wrote: Bing, Have you checked for a php-ldap RPM? Cheers, David Grant Bing Du wrote: Hello, PHP has already been installed through RPM. phpinfo() shows '--with-ldap'. That's the only information about ldap. I think there should be more than that if php were

[PHP] add more features on working php?

2005-11-18 Thread Bing Du
Hello, PHP has already been installed through RPM. phpinfo() shows '--with-ldap'. That's the only information about ldap. I think there should be more than that if php were installed with ldap support properly. So what should I check and get ldap support added? Do I have to download PHP s

[PHP] protect password?

2005-11-04 Thread Bing Du
Hello, Some functions need you to provide username and password, for instance odbc_connect. Even though the username/password just has minimum access privileges to the resource, putting it there in clear text in a script gives me heartburn. How do people handle username/password in such kind

[PHP] why memory limit is still being complained about?

2005-09-21 Thread Bing Du
Hi, I'm installing and configuring Gallery 2.0. One system check is check memory limit. The warning is: Warning: Your PHP is configured to limit the memory to 8Mb (memory_limit parameter in php.ini). You should raise this limit to at least 16MB for proper Gallery operation.

[PHP] access multiple databases

2005-08-16 Thread Bing Du
Hi, I need to access both MySQL and SQL server 2000 in a PHP script on RHEL 3. In phpinfo(), I noticed 'supported databases' shows 'MySQL ODBC PostgreSQL Microsoft SQL Server FrontBase Oracle 8 (oci8)'. And 'Configure Command' has '--with-unixODBC=shared' included. Do I need to install a

Re: [PHP] Location header does not work?

2004-08-05 Thread Bing Du
box of the browser changed to https://computing.eng.iastate.edu/mambo/index.php?option=content&task=view&id=159&Itemid=162 fine. But instead of showing the page that https address should point to, 'You are in HTTPS mode' was displayed as the else clause specified. Bing

Re: [PHP] Location header does not work?

2004-08-04 Thread Bing Du
sk=view&id=159&Itemid=162";); } else { echo 'hello my friend'; } Bing > On Tue, 3 Aug 2004 15:34:27 -0500 (CDT), Bing Du <[EMAIL PROTECTED]> wrote: >> The latest message I got was 'Redirection limit for thi

Re: [PHP] Location header does not work?

2004-08-03 Thread Bing Du
The latest message I got was 'Redirection limit for this URL exceeded. Unable to load the requested page.This may be caused by cookies that are blocked.'. Bing > On Tuesday 03 August 2004 15:41, Bing Du offered up the following tid-bit > of > information : >> I

[PHP] Location header does not work?

2004-08-03 Thread Bing Du
I've been struggling with this redirect thing for a while but still cannot get it work. I'm desperately needing help, please. What I want to do is redirect http://computing.eng.iastate.edu/mambo/index.php?option=content&task=view&id=159&Itemid=162 to https://computing.eng.iastate.edu/mambo/index.

[PHP] mail sent but not received?!

2004-06-25 Thread Bing Du
Hi, I've been pulling my hair out over this problem for a while... -- Since the result of the mail() returned is 1, the message should have been delivered fine. but I did not get anything. Where can I look for more clues of what the problem might be, like possible

[PHP] how does PHP handle kerberos authentication?

2004-05-05 Thread Bing Du
I need to code kerberos authentication in PHP. Like in Perl, it has Authen::Krb5 module. How the similar tasks are done in PHP? I've searched (all site) 'kerberos' on www.php.net but did not find any information that I need. Thanks in advance for any help, Bing -- PHP General Mailing List (h

Re: [PHP] how to verify PHP has been installed with ldap?

2004-04-30 Thread Bing Du
/apache/bin//apachectl restart Where else should I look? Bing > Or... did you restart apache after running your make install? If not, that > might be a good idea... `/path/to/apachectl restart` > > > On Thursday 29 April 2004 04:00 pm, Curt Zirzow wrote: >> * Thus wrote Bing

Re: [PHP] how to verify PHP has been installed with ldap?

2004-04-29 Thread Bing Du
erver, but nothing helped. Do I need to do anything on the apache server? What did I do wrong? Bing > From: "Bing Du" <[EMAIL PROTECTED]> > >> So my question is how to verify PHP has been installed with ldap >> support? > > > > And see if there is a

[PHP] how to verify PHP has been installed with ldap?

2004-04-29 Thread Bing Du
Greetings, I've installed PHP with ldap. But I got this error "Fatal error: Call to undefined function: ldap_connect() in /home/me/public_html/test1.php on line 5". Why ldap_connect() is undefined? This is what I did: == # ./configure --with-apxs=/usr/local/apache/bin/apxs --with-confi