OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 18 Nov 2005 23:00:31 -0000 Issue 3802

php-general-digest-helplists.php.net
Date: Fri Nov 18 2005 - 17:00:31 CST


php-general Digest 18 Nov 2005 23:00:31 -0000 Issue 3802

Topics (messages 226037 through 226085):

Re: Dynamic DB query - form display
        226037 by: David Grant

Re: Is echo tag reasonably portable?
        226038 by: Marcus Bointon

Re: Set Timezone to localtime in php.ini
        226039 by: Marcus Bointon

PHP 4.4.2RC1
        226040 by: Derick Rethans

Re: Does anyone here use the pecl extension APC?
        226041 by: Jochem Maas

another simple array question
        226042 by: cybermalandro cybermalandro
        226043 by: David Grant
        226044 by: Brent Baisley

MySQL C API
        226045 by: Leonard Burton

Cookie problem
        226046 by: Kristen G. Thorson

Sessions with IE Security Settings
        226047 by: James Whitt

Regex help
        226048 by: Chris Boget
        226049 by: Robert Cummings
        226050 by: David Grant

Re: php related segmentation fault with Apache 2.0.55
        226051 by: kristina clair

Real-Time Form Updating
        226052 by: Chase
        226053 by: Jay Blanchard
        226054 by: Brent Baisley
        226056 by: David Grant
        226059 by: Chase
        226061 by: Jay Blanchard
        226066 by: Chase
        226079 by: Michael Crute

add more features on working php?
        226055 by: Bing Du
        226058 by: David Grant
        226067 by: Bing Du
        226068 by: Bing Du
        226069 by: Bing Du

Re: SESSION expiry time setting
        226057 by: Chris Shiflett

testing on a local server
        226060 by: atenn.obviate.us
        226062 by: Jay Blanchard
        226063 by: David Grant
        226064 by: atenn.obviate.us
        226065 by: Jay Blanchard
        226071 by: atenn.obviate.us
        226072 by: Dan McCullough

recursive queries-tree view implementation
        226070 by: blackwater dev
        226078 by: Roman Ivanov
        226080 by: Jared Williams

Testing on the local server
        226073 by: Allison
        226074 by: Jay Blanchard
        226075 by: bruce
        226077 by: Dan McCullough

Problems with PHP5 & phpMyAdmin
        226076 by: Russ F

Re: APC caching keys.
        226081 by: Jared Williams
        226083 by: Jochem Maas

Re: How to build a XML DTD on "the fly"?
        226082 by: Jared Williams
        226084 by: Rob

using ($test)?$true:$false in a string
        226085 by: Dylan

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Hi Adrian,

You can still use the text input, but you must ensure that the input is
filtered first. There is a wealth of information on SQL injection and
its prevention on the Internet. Try these for starters:

http://shiflett.org/articles/security-corner-apr2004
http://dev.mysql.com/tech-resources/articles/guide-to-php-security-ch3.pdf

Cheers,

David Grant

Adrian Bruce wrote:
>
> I'm aware it would be a security hole if it were available to all users,
> but it's just for me at the mo, other users get a watered down version
> with just check boxes. I basically want to allow flexible filtering of
> a set of data but obviously this poses a few challenges, any ideas
> always weclome!
>
> Thanks for the tip by the way, i ended up doing the following
>
> $field = stripslashes(htmlentities($field,ENT_QUOTES));
>
> Adrian
>
> David Grant wrote:
>
>> Hi Adrian,
>>
>> This appears to be a security hole, but since that wasn't the reason for
>> the question, please try:
>>
>> echo"<input type='text' value='" . htmlentities($clause, ENT_QUOTES) .
>> "'>";
>>
>> php.net/htmlentities
>>
>> Cheers,
>>
>> David Grant
>>
>> Adrian Bruce wrote:
>>
>>
>>> Hi
>>>
>>> I am trying Dynamically creating a Query based on form input for an
>>> intranet, i have a text input that allows a user to input part of a
>>> where clause such as - not like '04%' - . this bit works fine but i
>>> would like to display the clause back in the form field when the page
>>> reloads.
>>> $clause = "not like '04%'";
>>> echo"<input type='text' value='$clause'>";
>>>
>>> Now obviously i hit a problem with the use of 'the quotation marks '
>>> ' and just see - not like \ - in the form field. I need to keep the '
>>> marks around the 04% for the query. Any ideas how i can do this??
>>>
>>> Any help much appreciated!
>>>
>>> Adrian
>>>
>>>
>>
>>
>>

attached mail follows:


On 15 Nov 2005, at 19:53, Robin Vickery wrote:

>> I doubt very much if they will be disabled. They are perfectly valid
>> SGML processing instructions.
>
> Firstly, I didn't actually suggest they were disabled. I suggested
> that they should be off by default.

Late to the party I know, but I think something has been missed here.
Here's an excerpt from php.ini-recommended in a fresh download of PHP:

