Re: [PHP] Mail Injection- Which Mail function Parameters CORRECTED

2005-11-18 Thread Curt Zirzow
On Fri, Nov 18, 2005 at 05:06:36PM -0800, Ligaya Turmelle wrote:
 
 $message - yes
 ---
 This usually can go without any special escaping, unless you have
 certain headers (the Boundary: header) or allow an injection into
 the $additional_headers field.  If this is the case a malicious
 user could attach a virus to be sent anonymously.
 
 Shouldn't you also worry about html script tags in the body of an HTML 
 email?  Couldn't a person also use those to send you a nasty present?

This is more of a second hand issue, but still valid nonetheless.
Depending on the client that sees the email and the context the
email was sent in, for example:

It is a rather common thing to send two parts, one just plain text
and another one with markup (usually html), and depending on how
the client reads things and displays it to the user, the outcome
could be lead to problems.

I usually use the Boundary: header as a good example of how one
could take advantage of non-escaped data, but that doesn't protect
someone from sending some well formed message that might perhaps
do some phishing type thing.


 
 
 $additional_headers - yes
 -
 As with $to, $subject you need to make sure \r and/or \n are
 removed or escaped properly.  The most common used header is the
 From header:
   
   From: $fromname $fromemail
 
 As noted in the $message section, if you have dont take care in
 ensuring this paramater isn't done correctly you could potentially
 allow the user to setup their own Boundary: header, which then
 would allow them to freely make what ever attachments they like.
 
 Also this is where the open (well psudo open) relay occurs, if you
 dont filter things properly, you can open up the CC: and BCC:
 headers, allowing the person to anonymously send emails.
 
 why would a person allow a user to input header information on a web 
 form?  That sounds like a HUGE security hole or is there someway I just 
 can't see?

The thing is that they dont realize that it is being allowed. If i
dont protect the variable $fromname from the ability to allow a
\n or \r\n someone could send me that results with:

$_POST['fromname'] == your friend\ [EMAIL PROTECTED]\r\nBCC: [a list of 
peoplel]\r\nNull: \;

Resulting in:

  From: your friend [EMAIL PROTECTED]
  BCC: [a list of people]
  Null:  thefromemail


and if I want to be tricky i'd slip in a coupld Recieved: headers
to throw off people the hint of what route the message took. Or
mabey another Subject: header to by pass the previous rules on
subject so I can get the subject I want. 


Curt.
--
null

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



[PHP] Version question on WAMP setup

2005-11-18 Thread MOREMAN Dave
Hi

I just installed Apache 2.0.55 / PHP 5.0.5 and MySQL5.0.15 on WinXP. All
seems OK, except that when I look at the PHP configuration using
phpinfo() it reports the MySQL version as 4.1.7 . 

Any ideas?

Otherwise all OK! 

Dave


-
Dr. Dave.Moreman
Room 110a, Mellor, 
Faculty of Health and Sciences,
Staffordshire University, ST4 2DE,
United.Kingdom

-
email : [EMAIL PROTECTED]
visit our distance learning website :
http://www.staffs.ac.uk/schools/sciences/distlearn/
tel : 00 44 (1) 782 294776

-
This e-mail and the information it contains may be privileged and/or
confidential.  It is for the intended addressee(s) only, and does not
represent the opinions of Staffordshire University.

- 


The information in this email is confidential and is intended solely for the 
addressee.  Access to this email by anyone else is unauthorised.  



If you are not the intended recipient, any disclosure, copying, distribution or 
any action taken or omitted to be taken in reliance on it, except for the 
purpose of delivery to the addressee, is prohibited and may be unlawful.  
Kindly notify the sender and delete the message and any attachment from your 
computer.

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



Re: [PHP] SESSION expiry time setting

2005-11-18 Thread David Grant
Hi Angelo,

You might want:

session.cookie_lifetime = time in seconds

Obviously this only has an effect if the session.use_cookies directive
is set to 1.

Cheers,

David Grant

Angelo Zanetti wrote:
 Hi guys.
 
 I've been searching for where the time is set for a session to expire
 but had little luck.
 
 in the PHP.ini file I found:
 
 session.cache_expire
 
 which specifies the time in minutes but is this what sets the session to
 timeout once the setting time has been surpassed?
 
 Or am I looking in the totally wrong direction??
 
 thanks in advance.
 
 Angelo
 

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



[PHP] Dynamic DB query - form display

2005-11-18 Thread Adrian Bruce

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%';
echoinput 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

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



Re: [PHP] Version question on WAMP setup

2005-11-18 Thread Richard Davey
Hi,

Thursday, November 17, 2005, 11:55:14 AM, you wrote:

 I just installed Apache 2.0.55 / PHP 5.0.5 and MySQL5.0.15 on WinXP.
 All seems OK, except that when I look at the PHP configuration using
 phpinfo() it reports the MySQL version as 4.1.7 .

I may well be wrong, but isn't the Client API version the version of
the API library that PHP is using to communicate with MySQL, rather
than the version of MySQL you're running (which, to all intents and
purposes, PHP could never know until you actually connect to it -
which phpinfo certainly doesn't).

Cheers,

Rich
-- 
Zend Certified Engineer
PHP Development Services
http://www.corephp.co.uk

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



Re: [PHP] Dynamic DB query - form display

2005-11-18 Thread David Grant
Hi Adrian,

This appears to be a security hole, but since that wasn't the reason for
the question, please try:

echoinput 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%';
 echoinput 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
 

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



Re: [PHP] Dynamic DB query - form display

2005-11-18 Thread Adrian Bruce


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:

echoinput 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%';
echoinput 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

   



 



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



Re: [PHP] Dynamic DB query - form display

2005-11-18 Thread David Grant
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:

 echoinput 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%';
 echoinput 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

   

  


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



Re: [PHP] Is echo tag reasonably portable?

2005-11-18 Thread Marcus Bointon

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
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

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



Re: [PHP] Set Timezone to localtime in php.ini

2005-11-18 Thread Marcus Bointon

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
[EMAIL PROTECTED] | http://www.synchromedia.co.uk

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



[PHP] PHP 4.4.2RC1

2005-11-18 Thread Derick Rethans
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

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



Re: [PHP] Does anyone here use the pecl extension APC?

2005-11-18 Thread Jochem Maas

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






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



[PHP] another simple array question

2005-11-18 Thread cybermalandro cybermalandro
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!