; Allow the <? tag. Otherwise, only <?php and <script> tags are
recognized.
; NOTE: Using short tags should be avoided when developing
applications or
; libraries that are meant for redistribution, or deployment on PHP
; servers which are not under your control, because short tags may not
; be supported on the target server. For portable, redistributable code,
; be sure not to use short tags.
short_open_tag = Off

Given most ISPs habit of leaving everything at defaults, I'd say this
pretty much puts paid to using short tags.

Admittedly it is on in php.ini-dist, but that's not recommended is
it ;^)

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcussynchromedia.co.uk | http://www.synchromedia.co.uk

attached mail follows:


On 16 Nov 2005, at 04:49, The Doctor wrote:

> IS their a way to set the time to localtime instead of GMT in
> the ini file?
>
> Some users are complaining that they are seeing GMT, which this server
> is set to.

If you use PHP 5.1, yes: http://www.php.net/manual/en/ref.datetime.php

Note the new date.timezone ini setting.

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcussynchromedia.co.uk | http://www.synchromedia.co.uk

attached mail follows:


Hello!

I packed PHP 4.4.2RC1 today, which you can find here:
http://downloads.php.net/derick/ . Windows binaries will follow shortly.

Please test it carefully, and report any bugs in the bug system, but
only if you have a short reproducable test case.

If everything goes well, we can release it next tuesday. Especially test
issues with mod_rewrite and Apache 2 please!

regards,
Derick

--
Derick Rethans
http://derickrethans.nl | http://ez.no | http://xdebug.org

attached mail follows:


Rasmus Lerdorf wrote:
> Filing a bug against APC with a gdb backtrace from one of these crashes would be useful.
> See http://pecl.php.net/bugs/report.php?package=APC

hi Rasmus,

I would have but I don't know how - I have just come to realise that php actually has an idiots
guide to doing that (thanks for pointing that out :-):

http://bugs.php.net/bugs-generating-backtrace.php

I'm doing this backtrace thing for the first time - its not all plain sailing ....
having finally generated a core file (and found where apache had out it) I came to
the realisation that gdb was not installed (any had the pleasure of working on
RedHat Enterprise Server ?!?!)

well I downloaded gdb6.3 sources and try to install - make exits with an error.
so I can't install gdb to create the backtrace ...

any ideas? the errors I get when trying to build are below (I have googled to try and find
away past this problem with any success) - if you have any idea as to what I could do to
get gdb built I would be very grateful:

In file included from ./tui/tui-command.c:28:
./tui/tui-data.h:40: error: syntax error before "WINDOW"
./tui/tui-data.h:40: warning: no semicolon at end of struct or union
./tui/tui-data.h:52: error: syntax error before '}' token
./tui/tui-data.h:224: error: field `data_window' has incomplete type
./tui/tui-data.h:278: error: field `generic' has incomplete type
In file included from ./tui/tui-command.c:29:
./tui/tui-win.h:42: error: syntax error before "tui_border_ulcorner"
./tui/tui-win.h:42: warning: type defaults to `int' in declaration of `tui_border_ulcorner'
./tui/tui-win.h:42: warning: data definition has no type or storage class
./tui/tui-win.h:43: error: syntax error before "tui_border_urcorner"
./tui/tui-win.h:43: warning: type defaults to `int' in declaration of `tui_border_urcorner'
./tui/tui-win.h:43: warning: data definition has no type or storage class
./tui/tui-win.h:44: error: syntax error before "tui_border_lrcorner"
./tui/tui-win.h:44: warning: type defaults to `int' in declaration of `tui_border_lrcorner'
./tui/tui-win.h:44: warning: data definition has no type or storage class
./tui/tui-win.h:45: error: syntax error before "tui_border_llcorner"
./tui/tui-win.h:45: warning: type defaults to `int' in declaration of `tui_border_llcorner'
./tui/tui-win.h:45: warning: data definition has no type or storage class
./tui/tui-win.h:46: error: syntax error before "tui_border_vline"
./tui/tui-win.h:46: warning: type defaults to `int' in declaration of `tui_border_vline'
./tui/tui-win.h:46: warning: data definition has no type or storage class
./tui/tui-win.h:47: error: syntax error before "tui_border_hline"
./tui/tui-win.h:47: warning: type defaults to `int' in declaration of `tui_border_hline'
./tui/tui-win.h:47: warning: data definition has no type or storage class
./tui/tui-command.c: In function `tui_dispatch_ctrl_char':
./tui/tui-command.c:51: error: `WINDOW' undeclared (first use in this function)
./tui/tui-command.c:51: error: (Each undeclared identifier is reported only once
./tui/tui-command.c:51: error: for each function it appears in.)
./tui/tui-command.c:51: error: `w' undeclared (first use in this function)
./tui/tui-command.c:81: warning: implicit declaration of function `wgetch'
./tui/tui-command.c:82: error: `ERR' undeclared (first use in this function)
./tui/tui-command.c:89: error: `KEY_PPAGE' undeclared (first use in this function)
./tui/tui-command.c:91: error: `KEY_NPAGE' undeclared (first use in this function)
./tui/tui-command.c:108: error: `KEY_DOWN' undeclared (first use in this function)
./tui/tui-command.c:109: error: `KEY_SF' undeclared (first use in this function)
./tui/tui-command.c:112: error: `KEY_UP' undeclared (first use in this function)
./tui/tui-command.c:113: error: `KEY_SR' undeclared (first use in this function)
./tui/tui-command.c:116: error: `KEY_RIGHT' undeclared (first use in this function)
./tui/tui-command.c:119: error: `KEY_LEFT' undeclared (first use in this function)
gmake[1]: *** [tui-command.o] Error 1
gmake[1]: Leaving directory `/root/build/gdb-6.3/gdb'
gmake: *** [all-gdb] Error 2