Re: [PHP] another simple array question

2005-11-18 Thread David Grant
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



Re: [PHP] another simple array question

2005-11-18 Thread Brent Baisley
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

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



[PHP] MySQL C API

2005-11-18 Thread Leonard Burton
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
[EMAIL PROTECTED]


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

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



[PHP] Cookie problem

2005-11-18 Thread Kristen G. Thorson
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()+5, /);
 echo 'a href='.$_SERVER['PHP_SELF'].'?page=1Test 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

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



[PHP] Sessions with IE Security Settings

2005-11-18 Thread James Whitt
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.


[PHP] Regex help

2005-11-18 Thread Chris Boget

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

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



Re: [PHP] Regex help

2005-11-18 Thread Robert Cummings
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.  |
`'

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



Re: [PHP] Regex help

2005-11-18 Thread David Grant
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
 

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



Re: [PHP] php related segmentation fault with Apache 2.0.55

2005-11-18 Thread kristina clair
On 11/17/05, Marco Kaiser [EMAIL PROTECTED] 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

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



[PHP] Real-Time Form Updating

2005-11-18 Thread Chase
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



RE: [PHP] Real-Time Form Updating

2005-11-18 Thread Jay Blanchard
[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

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



Re: [PHP] Real-Time Form Updating

2005-11-18 Thread Brent Baisley
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

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



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


Thanks in advance,

Bing

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



Re: [PHP] Real-Time Form Updating

2005-11-18 Thread David Grant
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? 

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



Re: [PHP] SESSION expiry time setting

2005-11-18 Thread Chris Shiflett

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/

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



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

2005-11-18 Thread David Grant
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
 

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



[PHP] Re: Real-Time Form Updating

2005-11-18 Thread Chase
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 [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
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



[PHP] testing on a local server

2005-11-18 Thread atenn
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



RE: [PHP] Re: Real-Time Form Updating

2005-11-18 Thread Jay Blanchard
[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?

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



RE: [PHP] testing on a local server

2005-11-18 Thread Jay Blanchard
[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.

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



Re: [PHP] testing on a local server

2005-11-18 Thread David Grant
http://www.php.net/manual/en/tutorial.php#tutorial.requirements

[EMAIL PROTECTED] 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.
 

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



Re: [PHP] testing on a local server

2005-11-18 Thread atenn
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.

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



RE: [PHP] testing on a local server

2005-11-18 Thread Jay Blanchard
[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

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



[PHP] Re: Real-Time Form Updating

2005-11-18 Thread Chase
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 [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
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



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 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

h3LDAP query test/h3Connecting ...
connect result is Resource id #1br /Binding ...LDAP bind 
successful...Searching for (sAMAccountName=user) ...Search result is 
Resource id #2br /Number of entires returned is 0br /Getting entries 
...pData for 0 items returned:pClosing 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

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



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 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

h3LDAP query test/h3Connecting ...
connect result is Resource id #1br /Binding ...LDAP bind 
successful...Searching for (sAMAccountName=user) ...Search result is 
Resource id #2br /Number of entires returned is 0br /Getting entries 
...pData for 0 items returned:pClosing 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

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



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
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

h3LDAP query test/h3Connecting ...
connect result is Resource id #1br /Binding ...LDAP bind 
successful...Searching for (sAMAccountName=user) ...Search result is 
Resource id #2br /Number of entires returned is 0br /Getting 
entries ...pData for 0 items returned:pClosing 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

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



[PHP] recursive queries-tree view implementation

2005-11-18 Thread blackwater dev
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!

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



Re: [PHP] testing on a local server

2005-11-18 Thread atenn
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 [EMAIL PROTECTED]:

 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



Re: [PHP] testing on a local server

2005-11-18 Thread Dan McCullough
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, [EMAIL PROTECTED] [EMAIL PROTECTED] 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 [EMAIL PROTECTED]:

  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



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



[PHP] Testing on the local server

2005-11-18 Thread Allison
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



RE: [PHP] Testing on the local server

2005-11-18 Thread Jay Blanchard
[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



RE: [PHP] Testing on the local server

2005-11-18 Thread bruce
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:[EMAIL PROTECTED]
Sent: Friday, November 18, 2005 9:03 AM
To: php-general@lists.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

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



[PHP] Problems with PHP5 phpMyAdmin

2005-11-18 Thread Russ F
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

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



Re: [PHP] Testing on the local server

2005-11-18 Thread Dan McCullough
Coincidence 

On 11/18/05, Jay Blanchard [EMAIL PROTECTED] 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



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



[PHP] Re: recursive queries-tree view implementation

2005-11-18 Thread Roman Ivanov

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?


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



Re: [PHP] Re: Real-Time Form Updating

2005-11-18 Thread Michael Crute
On 11/18/05, Chase [EMAIL PROTECTED] 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 [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 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.

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



RE: [PHP] recursive queries-tree view implementation

2005-11-18 Thread Jared Williams
  
 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

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



RE: [PHP] APC caching keys.

2005-11-18 Thread Jared Williams

 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

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



RE: [PHP] How to build a XML DTD on the fly?

2005-11-18 Thread Jared Williams
  
 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=123test/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

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



Re: [PHP] APC caching keys.

2005-11-18 Thread Jochem Maas

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



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



Re: [PHP] How to build a XML DTD on the fly?

2005-11-18 Thread Rob

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

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



[PHP] using ($test)?$true:$false in a string

2005-11-18 Thread Dylan
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

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



Re: [PHP] using ($test)?$true:$false in a string

2005-11-18 Thread Richard Lynch
On Fri, November 18, 2005 2:13 pm, Dylan wrote:
 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;

You could try it faster than I could answer...

If it doesn't work, maybe do:
$z = $a==$b ? $c : $d;
$var = first part of string $z rest of string;

Burying too much login in the middle of your data/string is probably a
Bad Idea (tm) anyway.

-- 
Like Music?
http://l-i-e.com/artists.htm

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



Re: [PHP] using ($test)?$true:$false in a string

2005-11-18 Thread Dylan
Richard Lynch wrote:

 On Fri, November 18, 2005 2:13 pm, Dylan wrote:
 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;
 
 You could try it faster than I could answer...
 
 If it doesn't work, maybe do:
 $z = $a==$b ? $c : $d;
 $var = first part of string $z rest of string;
 
 Burying too much login in the middle of your data/string is probably a
 Bad Idea (tm) anyway.
 

I already discounted that since we're talking about a couple of hundred
instances, each of which would need a different $z.

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



RE: [PHP] How to build a XML DTD on the fly?

2005-11-18 Thread Jared Williams
 
 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.

setAttributeNS('http://www.w3.org/XML/1998/namespace', 'id', 'abc') doesn’t 
work either, getElementById() still fails.

Jared

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



[PHP] problem in create new diretory..

2005-11-18 Thread ganu ullu
Hello all,
I have created a new dir, with php code .. which is like that

function mkDirE($dir,$dirmode=777)
{
if (!empty($dir))
{
if (!file_exists(./microsite/.$dir))
{
preg_match_all('/([^\/]*)\/?/i', $dir,$atmp);
$base=;
foreach ($atmp[0] as $key=$val)
{
$base=$base.$val;
if(!file_exists(./microsite/.$base)){
 if (!mkdir(./microsite/.$base,777))
{
echo Error: Cannot create .$base;
return 2;
}
//echo Inside mk;
touch(./microsite/.$base./index.php);
$source = ./microsite/index.php;
$destination = ./microsite/.$base./index.php;
$copy_file = copy($source,$destination);
}
}
}
else
if (!is_dir($dir))
{
//echo Error: .$dir. exists;
return Error: .$dir. already exists;
}
}
return 0;
}
-
this will create a new folder in my root folder,
Locally every thing is working fine
but when I upload the files then in my live server dir is creating
but with the permission 410 drx--t

can any body help me ... wt is the problem 

thnx...


Re: [PHP] php + cURL issue

2005-11-18 Thread Nate Nielsen
Okay, I've added the verbose output to copare exactly what is happening 
between the two versions - thanks to Curt, the verbose info shows there IS 
something different happening.


To recap, the code is exactly the same, the php version is the same (same 
files even), the php.ini is the same (except drive letters), the curl 
version is exactly the same (libcurl/7.14.0 OpenSSL/0.9.8 zlib/1.2.3).  The 
only difference is that one server is Win2k and the other is Win2003  (and 
of course one is working and other is not).


Now it is very clear that something different is happening on the two 
different servers.  I've created a page to list the phpInfo() data, the code 
that is being run, and the VERBOSE information outputted by cURL.


You can view the information here : http://70.84.198.254/index.html

You can see from looking at the verbose information that something is 
definitely happening differently on the dev/working server.


Again, I'm putting a bounty on this issue.  If you can help me fix this, 6 
months of free hosting on one of my dedicated (you choose US or Germany) 
based server (with your own IP).  If you dont need/want hosting, I'll give 
you some cash.  Up to you.


Any help is greatly GREATLY appreciated!!

Thanks again,

Nate Nielsen
[EMAIL PROTECTED]


- Original Message - 
From: Curt Zirzow [EMAIL PROTECTED]

To: php-general@lists.php.net
Sent: Thursday, November 17, 2005 9:28 PM
Subject: Re: [PHP] php + cURL issue



On Thu, Nov 17, 2005 at 04:00:21PM -0600, Nate Nielsen wrote:
I'm having an issue with cURL.  I have installed it on two different 
boxes, one is working properly, and another isn't.


The script auto login's a user to a site.  One server it works as 
expected and logs the user in, the other it does not.  It appears the 
cookie data that is being saved is different on the two machines from the 
login.




what are the differences in the cookies?

have you tried curl_setopt() with:
 curl_setopt($ch, CURLOPT_VERBOSE);
 curl_setopt($ch, CURLOPT_STDERR, $filehandle); // where to log

have you looked at the output on the login request to ensure that
the content is being returned as expected.

What does the code look like?


Curt.
--

--
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] Variables in Variables?

2005-11-18 Thread Marquez Design
Greetings.

Does anyone know how to do this?

I have,

$var

$var2

In a field called two_vars in a MySQL db.

I am calling the variables inside PHP document.

In that document I am saying:

$var = time
$var2 = clock

!-- I do the query in MySQL here --

echo $two_vars;

But the what prints out is

$var 

$var2 

not time and clock.  I know that is what is in the database, but I want
it to replace the variables when printed in the PHP file.

Does this make sense to anyone? Does anyone know how to do this?

--
Steve

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



[PHP] Re: Variables in Variables?

2005-11-18 Thread Ben

Marquez Design said the following on 11/18/2005 04:54 PM:

Greetings.

Does anyone know how to do this?

I have,

$var

$var2

In a field called two_vars in a MySQL db.

I am calling the variables inside PHP document.

In that document I am saying:

$var = time
$var2 = clock

!-- I do the query in MySQL here --

echo $two_vars;

But the what prints out is

$var 

$var2 


not time and clock.  I know that is what is in the database, but I want
it to replace the variables when printed in the PHP file.

Does this make sense to anyone? Does anyone know how to do this?


If I understand your question properly I'd explode $two_vars with 
whatever seperator you have between them and then you'll need to use 
eval to get your results.  Maybe something like...



$dbVars=explode(',',$two_vars); // Assuming comma seperator
foreach($dbVars AS $key = $value) {
$eval=\$temp=.$value.;;
eval($eval);
echo $temp;
}

- Ben

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



[PHP] Variables in variables?

2005-11-18 Thread Marquez Design
This is a little more specific:

I have a template in the database which looks something like this:

html
title$page_title/title

body

Image: $image p /
img src = \$image\

Main Text: $mtext br /
Text2: $text2 br /
Text3: $text3 br /

/body
html

The variable name is $somecontent

When I call $somecontent in the PHP file, it displays exactly like it is
above. It does not replace the variables.

Is there a reason for this?

Here is my PHP file:



?php

include cnx.php;
include includes/header.php;

//Include the content
$select_data = SELECT * FROM template WHERE tmpl_name = \my_template\;;
$response = mysql_query( $select_data, $cnx );

//now print it out for the user.
if ( $one_line_of_data = mysql_fetch_array( $response ) ) {
extract ( $one_line_of_data );
}

$file = $_POST['file'];
$page_title   = $_POST['page_title'];
$image   = $_POST['image'];
$mtext   = $_POST['mtext'];
$text2   = $_POST['text2'];
$text3   = $_POST['text3'];

if (file_exists($dir . $file)) {
   echo centerp /p class=\NormalBold\Success!p /p /;
} else {
   echo The file $file does not exist;
}

$filename = $file;

//Update the table in MySQL
$update_data = UPDATE cms_pages SET page_title = '$page_title', image =
'$image', mtext = '$mtext', text2 = '$text2', text3 = '$text2' WHERE
filename = '$file';
$response = mysql_query( $update_data, $cnx );
if(mysql_error()) die ('database errorbr'. mysql_error());

//Begining of Template Construction

  $mtext = nl2br($mtext);
  $text2 = nl2br($text2);
  $text3 = nl2br($text3);
  
//include content.php; This works with an external page included, but I
would like it to be in the database for easy changes.

// Is the file writable?
if (is_writable($dir. $filename)) {


   if (!$handle = fopen($dir . $filename, 'w')) {
 echo Cannot open file ($filename);
 exit;
   }

   // Write $somecontent to our opened file.
   if (fwrite($handle, $somecontent) === FALSE) {
   echo Cannot write to file ($filename);
   exit;
   }
  
   echo centerp /p class=\NormalText\$filename has been
updated./pp //center;
  
   fclose($handle);

} else {
   echo The file $filename is not writable;
}

include includes/footer.php;

? 
/html






on 11/18/05 7:14 PM Lists ([EMAIL PROTECTED]) wrote:

 ?
 $var = time;
 $var2 = clock;
 echo $var$var2;
 //outputs timeclock
 
 $two_vars = $var$var2;
 echo $two_vars;
 //outputs timeclock
 ?
 
 Why put two variables in one field?  But if you want to store them,
 do: $var, $var2.  After pulling this back from the database,
 explode into an array at the comma, using list to call them var and
 var2.
 
 On Nov 18, 2005, at 7:54 PM, Marquez Design wrote:
 
 Greetings.
 
 Does anyone know how to do this?
 
 I have,
 
 $var
 
 $var2
 
 In a field called two_vars in a MySQL db.
 
 I am calling the variables inside PHP document.
 
 In that document I am saying:
 
 $var = time
 $var2 = clock
 
 !-- I do the query in MySQL here --
 
 echo $two_vars;
 
 But the what prints out is
 
 $var
 
 $var2
 
 not time and clock.  I know that is what is in the database,
 but I want
 it to replace the variables when printed in the PHP file.
 
 Does this make sense to anyone? Does anyone know how to do this?
 
 --
 Steve
 
 -- 
 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



Re: [PHP] How to build a XML DTD on the fly?

2005-11-18 Thread Rob

Jared Williams wrote:

setAttributeNS('http://www.w3.org/XML/1998/namespace', 'id', 'abc') doesn’t 
work either, getElementById() still fails.


It does work as long as you are using libxml2-2.6.22

Rob

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



Re: [PHP] Re: Variables in Variables?

2005-11-18 Thread Jasper Bryant-Greene

Ben wrote:
If I understand your question properly I'd explode $two_vars with 
whatever seperator you have between them and then you'll need to use 
eval to get your results.  Maybe something like...


$dbVars=explode(',',$two_vars); // Assuming comma seperator
foreach($dbVars AS $key = $value) {
$eval=\$temp=.$value.;;
eval($eval);
echo $temp;
}


WTF do you need eval() for?!

$dbVars = explode( ',', $two_vars );
foreach( $dbVars as $value ) {
echo $value;
}

... does exactly the same thing.

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



Re: [PHP] Re: Variables in Variables?

2005-11-18 Thread Jasper Bryant-Greene

Jasper Bryant-Greene wrote:

Ben wrote:


$dbVars=explode(',',$two_vars); // Assuming comma seperator
foreach($dbVars AS $key = $value) {
$eval=\$temp=.$value.;;
eval($eval);
echo $temp;
}


WTF do you need eval() for?!

$dbVars = explode( ',', $two_vars );
foreach( $dbVars as $value ) {
echo $value;
}


Ah, sorry, I see what I missed now... Still, I'm sure there's a way to 
do this without resorting to eval()...


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



[PHP] Re: [PHP-DB] Drag and Drop with PHP and MySQL

2005-11-18 Thread Joe Harman
Hi Chris,
 I would think that there has to be something out there like a Javascript
that would accomplish that... that would be my first guess anyhow... there
possibly could be something done in flash that would act as a drop area for
the file... let us know what you find
 Joe

 On 11/18/05, Micah Stevens [EMAIL PROTECTED] wrote:


 No. That would be nice though eh?

 What I have done in the past is when a user needs to upload a file, I give
 them a linked button that links to a ftp:// style address. This ftp
 account
 points to a directory that PHP can have access to.

 The user then drags and drops (IE only) the files on this new window,
 which
 uploads the files to this directory.

 Once they're done, they close the window, and hit a second button 'Click
 here
 when finished uploading' which tells php to grab all the files in the
 upload
 directory and put them where they need to go.

 This is far from ideal, causes miserable problems when more than one
 person is
 using the technique at once, and offers a host of security and usability
 issues. Oh, and it's IE only, Firefox can't do this, and I don't think
 opera/safari can either.

 However, it's much better than uploading a ton of files individually using
 a
 form. I only use this for applications where I can be sure that only one
 user
 will use it at once, and they're trusted.

 In a pinch it works though. I don't care so much about drag and drop, I
 was
 just trying to solve the multi-file upload issue. I wish there was a
 better
 way.

 If I'm stupid and there is, I'd love to hear about it.

 -Micah

 On Friday 18 November 2005 5:42 pm, Chris Payne wrote:
  HI there everyone,
 
 
 
  I have a file upload system where you select via requester the file to
  upload, it then uploads it with PHP and stores the info in a MySQL
  database. Is there an interface / programming method I can use which I
 can
  DRAG a file from the desktop into an area in a form just as if I had
 used a
  file requester to select a file? Learning a new programming technique is
  no problem as long as it can be used with PHP and MYSQL.
 
 
 
  Any helps / pointers would be REALLY welcome.
 
 
 
  Chris

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




--
Joe Harman
-
Do not go where the path may lead, go instead where there is no path and
leave a trail. - Ralph Waldo Emerson


Re: [PHP] Re: [PHP-DB] Drag and Drop with PHP and MySQL

2005-11-18 Thread Jasper Bryant-Greene

Joe Harman wrote:

Hi Chris,
 I would think that there has to be something out there like a Javascript
that would accomplish that... that would be my first guess anyhow... there
possibly could be something done in flash that would act as a drop area for
the file... let us know what you find
 Joe


There's no way the browser is going to let JS have access to the user's 
filesystem. I would expect ditto for Flash, although I don't use it.


Jasper




 On 11/18/05, Micah Stevens [EMAIL PROTECTED] wrote:


No. That would be nice though eh?

What I have done in the past is when a user needs to upload a file, I give
them a linked button that links to a ftp:// style address. This ftp
account
points to a directory that PHP can have access to.

The user then drags and drops (IE only) the files on this new window,
which
uploads the files to this directory.

Once they're done, they close the window, and hit a second button 'Click
here
when finished uploading' which tells php to grab all the files in the
upload
directory and put them where they need to go.

This is far from ideal, causes miserable problems when more than one
person is
using the technique at once, and offers a host of security and usability
issues. Oh, and it's IE only, Firefox can't do this, and I don't think
opera/safari can either.

However, it's much better than uploading a ton of files individually using
a
form. I only use this for applications where I can be sure that only one
user
will use it at once, and they're trusted.

In a pinch it works though. I don't care so much about drag and drop, I
was
just trying to solve the multi-file upload issue. I wish there was a
better
way.

If I'm stupid and there is, I'd love to hear about it.

-Micah

On Friday 18 November 2005 5:42 pm, Chris Payne wrote:

HI there everyone,



I have a file upload system where you select via requester the file to
upload, it then uploads it with PHP and stores the info in a MySQL
database. Is there an interface / programming method I can use which I

can

DRAG a file from the desktop into an area in a form just as if I had

used a

file requester to select a file? Learning a new programming technique is
no problem as long as it can be used with PHP and MYSQL.



Any helps / pointers would be REALLY welcome.



Chris

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





--
Joe Harman
-
Do not go where the path may lead, go instead where there is no path and
leave a trail. - Ralph Waldo Emerson



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



Re: [PHP] Re: [PHP-DB] Drag and Drop with PHP and MySQL

2005-11-18 Thread Nate Nielsen
You wont be able to do the drag and drop, but you can gracefully do multiple 
file uploads with flash (via flash 8).   It also lets you know the progress 
of the file upload itself.


I've done a snazzy picture upload tool for a Flex (generates flash 
applications on the fly with ActionScript and XML files only - no actual 
flash IDE) - it allows you to select a file, hit upload, shows a progress 
bar of the transfer (you can cancel at any time) - and when done, the image 
is made into a thumbnail and shown on the screen.  -obviously, no page 
reloads and totally cross compatible.


I wouldnt know where to start with regular flash as I'm a programmer, so 
only Flex appeals to me - but I know it can be done, and isnt extremely 
complicated.  My guess is that you could have a flash guru whip something 
out pretty fast.


=)

-Nate Nielsen
[EMAIL PROTECTED]

- Original Message - 
From: Jasper Bryant-Greene [EMAIL PROTECTED]

To: Joe Harman [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Friday, November 18, 2005 8:52 PM
Subject: Re: [PHP] Re: [PHP-DB] Drag and Drop with PHP and MySQL



Joe Harman wrote:

Hi Chris,
 I would think that there has to be something out there like a Javascript
that would accomplish that... that would be my first guess anyhow... 
there
possibly could be something done in flash that would act as a drop area 
for

the file... let us know what you find
 Joe


There's no way the browser is going to let JS have access to the user's 
filesystem. I would expect ditto for Flash, although I don't use it.


Jasper




 On 11/18/05, Micah Stevens [EMAIL PROTECTED] wrote:


No. That would be nice though eh?

What I have done in the past is when a user needs to upload a file, I 
give

them a linked button that links to a ftp:// style address. This ftp
account
points to a directory that PHP can have access to.

The user then drags and drops (IE only) the files on this new window,
which
uploads the files to this directory.

Once they're done, they close the window, and hit a second button 'Click
here
when finished uploading' which tells php to grab all the files in the
upload
directory and put them where they need to go.

This is far from ideal, causes miserable problems when more than one
person is
using the technique at once, and offers a host of security and usability
issues. Oh, and it's IE only, Firefox can't do this, and I don't think
opera/safari can either.

However, it's much better than uploading a ton of files individually 
using

a
form. I only use this for applications where I can be sure that only one
user
will use it at once, and they're trusted.

In a pinch it works though. I don't care so much about drag and drop, I
was
just trying to solve the multi-file upload issue. I wish there was a
better
way.

If I'm stupid and there is, I'd love to hear about it.

-Micah

On Friday 18 November 2005 5:42 pm, Chris Payne wrote:

HI there everyone,



I have a file upload system where you select via requester the file to
upload, it then uploads it with PHP and stores the info in a MySQL
database. Is there an interface / programming method I can use which I

can

DRAG a file from the desktop into an area in a form just as if I had

used a
file requester to select a file? Learning a new programming technique 
is

no problem as long as it can be used with PHP and MYSQL.



Any helps / pointers would be REALLY welcome.



Chris

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





--
Joe Harman
-
Do not go where the path may lead, go instead where there is no path and
leave a trail. - Ralph Waldo Emerson



--
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



Re: [PHP] APC caching keys.

2005-11-18 Thread Curt Zirzow
On Wed, Nov 16, 2005 at 04:32:29PM +0100, Jochem Maas 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))

If you are using mysql i would use the SQL_CACHE flag, it will
eliminate the need for you to manage the cache.

 
 PS - apc is very nice! I just haven't been able to get it to work on 5.1 
 (last tried
 on 5.1RC5dev) - has anybody else had luck getting apc to work with 5.1? did 
 you have
 to do anything special?

The last version of php5.1 i have installed APC on is a cvs
snapshot of around Feb 4 2005 11:49:05. Nothing special was needed.


Curt.
-- 

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



Re: [PHP] Re: [PHP-DB] Drag and Drop with PHP and MySQL

2005-11-18 Thread Joe Harman
Here is what you are asking for I think.. it uses Java. I did have a
complication letting the applet install.. also, it's not free, but there is
a Lite version. Hope this helps
 http://www.radinks.com/upload/dnd.php
 Joe

 On 11/18/05, Nate Nielsen [EMAIL PROTECTED] wrote:

 You wont be able to do the drag and drop, but you can gracefully do
 multiple
 file uploads with flash (via flash 8). It also lets you know the progress
 of the file upload itself.

 I've done a snazzy picture upload tool for a Flex (generates flash
 applications on the fly with ActionScript and XML files only - no actual
 flash IDE) - it allows you to select a file, hit upload, shows a progress
 bar of the transfer (you can cancel at any time) - and when done, the
 image
 is made into a thumbnail and shown on the screen. -obviously, no page
 reloads and totally cross compatible.

 I wouldnt know where to start with regular flash as I'm a programmer, so
 only Flex appeals to me - but I know it can be done, and isnt extremely
 complicated. My guess is that you could have a flash guru whip something
 out pretty fast.

 =)

 -Nate Nielsen
 [EMAIL PROTECTED]

 - Original Message -
 From: Jasper Bryant-Greene [EMAIL PROTECTED]
 To: Joe Harman [EMAIL PROTECTED]
 Cc: php-general@lists.php.net
 Sent: Friday, November 18, 2005 8:52 PM
 Subject: Re: [PHP] Re: [PHP-DB] Drag and Drop with PHP and MySQL


  Joe Harman wrote:
  Hi Chris,
  I would think that there has to be something out there like a
 Javascript
  that would accomplish that... that would be my first guess anyhow...
  there
  possibly could be something done in flash that would act as a drop area
  for
  the file... let us know what you find
  Joe
 
  There's no way the browser is going to let JS have access to the user's
  filesystem. I would expect ditto for Flash, although I don't use it.
 
  Jasper
 
 
 
  On 11/18/05, Micah Stevens [EMAIL PROTECTED] wrote:
 
  No. That would be nice though eh?
 
  What I have done in the past is when a user needs to upload a file, I
  give
  them a linked button that links to a ftp:// style address. This ftp
  account
  points to a directory that PHP can have access to.
 
  The user then drags and drops (IE only) the files on this new window,
  which
  uploads the files to this directory.
 
  Once they're done, they close the window, and hit a second button
 'Click
  here
  when finished uploading' which tells php to grab all the files in the
  upload
  directory and put them where they need to go.
 
  This is far from ideal, causes miserable problems when more than one
  person is
  using the technique at once, and offers a host of security and
 usability
  issues. Oh, and it's IE only, Firefox can't do this, and I don't think
  opera/safari can either.
 
  However, it's much better than uploading a ton of files individually
  using
  a
  form. I only use this for applications where I can be sure that only
 one
  user
  will use it at once, and they're trusted.
 
  In a pinch it works though. I don't care so much about drag and drop,
 I
  was
  just trying to solve the multi-file upload issue. I wish there was a
  better
  way.
 
  If I'm stupid and there is, I'd love to hear about it.
 
  -Micah
 
  On Friday 18 November 2005 5:42 pm, Chris Payne wrote:
  HI there everyone,
 
 
 
  I have a file upload system where you select via requester the file
 to
  upload, it then uploads it with PHP and stores the info in a MySQL
  database. Is there an interface / programming method I can use which
 I
  can
  DRAG a file from the desktop into an area in a form just as if I had
  used a
  file requester to select a file? Learning a new programming technique
  is
  no problem as long as it can be used with PHP and MYSQL.
 
 
 
  Any helps / pointers would be REALLY welcome.
 
 
 
  Chris
  --
  PHP Database Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
 
 
  --
  Joe Harman
  -
  Do not go where the path may lead, go instead where there is no path
 and
  leave a trail. - Ralph Waldo Emerson
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 




--
Joe Harman
-
Do not go where the path may lead, go instead where there is no path and
leave a trail. - Ralph Waldo Emerson


[PHP] how can I CALL a PHP script page from a TEXT LINK?

2005-11-18 Thread xkorakidis
Hi, I'm not so keen in php (so in english :) ) and I had a problem:
In left menu I have got choices like :

PRODUCTS
Search
Add
CUSTOMERS
Search
Add
ORDERS
Search
Add

I need to make links to each Search, Add for the appropriate php
script pages. In other words I'm trying to make a simple administrator
interface. When Administrator finds a PRODUCT/CUSTOMER/ORDER, he can
edit/delete it.

The problem I have is that how can I call the appropriate php script
page when administrator clicks on each Search/Add. Is there any easy
way or any better solution generally?

Thanks in advance.
Christos Korakidis

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



[PHP] how can I CALL a PHP script from different TEXT LINKS with different PARAMETERS?

2005-11-18 Thread xkorakidis
Hi,
I'm not so keen on PHP (so on English :) ) and I have a little problem:
On the left side of the page there is the following menu:

PRODUCTS
Search
Add
MEMBERS
Search
Add
ORDERS
Search
Add

Is that possible to link each Search, Add to a Search.php and
Add.php page and give a parameter to php script so as to make an on
the fly searchProducts.php or AddProducts.php or
SearchMembers.php etc?
If I make individual searchProducts.php or AddProducts.php files
these won't have many differences, so I Think it's better to make these
on the fly.

Any Idea?

Thanks in advance.
Christos Korakidis

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



[PHP] I can't see my msgs...

2005-11-18 Thread xkorakidis
I can't see my posted msgs...

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



[PHP] shell command

2005-11-18 Thread John Taylor-Johnston

Hi,
I want to echo the location of head.jpg hidden in some deep dark 
recess of my server, unbeknownst to me.

Which shell command do I use? How do I echo it?
John

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



Re: [PHP] php + cURL issue

2005-11-18 Thread Curt Zirzow
On Fri, Nov 18, 2005 at 06:08:16PM -0600, Nate Nielsen wrote:
 Okay, I've added the verbose output to copare exactly what is happening 
 between the two versions - thanks to Curt, the verbose info shows there IS 
 something different happening.
 
 To recap, the code is exactly the same, the php version is the same (same 
 files even), the php.ini is the same (except drive letters), the curl 
 version is exactly the same (libcurl/7.14.0 OpenSSL/0.9.8 zlib/1.2.3).  The 
 only difference is that one server is Win2k and the other is Win2003  (and 
 of course one is working and other is not).

yeah, it does seem to be *not* a bug in curl versions.

 
 Now it is very clear that something different is happening on the two 
 different servers.  I've created a page to list the phpInfo() data, the 
 code that is being run, and the VERBOSE information outputted by cURL.
 
 You can view the information here : http://70.84.198.254/index.html

ok.. the key thing i noticed in that nice little side by side
display you put together is this:

When you are sending the first post data look at the end of it
curl is complaining about something:

Ok side:
name=login_form.src=auc.tries=1.done=TML
4.01//EN.md5=.hash=.js=.partner=.slogin=adsherrouse.intl=us.fUpdate=.prelog=.bid=.aucid=.challenge=.01//EN.yplus=.chldID=pkg=hasMsgr=0passwd=doglogansubmit=Sign
  In HTTP/1.1 302 Found

Bad Side:
name=login_form.src=auc.tries=1.done=TML
4.01//EN.md5=.hash=.js=.partner=.slogin=adsherrouse.intl=us.fUpdate=.prelog=.bid=.aucid=.challenge=.01//EN.yplus=.chldID=pkg=hasMsgr=0passwd=doglogansubmit=Sign
  In* Curl_xxx_rcvs returned -1, block = TRUE

You will notice that the ok side is sends back a 302 while the bad
side is returning an error from curl.

I'm not sure what that Curl_xxx_rcvs.. line means but it seems is
the source of the problem.

A other thing you would want to compare is the actual results that
come back from the request.

On the otherhand, what you seem to be doing is very likely to break
sooner than later, i'm not sure why you want to proxy a complex web
authentication system such as yahoo's


Curt.
-- 

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



Re: [PHP] MySQL C API

2005-11-18 Thread Curt Zirzow
On Fri, Nov 18, 2005 at 09:34:56AM -0500, Leonard Burton wrote:
 HI All,
 
 Does anyone on here use the MySQL C API?  Would you mind if I asked
 you a few questions off the list?

You might want to ask someone on a related mysql list. 

Curt.
-- 

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



Re: [PHP] shell command

2005-11-18 Thread Jasper Bryant-Greene

John Taylor-Johnston wrote:

Hi,
I want to echo the location of head.jpg hidden in some deep dark 
recess of my server, unbeknownst to me.

Which shell command do I use? How do I echo it?
John



While this isn't really a PHP question...

On my machine, the following would work. I can't speak for your machine, 
though.


cd /; find -name head.jpg

--
Jasper Bryant-Greene
General Manager
Album Limited

+64 21 708 334
[EMAIL PROTECTED]

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



AW: [PHP] how can I CALL a PHP script from different TEXT LINKS with differentPARAMETERS?

2005-11-18 Thread Webmaster
Hi,
i hope I got you right.

You can send data to the next php file by HTTP-GET.
Simply add a ? behind the link and then variablename=value.
Example   ./jumpto.php?to=searchProduct

In the jumpto.php you would ask the Global Array for Get Variables for the
entry and then decide what to do.

Example:

sf($_GET[to] == searchProduct){
header(Location: ./searchProduct.php);
}

Or if you have a lot of locations to jump to you could do that by case.

switch($_GET[to]){
case seachProduct:
header(Location: ./searchProduct.php);
break;
case seachMember:
header(Location: ./searchMember.php);
break;
}

I hope that helped.

Greetings
Mirco Blitz
-Ursprüngliche Nachricht-
Von: xkorakidis [mailto:[EMAIL PROTECTED] 
Gesendet: Samstag, 19. November 2005 05:10
An: php-general@lists.php.net
Betreff: [PHP] how can I CALL a PHP script from different TEXT LINKS with
differentPARAMETERS?

Hi,
I'm not so keen on PHP (so on English :) ) and I have a little problem:
On the left side of the page there is the following menu:

PRODUCTS
Search
Add
MEMBERS
Search
Add
ORDERS
Search
Add

Is that possible to link each Search, Add to a Search.php and
Add.php page and give a parameter to php script so as to make an on
the fly searchProducts.php or AddProducts.php or
SearchMembers.php etc?
If I make individual searchProducts.php or AddProducts.php files
these won't have many differences, so I Think it's better to make these
on the fly.

Any Idea?

Thanks in advance.
Christos Korakidis

-- 
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



Re: [PHP] shell command

2005-11-18 Thread Robert Cummings
On Sat, 2005-11-19 at 13:02, Jasper Bryant-Greene wrote:
 John Taylor-Johnston wrote:
  Hi,
  I want to echo the location of head.jpg hidden in some deep dark 
  recess of my server, unbeknownst to me.
  Which shell command do I use? How do I echo it?
  John
  
 
 While this isn't really a PHP question...
 
 On my machine, the following would work. I can't speak for your machine, 
 though.
 
 cd /; find -name head.jpg

Under linux:

locate head.jpg

This is better than find usually since the filesystem is usually indexed
nightly making lookup fast. If you just added the file though... you'll
need to use the aforementioned method :)

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.  |
`'

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



AW: [PHP] shell command

2005-11-18 Thread Mirco Blitz
Hi
On some linux systems where you can't jump to / 
you can also write the command like this.

find / -name head.jpg

Greetings
Mirco

-Ursprüngliche Nachricht-
Von: Jasper Bryant-Greene [mailto:[EMAIL PROTECTED] 
Gesendet: Samstag, 19. November 2005 06:03
An: John Taylor-Johnston
Cc: PHP-General
Betreff: Re: [PHP] shell command

John Taylor-Johnston wrote:
 Hi,
 I want to echo the location of head.jpg hidden in some deep dark 
 recess of my server, unbeknownst to me.
 Which shell command do I use? How do I echo it?
 John
 

While this isn't really a PHP question...

On my machine, the following would work. I can't speak for your machine, 
though.

cd /; find -name head.jpg

-- 
Jasper Bryant-Greene
General Manager
Album Limited

+64 21 708 334
[EMAIL PROTECTED]

-- 
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



Re: [PHP] how can I CALL a PHP script from different TEXT LINKS with differentPARAMETERS?

2005-11-18 Thread ahmed
On 11/19/05, Webmaster [EMAIL PROTECTED] wrote:
 You can send data to the next php file by HTTP-GET.
 Simply add a ? behind the link and then variablename=value.
 Example   ./jumpto.php?to=searchProduct

Well i think it was about the code inside the search/add/edit pages
not how to reach them.
If i understood correctly, you're trying to reduce the amount of code
to write by applying a pice of common code on your objects
(product/member/order) while adding specific functionality using a
switche specifed as a paramter (?object=Product/Member/Order)... It
just all depends on how common are these operations that needed to
be applied in each case.. so you knows that better

-ahmed


--
bahmed/b


[PHP] Re: How to build a XML DTD on the fly?

2005-11-18 Thread Erik Franzén
I saw this example on 
http://blog.bitflux.ch/wiki/GetElementById_Pitfalls and thought that I 
could create the DTD in the XML file.


$xml ='?xml version=1.0?
  !DOCTYPE foo [
  !ATTLIST bar
id ID #IMPLIED
  
  ]
  foo
bar id=myId/
  /foo';
$dom = new DomDocument();
$dom-loadXML($xml);
print $dom-getElementById('myId')-nodeName;

But apparently, that is not the case.

/Erik


James Benson wrote:

Learn DTD and how it works first then you will know :-)