----------------------------------------
If you got this far...

another question regarding apc: when I intall it via pecl it asks me
whether I want to use mmap or shmget - I choose mmap bu5t I was wondering what the difference
was and whether shmget is a viable choice (mmap seems to be the recommended choice).

rgds,
Jochem

>
> -Rasmus
>
>
>
>

attached mail follows:


I have an array with indexes 0 to 4 and I want to delete an element of the
array if the index is equals 4. I want to delete the variable key and value.
What is the best way to do so?

foreach ($values as $key => $val){

if ($key == "0") {
//
}
if ($key == "3") {
//
}
if ($key == "4") {
//delete value from array

}
}

Thanks!!!!!

attached mail follows:


if (isset($values[4])
    unset($values[4]);

Cheers,

David Grant

cybermalandro cybermalandro wrote:
> I have an array with indexes 0 to 4 and I want to delete an element of the
> array if the index is equals 4. I want to delete the variable key and value.
> What is the best way to do so?
>
> foreach ($values as $key => $val){
>
> if ($key == "0") {
> //
> }
> if ($key == "3") {
> //
> }
> if ($key == "4") {
> //delete value from array
>
> }
> }
>
> Thanks!!!!!
>

attached mail follows:


You may want to use array_key_exists instead of isset. isset will
return false in the value for the array is NULL. Basically isset will
tell you if there is a value set for the array key, whereas
array_key_exists will tell you if the key exists or not, which is
what you want.

On Nov 18, 2005, at 9:00 AM, David Grant wrote:

> if (isset($values[4])
> unset($values[4]);
>
> Cheers,
>
> David Grant
>
> cybermalandro cybermalandro wrote:
>
>> I have an array with indexes 0 to 4 and I want to delete an
>> element of the
>> array if the index is equals 4. I want to delete the variable key
>> and value.
>> What is the best way to do so?
>>
>> foreach ($values as $key => $val){
>>
>> if ($key == "0") {
>> //
>> }
>> if ($key == "3") {
>> //
>> }
>> if ($key == "4") {
>> //delete value from array
>>
>> }
>> }
>>
>> Thanks!!!!!
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

attached mail follows:


HI All,

Does anyone on here use the MySQL C API? Would you mind if I asked
you a few questions off the list?

Thanks,

--
Leonard Burton, N9URK
leonardburtongmail.com

"The prolonged evacuation would have dramatically affected the
survivability of the occupants."

attached mail follows:


I'm having problems with a customer who can't login to a wholesaler
application. To ensure the problem was that the cookie was not being
set, I sent him to this script:

if( !isset( $_REQUEST['page'] ) ) {
  setcookie('VATtest','Cookie has been set.',time()+50000, "/");
  echo '<a href="'.$_SERVER['PHP_SELF'].'?page=1">Test cookie.</a>';
} else if( $_REQUEST['page'] == '1' ) {
  if( isset( $_COOKIE['VATtest'] ) ) {
    echo $_COOKIE['VATtest'];
  } else {
    echo 'Cookie NOT set.';
  }
}
?>

He got "Cookie NOT set." which means exactly what it says. He's using
IE 6.0, and swears up and down that he's set it to always allow cookies
from this domain. I can't verify that he's set it correctly, but he has
been told twice how to do it. I also know his browser must be saving
some cookies, as he is able to login to other sites. Has anyone run
into other sources of cookie-blockage in the past? I cannot manage to
duplicate this when I have IE set to always allow cookies from this domain.

Thanks for any tips,

kgt

attached mail follows:


I'm currently running into a situation where Internet Explort (IE) is
causing problems with setting the session id in cookies. Of course it works
just fine with Firefox.

Here's the code situation, we're being passed a user from a secondary server
(running windows) to an authentication page that the user has no clue they
are being passed to. The page basically verifies the user and gets their
informatoin with a token passed from the other server. Once verified, it
redirects the user to the index page using headers after a user object has
been created in a session:

/* Create the user object */
$user = new User();
if($user->authenticate($dbh, $userID, $origCompanyID, $companyID)) {
/* Start the session */
session_start();

/* Save the user object */
$_SESSION['User'] = $user;
session_write_close();

/* User has logged in, send them to the main page now */
header("Location:/index.php");
exit();
} else {
/* Token information did not correspond to our information */
header("Location:/loginerror.php");
exit();
}

I've tracked down that the auth is working correctly, the problem comes into
play when the user goes to index.php which checks to make sure the user
object has been set. There is no session information that carried over
because the cookie was not set.

The default IE browser privacy level is set to Medium (which I'm assuming is
default since I hadn't changed it). Under this privacy level, the session
can not be set. This includes:
- Blocks third-party cookies that do not have a compact privacy policy
- Blocks third-party cookies that use personally identifiable information
wihtout your implicit consent
- Restricts first-party cookies that use personally identificable
information without implicit consent

Not if we change the privacy level to Low, it works correctly and the cookie
for the sessions is saved. Under this privacy level, the session can not be
set. This includes:
- Restricts third-party cookies that do not have a compact privacy policy
- Restricts third-party cookies that use personally identifiable information
without your implicit consent

Just curious if anybody know how I can fix this bit of code so that I can
use cookies to store the session id since I prefer not to place it in the
url. I know url is an option though. The server this is running on is
addressed by an IP and not a hostname, so not sure if that might be the
issue for storing the cookie. Also not sure if it's because it's restricting
first-party cookies that use personally identifiable information without
implicit consent.

Any help / information would be appreciated. Please don't respond how this
could be more secure adding this and that security checks because this is
only partial code, didn't add the additional security checks I placed in
here.

attached mail follows:


Why isn't this regular expression

^[A-Za-z0-9\.]+\s*[A-Za-z0-9\.]*$

allowing for this value:

'Co. Dublin' (w/o the single quotes)

? It's failing the regular expression match...

thnx,
Chris

attached mail follows:


On Fri, 2005-11-18 at 10:55, Chris Boget wrote:
> Why isn't this regular expression
>
> ^[A-Za-z0-9\.]+\s*[A-Za-z0-9\.]*$
>
> allowing for this value:
>
> 'Co. Dublin' (w/o the single quotes)
>
> ? It's failing the regular expression match...

Do you have that expression embedded in single or double quotes? Please
show us the actual context.

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


Chris,

if (preg_match("/^[A-Za-z0-9\.]+\s*[A-Za-z0-9\.]*$/", "Co. Dublin"))
    echo "TRUE";
else
    echo "FALSE";

prints "TRUE" for me.

Cheers,

David Grant

Chris Boget wrote:
> Why isn't this regular expression
>
> ^[A-Za-z0-9\.]+\s*[A-Za-z0-9\.]*$
>
> allowing for this value:
>
> 'Co. Dublin' (w/o the single quotes)
>
> ? It's failing the regular expression match...
>
> thnx,
> Chris
>

attached mail follows:


On 11/17/05, Marco Kaiser <marco.kaisergmail.com> wrote:
> Hi Kristina,
>
> try to disable / remove the Zend Extension (ZendExtensionManager etc.
> [ZEND] and all below in your php.ini).
>
> try if php segfault again without the Zend Products loaded.

Hello,

After removing Zend, I get the same error, minus the Zend errors:

#0 0xb7e20c15 in php_handler (r=0xda0cf10)
    at /home/sys/src/php-4.4.1/sapi/apache2handler/sapi_apache2.c:538538
                     if (parent_req && strcmp(parent_req->handler,
PHP_MAGIC_TYPE) && strcmp(parent_req->handler, PHP_SOURCE_MAGIC_TYPE)
&& strcmp(parent_req->handler, PHP_SCRIPT)) {
warning: not using untrusted file ".gdbinit"

(gdb) bt full
#0 0xb7e20c15 in php_handler (r=0xda0cf10)
    at /home/sys/src/php-4.4.1/sapi/apache2handler/sapi_apache2.c:538
        orig_bailout = {{__jmpbuf = {0, 0, 0, 0, 0, 0}, __mask_was_saved = 0,
     __saved_mask = {__val = {0 <repeats 32 times>}}}}
        ctx = (php_struct *) 0xd9f0578
        conf = Variable "conf" is not available.
(gdb)

Thanks,
Kristina

attached mail follows:


I am trying to build an order form for our clients to use to order hardware
and software, or atleast get a price quote for such. The page is done and
working using a FORM POST to a second page taht works on the variables and
generates the totals.

That being siad, I have a field for total number of users that I would like
to calculate the total of about five variables in real-time, before the
submit button is activated. Is this possible?

attached mail follows:


[snip]
That being siad, I have a field for total number of users that I would like
to calculate the total of about five variables in real-time, before the
submit button is activated. Is this possible?
[/snip]

Yes.

Google for JavaScript

attached mail follows:


Absolutely, but you wouldn't really be using PHP to do. Javascript
would be required to handle the real time display update. Javascript
could also to the calculations. If you want to query the server for
prices and have PHP do the calculations and spit back totals, you'll
need to use AJAX.

PHP only receives requests and spits out information. It has no idea
what is requesting the information or how it is being interpreted. If
could be a browser, perl script, or a javascript function. It makes
no difference to PHP. Thus, your question isn't a PHP question.

On Nov 18, 2005, at 11:39 AM, Chase wrote:

> I am trying to build an order form for our clients to use to order
> hardware
> and software, or atleast get a price quote for such. The page is
> done and
> working using a FORM POST to a second page taht works on the
> variables and
> generates the totals.
>
> That being siad, I have a field for total number of users that I
> would like
> to calculate the total of about five variables in real-time, before
> the
> submit button is activated. Is this possible?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>

--
Brent Baisley
Systems Architect
Landover Associates, Inc.
Search & Advisory Services for Advanced Technology Environments
p: 212.759.6400/800.759.0577

attached mail follows:


I might have the wrong end of the stick, but would it not be easier to
calculate these variables in the form handling script?

Cheers,

David Grant

Chase wrote:
> I am trying to build an order form for our clients to use to order hardware
> and software, or atleast get a price quote for such. The page is done and
> working using a FORM POST to a second page taht works on the variables and
> generates the totals.
>
> That being siad, I have a field for total number of users that I would like
> to calculate the total of about five variables in real-time, before the
> submit button is activated. Is this possible?

attached mail follows:


Yikes... I am dreadfully sorry to have offended everyone with my OBVIOUSLY
non-PHP question. I will look to JavaScript for help in this matter.

Please end the spiteful personal emails regarding this topic.

""Chase"" <phpmicfiles.com> wrote in message
news:1C.E0.07637.9D60E734pb1.pair.com...
>I am trying to build an order form for our clients to use to order hardware
>and software, or atleast get a price quote for such. The page is done and
>working using a FORM POST to a second page taht works on the variables and
>generates the totals.
>
> That being siad, I have a field for total number of users that I would
> like to calculate the total of about five variables in real-time, before
> the submit button is activated. Is this possible?

attached mail follows:


[snip]
Yikes... I am dreadfully sorry to have offended everyone with my OBVIOUSLY
non-PHP question. I will look to JavaScript for help in this matter.

Please end the spiteful personal emails regarding this topic.
[/snip]

I saw no spiteful persoanl emails. Did folks flame you off-list?

attached mail follows:


Yikes... I am dreadfully sorry to have offended everyone with my OBVIOUSLY
non-PHP question. I will look to JavaScript for help in this matter.

Please end the spiteful personal emails regarding this topic.

""Chase"" <phpmicfiles.com> wrote in message
news:1C.E0.07637.9D60E734pb1.pair.com...
>I am trying to build an order form for our clients to use to order hardware
>and software, or atleast get a price quote for such. The page is done and
>working using a FORM POST to a second page taht works on the variables and
>generates the totals.
>
> That being siad, I have a field for total number of users that I would
> like to calculate the total of about five variables in real-time, before
> the submit button is activated. Is this possible?

attached mail follows:


On 11/18/05, Chase <phpmicfiles.com> wrote:
> Yikes... I am dreadfully sorry to have offended everyone with my OBVIOUSLY
> non-PHP question. I will look to JavaScript for help in this matter.
>
> Please end the spiteful personal emails regarding this topic.
>
>
> ""Chase"" <phpmicfiles.com> wrote in message
> news:1C.E0.07637.9D60E734pb1.pair.com...
> >I am trying to build an order form for our clients to use to order hardware
> >and software, or atleast get a price quote for such. The page is done and
> >working using a FORM POST to a second page taht works on the variables and
> >generates the totals.
> >
> > That being siad, I have a field for total number of users that I would
> > like to calculate the total of about five variables in real-time, before
> > the submit button is activated. Is this possible?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Must be a tough crowd around here on Friday afternoons.

-Mike

--
________________________________
Michael E. Crute
Software Developer
SoftGroup Development Corporation

Linux takes junk and turns it into something useful.
Windows takes something useful and turns it into junk.

attached mail follows:


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 source and go through configure, make and make install?

Thanks in advance,

Bing

attached mail follows:


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 installed with ldap support
> properly. So what should I check and get ldap support added? Do I have
> to download PHP source and go through configure, make and make install?
>
> Thanks in advance,
>
> Bing
>

attached mail follows:


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 installed with ldap support
>>properly. So what should I check and get ldap support added? Do I have
>>to download PHP source and go through configure, make and make install?
>>
>>Thanks in advance,
>>
>>Bing
>>

Thanks much for the hints. I've just installed php-ldap. Now running
the script from the command like works.

% php test.php

Content-type: text/html
X-Powered-By: PHP/4.3.2

<h3>LDAP query test</h3>Connecting ...
connect result is Resource id #1<br />Binding ...LDAP bind
successful...Searching for (sAMAccountName=user) ...Search result is
Resource id #2<br />Number of entires returned is 0<br />Getting entries
...<p>Data for 0 items returned:<p>Closing connection

But in a web browser, it shows:

LDAP query test
Connecting ...
Fatal error: Call to undefined function: ldap_connect() in
/home/user/public_html/test.php on line 17

hmmm...

Bing

attached mail follows:


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 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 source and go through configure, make and make install?
>>>
>>> Thanks in advance,
>>>
>>> Bing
>>>
>
> Thanks much for the hints. I've just installed php-ldap. Now running
> the script from the command like works.
>
> % php test.php
>
> Content-type: text/html
> X-Powered-By: PHP/4.3.2
>
> <h3>LDAP query test</h3>Connecting ...
> connect result is Resource id #1<br />Binding ...LDAP bind
> successful...Searching for (sAMAccountName=user) ...Search result is
> Resource id #2<br />Number of entires returned is 0<br />Getting entries
> ...<p>Data for 0 items returned:<p>Closing connection
>
> But in a web browser, it shows:
>
> LDAP query test
> Connecting ...
> Fatal error: Call to undefined function: ldap_connect() in
> /home/user/public_html/test.php on line 17
>
> hmmm...
>
> Bing

Forgot to mention, no change about ldap on phpinfo() after php-ldap was
installed. So it still just has '--with-ldap=shared' only.

Bing

attached mail follows:


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
>>>> 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 source and go through configure, make and make install?
>>>>
>>>> Thanks in advance,
>>>>
>>>> Bing
>>>>
>>
>> Thanks much for the hints. I've just installed php-ldap. Now running
>> the script from the command like works.
>>
>> % php test.php
>>
>> Content-type: text/html
>> X-Powered-By: PHP/4.3.2
>>
>> <h3>LDAP query test</h3>Connecting ...
>> connect result is Resource id #1<br />Binding ...LDAP bind
>> successful...Searching for (sAMAccountName=user) ...Search result is
>> Resource id #2<br />Number of entires returned is 0<br />Getting
>> entries ...<p>Data for 0 items returned:<p>Closing connection
>>
>> But in a web browser, it shows:
>>
>> LDAP query test
>> Connecting ...
>> Fatal error: Call to undefined function: ldap_connect() in
>> /home/user/public_html/test.php on line 17
>>
>> hmmm...
>>
>> Bing
>
>
> Forgot to mention, no change about ldap on phpinfo() after php-ldap was
> installed. So it still just has '--with-ldap=shared' only.
>
> Bing

Never mind. Restarting the web server fixed the problem.

Bing

attached mail follows:


Angelo Zanetti wrote:
> I've been searching for where the time is set for a session to
> expire but had little luck.

I think you might be looking for the session.gc_* directives. These
control the session mechanism's garbage collection.

Hope that helps.

Chris

--
Chris Shiflett
Brain Bulb, The PHP Consultancy
http://brainbulb.com/

attached mail follows:


i am new to PHP and web programming/management in general...

Using Dreamweaver I am trying to preview .php files on the local server, but the
page won't show up in a web browser. This is probably a stupid question, but
does that just mean I need to install PHP on my computer?

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

attached mail follows:


[snip]
i am new to PHP and web programming/management in general...

Using Dreamweaver I am trying to preview .php files on the local server, but
the
page won't show up in a web browser. This is probably a stupid question, but
does that just mean I need to install PHP on my computer?
[/snip]

You need to install PHP on your local server.

attached mail follows:


http://www.php.net/manual/en/tutorial.php#tutorial.requirements

atennobviate.us wrote:
> i am new to PHP and web programming/management in general...
>
> Using Dreamweaver I am trying to preview .php files on the local server, but the
> page won't show up in a web browser. This is probably a stupid question, but
> does that just mean I need to install PHP on my computer?
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>

attached mail follows:


i am using a PC with Windows XP, i don't have Apache.
i was looking at the downloads page on php.net - how do i know which one i need?

> i am new to PHP and web programming/management in general...
>
> Using Dreamweaver I am trying to preview .php files on the local
> server, but the
> page won't show up in a web browser. This is probably a stupid
> question, but
> does that just mean I need to install PHP on my computer?

> Sounds like it, yeah. What server? What kind of computer? May just
> be change apache config.

> -dg

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

attached mail follows:


[snip]
i am using a PC with Windows XP, i don't have Apache.
i was looking at the downloads page on php.net - how do i know which one i
need?
[/snip]

Go look at this ....http://www.devside.net/web/server/free/suite

attached mail follows:


i'm not sure if my messages are getting through...but i'm trying to download the
PHP installer - where it asks which type of http server i want to configure,
how do i find out what i have? it would be one of the microsoft servers, but i
have no idea which...

Quoting atennobviate.us:

> i am new to PHP and web programming/management in general...
>
> Using Dreamweaver I am trying to preview .php files on the local server, but
> the
> page won't show up in a web browser. This is probably a stupid question, but
> does that just mean I need to install PHP on my computer?
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.

attached mail follows:


Well Jay was showing you where you could pick up everything you
needed. On Windows XP the IIS server is not installed by default you
have to select it as a component to install, so I'm not sure if you
would have IIS installed either. If you want a simple and quick
solution go to the link that Jay sent and download that installer
you'll get Apache/PHP/MySQL and some other tools for development.

Good luck

On 11/18/05, atennobviate.us <atennobviate.us> wrote:
> i'm not sure if my messages are getting through...but i'm trying to download the
> PHP installer - where it asks which type of http server i want to configure,
> how do i find out what i have? it would be one of the microsoft servers, but i
> have no idea which...
>
>
> Quoting atennobviate.us:
>
> > i am new to PHP and web programming/management in general...
> >
> > Using Dreamweaver I am trying to preview .php files on the local server, but
> > the
> > page won't show up in a web browser. This is probably a stupid question, but
> > does that just mean I need to install PHP on my computer?
> >
> > ----------------------------------------------------------------
> > This message was sent using IMP, the Internet Messaging Program.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
>
>
> ----------------------------------------------------------------
> This message was sent using IMP, the Internet Messaging Program.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


I am sure others have encountered this so I am just looking for ideas.

Say I have an ancestry application where the users can enter parents,
children, etc. The children have children, etc.

table people
      id
      parent_id

what is the best way to pull this from the db minimizing the number of
queries to build a tree view of parents to children?

Thanks!

attached mail follows:


blackwater dev wrote:
> I am sure others have encountered this so I am just looking for ideas.
>
> Say I have an ancestry application where the users can enter parents,
> children, etc. The children have children, etc.
>
> table people
> id
> parent_id
>
> what is the best way to pull this from the db minimizing the number of
> queries to build a tree view of parents to children?

This is complicated. How many people are you planning to have total? How
frequently will this info be updated?

attached mail follows:


  
> Say I have an ancestry application where the users can enter
> parents, children, etc. The children have children, etc.
>
> table people
> id
> parent_id
>
> what is the best way to pull this from the db minimizing the
> number of queries to build a tree view of parents to children?

There is no simple way todo it with that model. (Unless you using Oracle, which has CONNECT BY, or I believe there is patch for
postgres to achieve similar).

If you have a lot more reads of the data, you may want to change to a nested set model, write operations take longer, but retrieving
the tree and rendering into a nested list only takes 1 query.

http://dev.mysql.com/tech-resources/articles/hierarchical-data.html for details.

Jared

attached mail follows:


First of all, I'm completely new to PHP and pretty new to web
programming/management in general, so if you respond, try not to use any
really complex terms or anything that I may not understand!

right now I have an existing PHP site that I downloaded for editing. But I
am having problems viewing/testing .php documents.

This one may be just a more general question not necessarily PHP-related...
The server contains a folder of "includes" that are on every page (e.g. the
header and footer, navigation bar, etc) - and all of these files are in .php
format. I try to view these .php files on the web server just to see what
they look like, and it says "Access Denied", even though I've set the
properties to allow all users to read the files in this folder. How can I
view these?

I use Dreamweaver and I try to test the files on the local host, but the
page doesn't even show up. This maybe a stupid question..but to test on a
local server, would I just need to download PHP?

attached mail follows:


[snip]
I use Dreamweaver and I try to test the files on the local host, but the
page doesn't even show up. This maybe a stupid question..but to test on a
local server, would I just need to download PHP?
[/snip]

Deja Vu?

Did you install the package on your server that I recommended?

attached mail follows:


allison....

not familiar with dreamweaver to know if it can act as a webserver. i
strongly suspect that it's simply an editor, but not an actual server, that
can be used to interpret/display php code.

that said, you'll have to have access to a webserver. IIS is a webserver
from msoft. apache is a webserver from the open source community. there are
other servers as well....

you'll need to decide which, if any, you need/want to setup. you might be
better served by telling the list just what you're trying to accomplish. do
you already have a webserver where your dreamweaver files are being
displayed?

the other suggestions that you've gotten have been from people who've
pointed you to all in one apps. this may/may not be the best solution for
you.

-bruce

-----Original Message-----
From: Allison [mailto:atennx10yahoo.com]
Sent: Friday, November 18, 2005 9:03 AM
To: php-generallists.php.net
Subject: [PHP] Testing on the local server

First of all, I'm completely new to PHP and pretty new to web
programming/management in general, so if you respond, try not to use any
really complex terms or anything that I may not understand!

right now I have an existing PHP site that I downloaded for editing. But I
am having problems viewing/testing .php documents.

This one may be just a more general question not necessarily PHP-related...
The server contains a folder of "includes" that are on every page (e.g. the
header and footer, navigation bar, etc) - and all of these files are in .php
format. I try to view these .php files on the web server just to see what
they look like, and it says "Access Denied", even though I've set the
properties to allow all users to read the files in this folder. How can I
view these?

I use Dreamweaver and I try to test the files on the local host, but the
page doesn't even show up. This maybe a stupid question..but to test on a
local server, would I just need to download PHP?

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

attached mail follows:


Coincidence ????

On 11/18/05, Jay Blanchard <jay.blanchardthermon.com> wrote:
> [snip]
> I use Dreamweaver and I try to test the files on the local host, but the
> page doesn't even show up. This maybe a stupid question..but to test on a
> local server, would I just need to download PHP?
> [/snip]
>
> Deja Vu?
>
> Did you install the package on your server that I recommended?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

attached mail follows:


I've reinstalled Apache2, PHP5, phpMyAdmin and MYSQl several times. I still
get the same error when i try to use phpmyadmin Can not load mysql
extensions. I checked the path it is correct, the extensions exist
in /etc/php5/extensions but they do not have a .so after them. The php.ini
file and config files appear correct from a server setup. I read you need
to put a loadmodule statement in httpd but am not sure when. The script
says not to modify this file, put mods in /etc/sisconfig. But I'm not sure
where as there are no loadmod commands in the scripts. My authorities all
appear correct.

Can anyone poiny me to the right configuration file.

Thank you!
--
Russ

attached mail follows:


> I have started making use of the APC extension to cache
> opcodes, etc now I'm also trying to cache the output of some
> sql queries and I want to use a hash of the query as key to
> store/fetch the value e.g:
>
> apc_fetch(md5($qry))
>
> does anyone know of a good reason (including performance
> reasons) for not using a hash in such a way?

Wouldn't apc_fetch($qry) do much the same thing?

Jared

attached mail follows:


Jared Williams wrote:
>>I have started making use of the APC extension to cache
>>opcodes, etc now I'm also trying to cache the output of some
>>sql queries and I want to use a hash of the query as key to
>>store/fetch the value e.g:
>>
>>apc_fetch(md5($qry))
>>
>>does anyone know of a good reason (including performance
>>reasons) for not using a hash in such a way?
>
>
> Wouldn't apc_fetch($qry) do much the same thing?

generally the md5 sum of $qry is shorter than $qry

>
> Jared
>

attached mail follows:


  
> The code below lacks the part where the folling DTD attribute is
> created: <!ATTLIST document id ID #IMPLIED>
>
> How can I create the above DTD attribute in the code below?
>
> <?php
> // Creates an instance of the DOMImplementation class
> $oDomImp = new DOMImplementation;
>
> // Creates a DOMDocumentType instance
> $oDomDtd = $oDomImp->createDocumentType('document', null, null);
>
> // Creates a DOMDocument instance
> $oDom = $oDomImp->createDocument("", "", $oDomDtd);
>
> // Set other properties
> $oDom->encoding = 'iso-8859-1';
> $oDom->standalone = true;
>
> // Create an empty element
> $oElement = $oDom->createElement('document', 'test');
> $oElement->setAttribute('id', '123'); // Append the element
> $oDom->appendChild($oElement);
>
> // Retrieve and print the document
> echo $oDom->saveXML() . "\n";
>
> echo "TagName: " . $oDom->getElementById('123')->tagName;
> ?>
>
> Now the code produces the following result:
>
> <?xml version="1.0" encoding="iso-8859-1" standalone="yes"?>
> <!DOCTYPE document> <document id="123">test</document>
>
> TagName:
>

There is no real standard for creating DTDs on the fly, and therefore libxml/DOM doesn't have any methods afaik.

The one method DOMElement::setIDAttribute() should work I think, but whilst PHP has the method, doesn’t seem todo anything. :/

Jared

attached mail follows:


Jared Williams wrote:
>
> There is no real standard for creating DTDs on the fly, and therefore libxml/DOM doesn't have any methods afaik.
>
> The one method DOMElement::setIDAttribute() should work I think, but whilst PHP has the method, doesn’t seem todo anything. :/

DocumentType nodes are read-only in DOM thus cannot be built on the fly.
Also notice that not all components, such as ATTLIST, even have a node type.

setIDAttribute - thats on the TODO list. Were some previous libxml
issues to be resolved before that could be implemented (so it will be
added, but require a minimum libxml2 version to work).
Can always use xml:id attributes for that purpose for now though.

Rob

attached mail follows:


Hi

Is it possible to use the ($test)?$true:$false construction in a (double
quoted) string without dropping out of the string and concatenating? I have
many lines like:

$var = "first part of string ".(($a==$b)?$c:$d)." rest of string";

and I feel it would be more elegant to be able to do something like:

$var ="first part of string {(($a==$b)?$c:$d)} rest of string";

Cheers
Dylan