A DTD is contained in an external file and not in XML, so you would 
create a DTD file then link it from the XML like so,



!DOCTYPE document SYSTEM document.dtd





Erik Franzén wrote:

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=123test/document

TagName:


Thanks
/Erik





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



[PHP] Re: How to build a XML DTD on the fly?

2005-11-18 Thread Erik Franzén
My real problem is that I am building a XML tree and I want to use the 
getElementbyId method on the tree directly.


It would be very nice if it is possible to do it without including a 
external dtd, since it takes some time to load every time.


The page http://blog.bitflux.ch/wiki/GetElementById_Pitfalls have some 
information about my issue, but I have not found the path to go yet.


I am using php5.05 on Win32.


/Erik



Rob wrote:

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



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



[PHP] DomDocument::GetElementById - a workaround with external DTD

2005-11-18 Thread Erik Franzén

Have tried the following code:

?php
// Creates an instance of the DOMImplementation class
$oDomImp = new DOMImplementation;

// Creates a DOMDocumentType instance
$oDomDtd = $oDomImp-createDocumentType('Document', '', 
'D:/CMAES/Src/dbtree.dtd');


// Creates a DOMDocument instance
$oDom = $oDomImp-createDocument(, Document, $oDomDtd);

// Set other properties
$oDom-encoding = 'iso-8859-1';

$oElement = $oDom-createElement('CMAES_Model_DbSection', 'test');
$oElement-setAttribute('S_iSectionId', '123');

// Append the element
$oDom-documentElement-appendChild($oElement);

// Retrieve and print the document
echo $oDom-saveXML() . \n\n;

// Do validation
var_dump($oDom-validate());

// Type node name
echo TagName:  . $oDom-getElementById('123')-tagName;
?

Using the following DTD as an external file:
!ELEMENT Document ANY
!ELEMENT CMAES_Model_DbSection ANY
!ATTLIST CMAES_Model_DbEntry E_iEntryId ID #REQUIRED

The result is the following:

?xml version=1.0 encoding=iso-8859-1?
!DOCTYPE Document SYSTEM D:/CMAES/Src/dbtree.dtd
DocumentCMAES_Model_DbSection 
S_iSectionId=123test/CMAES_Model_DbSection/Document




Warning:  Syntax of value for attribute S_iSectionId of 
CMAES_Model_DbSection is not valid in script on line 23

bool(false)
TagName: CMAES_Model_DbSection

Now I have some (for me) strange DTD failure due to the error syntax of 
value for attribute S_iSectionId of CMAES_Model_DbSection is not valid. 
I cannot understand that error. I have missed something, but what?


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



[PHP] Sorry, I copied the wrong the DTD in the code:

2005-11-18 Thread Erik Franzén

Sorry, I copied the wrong DTD into the post.

The DTD is the following:

!ELEMENT Document ANY
!ELEMENT CMAES_Model_DbSection ANY
!ATTLIST CMAES_Model_DbSection S_iSectionId ID #IMPLIED

Here is the code example and result again:

?php
// Creates an instance of the DOMImplementation class
$oDomImp = new DOMImplementation;

// Creates a DOMDocumentType instance
$oDomDtd = $oDomImp-createDocumentType('Document', '', 
'D:/CMAES/Src/dbtree.dtd');


// Creates a DOMDocument instance
$oDom = $oDomImp-createDocument(, Document, $oDomDtd);

// Set other properties
$oDom-encoding = 'iso-8859-1';

$oElement = $oDom-createElement('CMAES_Model_DbSection', 'test');
$oElement-setAttribute('S_iSectionId', '123');

// Append the element
$oDom-documentElement-appendChild($oElement);

// Retrieve and print the document
echo $oDom-saveXML() . \n\n;

// Do validation
var_dump($oDom-validate());

// Type node name
echo TagName:  . $oDom-getElementById('123')-tagName;
?

Using the following DTD as an external file:
!ELEMENT Document ANY
!ELEMENT CMAES_Model_DbSection ANY
!ATTLIST CMAES_Model_DbSection S_iSectionId ID #IMPLIED

The result is the following:

?xml version=1.0 encoding=iso-8859-1?
!DOCTYPE Document SYSTEM D:/CMAES/Src/dbtree.dtd
DocumentCMAES_Model_DbSection 
S_iSectionId=123test/CMAES_Model_DbSection/Document




Warning:  Syntax of value for attribute S_iSectionId of 
CMAES_Model_DbSection is not valid in script on line 23

bool(false)
TagName: CMAES_Model_DbSection

/Erik

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



Re: [PHP] DomDocument::GetElementById - a workaround with external DTD

2005-11-18 Thread Curt Zirzow
On Sat, Nov 19, 2005 at 07:05:37AM +0100, Erik Franzn wrote:
... 
 Using the following DTD as an external file:
 !ELEMENT Document ANY
 !ELEMENT CMAES_Model_DbSection ANY
 !ATTLIST CMAES_Model_DbEntry E_iEntryId ID #REQUIRED
 
 The result is the following:
 
 ?xml version=1.0 encoding=iso-8859-1?
 !DOCTYPE Document SYSTEM D:/CMAES/Src/dbtree.dtd
 DocumentCMAES_Model_DbSection 
 S_iSectionId=123test/CMAES_Model_DbSection/Document
 
 
 
 Warning:  Syntax of value for attribute S_iSectionId of 
 CMAES_Model_DbSection is not valid in script on line 23
 bool(false)
 TagName: CMAES_Model_DbSection

I would assume you want

  !ATTLIST CMAES_Model_DbEntry S_iSectionId ID #REQUIRED

or 

change the S_iSectionId to be E_iEntryId (to match the dtd)
attibute in the element.

Curt.
-- 
cat: .signature: No such file or directory

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