[PHP] single sign on Solution php and .net

2007-04-27 Thread Murtaza Chang

Hi, me and my fellow developer have built two applications that need to
authenticate users using LDAP, we have successfully accomplished it, but the
problem is his application is in .net and mine is in php, my php app needs
to call secure pages of .net and vice versa, now when the user is logged
onto let say my php app he is logged and his session is created and when I
redirect him to .net app he again sees a login form because the session isnt
created in .net app.
I need some single sign on solution I found lots of APIs and libraries for
java but have no idea what can I use for php and .net, kindly experience
programmers guide me.
Thankyou

--
Murtaza Chang
http://flickr.com/photos/blackstallion/


[PHP] *SOLVED* Need to POST multiple values with single name

2007-04-27 Thread Maxim . Sedelnikov
Thanks to all.
I've solved the problem with 'http_post_data()':

$data=array('aaa1' => '2', 'bbb2' => '');
$mult='licenses=lic1&licenses=lic2';
$http_response=http_post_data($url,http_build_str($data).'&'.$mult,$opt);

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



[PHP] Script feedback: insert string into another string

2007-04-27 Thread Micky Hulse

Hi,

I pieced-together a script that will insert a string into another string 
at a set interval of words... See here:




[Click the "view source" link to view source.] :D

Basically, I need a setup a page where my client can paste an article, 
automate the insertion of a template tag (in this case: {page_break}) 
and then copy/paste into the blog/cms. My goal for this script was to 
make it easy for the CMS to create word-balanced pages.


Long story short, I got what I think will be an acceptable script... but 
I would love to get feedback. What do you think? What can I improve? 
What am I doing wrong?


The script does not need to be super-robust, but would love to hear what 
the PHP gurus have to say. ;)


Many thanks in advance!
Cheers,
Micky

--
Wishlists: 
   Switch: 
 BCC?: 
   My: 

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



[PHP] Re: how to detect type of image

2007-04-27 Thread Tim

On 21.04.2007 12:45, Alain Roger wrote:

Hi,

In my web application, end user is able to load images (png, jpeg,
gif,..) into database. I would like to know how can i detect
automatically the type of image (pnd, jpeg,...) ? i do not want to
check the extension because this is easily faked... just by renaming
it.

Does it exist a technique for that ?

thanks a lot,



Hi,

unfortunately mime_content_type() does not work for me. This functions
does always return false, although the "magic.mime" is valid.
Here is a function I wrote to determine the correct extension of an
image file:

function get_image_extension($filename)
{
if (function_exists('exif_imagetype'))
{
switch (exif_imagetype($filename))
{
case 1:
return 'gif';
case 2:
return 'jpg';
case 3:
return 'png';
case 4:
return 'swf';
case 5:
return 'psd';
case 6:
return 'bmp';
case 7:
return 'tiff';
case 8:
return 'tiff';
case 9:
return 'jpc';
case 10:
return 'jp2';
case 11:
return 'jpx';
case 12:
return 'jb2';
case 13:
return 'swc';
case 14:
return 'iff';
case 15:
return 'wbmp';
case 16:
return 'xbm';
default:
return false;
}
}
else
return false;
}

Best regards,
Tim

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



Re: [PHP] TrueType font changes size when rotated?

2007-04-27 Thread Tijnema !

On 4/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:

On Thu, April 26, 2007 7:14 am, Tijnema ! wrote:
> On 4/26/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>> On Wed, April 25, 2007 3:33 pm, Seth Price wrote:
>> > I downloaded your image, enlarged it, and measured it out in
>> > photoshop. The distance from the center to the left side is 131px,
>> > and center to right side is 129px. Diameter to top is 129px, and
>> to
>> > bottom is 130px.
>> >
>> > While it may not be an obvious ellipse, it's enough to throw off
>> my
>> > calculations.
>>
>> Enlarged it how?
>
> I guess he meant to zoom, so that he could actually count the pixels
> :)

Same smell.

Once you do "zoom" counting pixels will never be exact.

The "zoom" function had to deal with rounding errors and chose to
either add a pixel or not.


Did you ever used zoom in Adobe Photoshop CS3? You can zoom until the
pixels are about 1CM on the screen. If you still are going to tell me
that it would differ if there was to add a pixel or not. Didn't
checked with photoshop either, but i there's a good chance that the OP
is true. As he is using photoshop.


Tijnema

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



Re: [PHP] problem with shared object file

2007-04-27 Thread Tijnema !

On 4/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:

On Thu, April 26, 2007 5:48 am, Marten Lehmann wrote:
> Hello,
>
> I'm trying to include a shared object file with the function dl(). But
> I
> always get:
>
> Warning: dl() [function.dl]: Unable to load dynamic library
> '/homepages/xyz/util.so' - /homepages/xyz/util.so: cannot open shared
> object file: No such file or directory in /homepages/xyz/test.php on
> line 5
>
> But it is definetely there and readable (also executable)!
>
> I tried to include('/homepages/xyz/util.so') which gives same parsing
> errors since this is not php-code, but including works, so it's
> actually
> readable.
>
> What is the real error behind it? How can I find out why dynamic
> loading
> fails? Is it possibly due to different glibc versions?

It's possible that util.so itself is fine, but util.so needs *ANOTHER*
.so file that *it* cannot find...

You may want to check the Apache error log and /var/log/messages to
see if they have anything in them.

Also, I think dl() is going away in PHP 6, so you may want to re-think
this from the get-go...


Yes, if seen it is deprecated, but how could somebody include dynamic
library without editing php.ini? I was a little bit shocked when i
read i should use php.ini variable instead. I never used it, but when
i wanted to, i  would only to have it loaded in that script, and not
all scripts.

Tijnema


--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

--
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] Re: Make eclipse-php recognise custom extension as php ?

2007-04-27 Thread Tijnema !

On 4/27/07, Don Don <[EMAIL PROTECTED]> wrote:

Hi Roberto, i tried out your tip, it does work but it looses the syntax 
highlighting functionality.  Is there anyway I can make the new extension open 
up its contents with syntax and other php oriented functionalities ?

 Cheers


I have no knowledge of Eclipse, but it seems a stupid program, it
should color highlight based on the typed code, so if there is  in a page, that it performs PHP highlighting on it.
Did you see if there's a way to manually select which color
highlighting to use? It's possible in programs like KDevelop.

Tijnema


Roberto Mansfield <[EMAIL PROTECTED]> wrote:
 Don Don wrote:
> Hi all, i've changed my server's apache config to recognize my custom
> extension for php files. And all my development filenames now come
> with this new extension.
>
> However my IDE (Php Eclipse) will not recognise this new extension as
> a php file, even though it opens it up but it looses all the php
> features (e.g. syntax highlighting, flags, errors, warnning,
> intellisence etc)
>
> How can i make php-eclipse recognise my new custom extension as a php
> file ?

I believe what you want to do is setup a file association in your
preferences. Give this a try:

Open Window->Preferences.

Under General->Editors->File Associations, add your new file extension.
Highlight the new extension and use the Associated Editors box below to
tie the extension to the PHP editor.

Good luck,
Roberto

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




-
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.


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



Re: [PHP] Re: Make eclipse-php recognise custom extension as php ? [SOLVED]

2007-04-27 Thread Don Don
Hi Roberto, I finally made it to work by using the content-type option in 
adition to your earlier tip.  I did this Windows -> Preferences -> Content 
Types -> i clicked on text in the top box -> and selected -> PHP Source file , 
then added my custom extension below.
   
  The new custom extension now behaves exactly like a php file.
   
  Cheers..at least your tip lead me there.

Don Don <[EMAIL PROTECTED]> wrote:
  Hi Roberto, i tried out your tip, it does work but it looses the syntax 
highlighting functionality. Is there anyway I can make the new extension open 
up its contents with syntax and other php oriented functionalities ?

Cheers

Roberto Mansfield wrote:
Don Don wrote:
> Hi all, i've changed my server's apache config to recognize my custom
> extension for php files. And all my development filenames now come
> with this new extension.
> 
> However my IDE (Php Eclipse) will not recognise this new extension as
> a php file, even though it opens it up but it looses all the php
> features (e.g. syntax highlighting, flags, errors, warnning,
> intellisence etc)
> 
> How can i make php-eclipse recognise my new custom extension as a php
> file ?

I believe what you want to do is setup a file association in your
preferences. Give this a try:

Open Window->Preferences.

Under General->Editors->File Associations, add your new file extension.
Highlight the new extension and use the Associated Editors box below to
tie the extension to the PHP editor.

Good luck,
Roberto

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




-
Ahhh...imagining that irresistible "new car" smell?
Check outnew cars at Yahoo! Autos.

   
-
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.

Re: [PHP] Re: Make eclipse-php recognise custom extension as php ?

2007-04-27 Thread Don Don
Hi Roberto, i tried out your tip, it does work but it looses the syntax 
highlighting functionality.  Is there anyway I can make the new extension open 
up its contents with syntax and other php oriented functionalities ?
   
  Cheers

Roberto Mansfield <[EMAIL PROTECTED]> wrote:
  Don Don wrote:
> Hi all, i've changed my server's apache config to recognize my custom
> extension for php files. And all my development filenames now come
> with this new extension.
> 
> However my IDE (Php Eclipse) will not recognise this new extension as
> a php file, even though it opens it up but it looses all the php
> features (e.g. syntax highlighting, flags, errors, warnning,
> intellisence etc)
> 
> How can i make php-eclipse recognise my new custom extension as a php
> file ?

I believe what you want to do is setup a file association in your
preferences. Give this a try:

Open Window->Preferences.

Under General->Editors->File Associations, add your new file extension.
Highlight the new extension and use the Associated Editors box below to
tie the extension to the PHP editor.

Good luck,
Roberto

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



   
-
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.

Re: [PHP] Server side speech

2007-04-27 Thread Robert Cummings
On Fri, 2007-04-27 at 15:44 -0500, Richard Lynch wrote:
> On Wed, April 25, 2007 7:10 pm, Robert Cummings wrote:
> > On Wed, 2007-04-25 at 16:26 -0500, Richard Lynch wrote:
> >> On Wed, April 25, 2007 3:27 pm, Daniel Brown wrote:
> >> > That's fine if you can find a shared host (as the OP states
> >> he's
> >> > using)
> >> > that's willing to install it on their servers.
> >>
> >> Or you have a spare computer in your closet that you can install the
> >> same OS as the server has, and the you compile the binary, and
> >> upload
> >> that, and then you can just 'exec' that.
> >
> > Bleh, this is the era of virtualization... instal vmware server and
> > then
> > have a any given distro virtualized as a development server for
> > migrating binaries to production servers. I do this with various Red
> > Hat, Debian, Ubuntu, and CentOS flavours. And it's the only way to run
> > Windows to test in IE.
> 
> I happen to have a lot of hardware laying around...
> 
> Part of why I'm buying a house.
> 
> Too much stuff.
> 
> VMWare is nifty if your computer has the ooomph to handle it.
> 
> I got turned off of VMWare early on, because I found myself endlessly
> tweaking the RAM settings to get better performance out of whichever
> VM I was needing at any given time, and it was too painful to do that.

I first used vmware back in 2000 and thought it was cool then, but the
currently free vmware server is a completely different beast than that
was. First it provides common OS choices to choose form when installing
an OS. It suggest what you should allocate as minimum and good memory
settings, and it provides tabbing between multiple running VMs and also
includes really easy bridged networking etc so your vms can transfer
between the host computer and even other VMs. And of course, one of my
favourite features is that it can now connect an ISO image on the host
as the CDROM. Ditto for floppy disk images (if you want to install
windows 3.11 like I did (for giggles and farts :))

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] Parsing CSV files

2007-04-27 Thread Todd Cary
Many thanks!  I must be losing my eyesight!  There it is and it works as 
expected...great.


Todd

Richard Lynch wrote:

On Thu, April 26, 2007 3:39 pm, Todd Cary wrote:
  

Is there a function that can parse a comma delimited file into an
array?



fgetcsv should work...



  


--
Ariste Software
2200 D Street Ext
Petaluma, CA 94952
(707) 773-4523



Re: [PHP] Need to POST multiple values with single name

2007-04-27 Thread Daniel Brown

   I'm guessing that the OP stated he needs to use keys  I was actually
just responding with what I read from your email, because the original post
didn't come through.  In which case, pay no attention to the man behind the
curtain!



On 4/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:


On Fri, April 27, 2007 2:30 pm, Daniel Brown wrote:
> For that matter, you don't even need the keys

If you need the keys, you need the keys...

:-)

There have been cases where I wanted the key and the value transmitted
as a pair.

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?





--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


Re: [PHP] TrueType font changes size when rotated?

2007-04-27 Thread Richard Lynch
On Thu, April 26, 2007 7:14 am, Tijnema ! wrote:
> On 4/26/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>> On Wed, April 25, 2007 3:33 pm, Seth Price wrote:
>> > I downloaded your image, enlarged it, and measured it out in
>> > photoshop. The distance from the center to the left side is 131px,
>> > and center to right side is 129px. Diameter to top is 129px, and
>> to
>> > bottom is 130px.
>> >
>> > While it may not be an obvious ellipse, it's enough to throw off
>> my
>> > calculations.
>>
>> Enlarged it how?
>
> I guess he meant to zoom, so that he could actually count the pixels
> :)

Same smell.

Once you do "zoom" counting pixels will never be exact.

The "zoom" function had to deal with rounding errors and chose to
either add a pixel or not.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Need to POST multiple values with single name

2007-04-27 Thread Richard Lynch
On Fri, April 27, 2007 2:30 pm, Daniel Brown wrote:
> For that matter, you don't even need the keys

If you need the keys, you need the keys...

:-)

There have been cases where I wanted the key and the value transmitted
as a pair.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] move "if" logic from php into query

2007-04-27 Thread tg-php
In my data scrubbing function, I pass it a content type (phone, city, SSN, 
etc), do whatever scrubbing/filtering I'm going to do on that type of content, 
then after everything's done, then I do the mysql_real_escape_string() on it 
and return that to where the function was called.

That way, everything going into the database has at least 
mysql_real_escape_string() run on it.  The other checks on the content are just 
to verify that the data is similar in format and composition to what that type 
of data should be like.

For instance, Phone #'s and SSNs have everything but numbers removed, but are 
not treated as numbers (since a leading zero is still important).

-TG


= = = Original message = = =

On Thu, April 26, 2007 4:02 am, Sebe wrote:
> i always use intval() on something i'm inserting into database that
> *should* be a integer. i don't know if there is a difference or a good
> reason to pick one or the other.. i'm not Richard so maybe he can
> create
> an interesting story for us on the *proper* way ;-)

Well...

(int) $foo;
intval($foo);

are pretty interchangable, really.

Just depends if you're an old C hacker or you prefer making function
calls.

I can't imagine doing enough of either in any real script for
performance to be an issue, so let's skip the whole benchmark thread,
please???

That said, I've recently decided that even after doing (int) [or
intval()] that I'd like to be 100% kosher and still do
mysql_real_escape_string.

Mainly because somebody pointed out that doing the same thing for
(float) could yield things that may not be "good" in SQL like
underflow, overflow, exponential notation, and also that the - sign in
front *could* end up being part of a subtraction and you *could*
manage to leave out the space, and then you've got an SQL comment
instead of subtraction.

$a = (int) $_REQUEST['a'];
$b = (int) $_REQUEST['b'];
$query = "select $a-$b ";

http://example.com/a=5&b=-3

So the (int) or intval() is "not enough" imho.

YMMV

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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


___
Sent by ePrompter, the premier email notification software.
Free download at http://www.ePrompter.com.

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



Re: [PHP] Parsing CSV files

2007-04-27 Thread Richard Lynch
On Fri, April 27, 2007 2:44 pm, Tijnema ! wrote:
> On 4/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>> On Fri, April 27, 2007 1:58 pm, Tijnema ! wrote:
>> > There are more interesting things to do than updating
>> documentation ;)
>> >
>> > I was wanting to extend the CURLOPT_ constants, but it seemed that
>> > nobody had interest in that, so i didn't ...
>>
>> I believe the issue here is that having the constants with no body
>> of
>> code to do something useful when the constants would just be
>> counter-productive...
>
> Well, actually it was quite simple, adding the constants and adding
> them to the function that passes it to the curl library and it would
> work. So it has some extra functionality. So, you might never use
> them, but somebody else might.

In that case, if you submit a patch, it will almost-for-sure go in.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] slow performance

2007-04-27 Thread Richard Lynch
On Thu, April 26, 2007 5:53 am, Robin Vickery wrote:
> On 25/04/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>> On Wed, April 25, 2007 5:09 am, Zoltán Németh wrote:
>> > 2007. 04. 25, szerda keltezÃ(c)ssel 11.53-kor Henning Eiben ezt
>> írta:
>> >> Zoltán NÃ(c)meth schrieb:
>> >>
>> > not exactly. it pre-compiles them to opcodes and stores the opcode
>> > blocks. the interpreter normally first pre-compiles the code to
>> > opcodes
>> > then runs the opcode. this pre-compilation can be cached with
>> > accelerators, that's how they increase performance.
>>
>> Please, please, please stop misinformation. :-)
>>
>> The accelerators *ALL* make their dramatic performance boost by
>> CACHING the hard drive into RAM.
>>
>> Caching PHP Source would do *almost* as well.
>
> This statement seems a bit suspicious to me - what OS are you using
> that doesn't already cache the disk accesses into RAM? (for example
> the Linux VFS buffer cache).

All the OSes have some kind of general-purpose cache for whatever
files, all of them, that you've been using...

That does not negate the statements I've made:

The PHP specific accelerators cache the bytecode in RAM, which
provides far more of a boost than bypassing that compile phase.

Feel free to use callgrind on APC and see for yourself how it changes
the behaviour of the system, and where the big "win" in performance
comes from, if you think I'm wrong.

I'm only telling you what I was told by Ze'ev, Andi, Rasmus etc, who
actually wrote the dang things. :-)

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Server side speech

2007-04-27 Thread Richard Lynch
On Wed, April 25, 2007 7:10 pm, Robert Cummings wrote:
> On Wed, 2007-04-25 at 16:26 -0500, Richard Lynch wrote:
>> On Wed, April 25, 2007 3:27 pm, Daniel Brown wrote:
>> > That's fine if you can find a shared host (as the OP states
>> he's
>> > using)
>> > that's willing to install it on their servers.
>>
>> Or you have a spare computer in your closet that you can install the
>> same OS as the server has, and the you compile the binary, and
>> upload
>> that, and then you can just 'exec' that.
>
> Bleh, this is the era of virtualization... instal vmware server and
> then
> have a any given distro virtualized as a development server for
> migrating binaries to production servers. I do this with various Red
> Hat, Debian, Ubuntu, and CentOS flavours. And it's the only way to run
> Windows to test in IE.

I happen to have a lot of hardware laying around...

Part of why I'm buying a house.

Too much stuff.

VMWare is nifty if your computer has the ooomph to handle it.

I got turned off of VMWare early on, because I found myself endlessly
tweaking the RAM settings to get better performance out of whichever
VM I was needing at any given time, and it was too painful to do that.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] move "if" logic from php into query

2007-04-27 Thread Richard Lynch
On Thu, April 26, 2007 4:02 am, Sebe wrote:
> i always use intval() on something i'm inserting into database that
> *should* be a integer. i don't know if there is a difference or a good
> reason to pick one or the other.. i'm not Richard so maybe he can
> create
> an interesting story for us on the *proper* way ;-)

Well...

(int) $foo;
intval($foo);

are pretty interchangable, really.

Just depends if you're an old C hacker or you prefer making function
calls.

I can't imagine doing enough of either in any real script for
performance to be an issue, so let's skip the whole benchmark thread,
please???

That said, I've recently decided that even after doing (int) [or
intval()] that I'd like to be 100% kosher and still do
mysql_real_escape_string.

Mainly because somebody pointed out that doing the same thing for
(float) could yield things that may not be "good" in SQL like
underflow, overflow, exponential notation, and also that the - sign in
front *could* end up being part of a subtraction and you *could*
manage to leave out the space, and then you've got an SQL comment
instead of subtraction.

$a = (int) $_REQUEST['a'];
$b = (int) $_REQUEST['b'];
$query = "select $a-$b ";

http://example.com/a=5&b=-3

So the (int) or intval() is "not enough" imho.

YMMV

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Fwd: php + db2

2007-04-27 Thread Richard Lynch
On Thu, April 26, 2007 4:46 am, Javier Ruiz wrote:
> Ok, I've seen something... I'm trying to compile php with db2 support
> but
> also with oracle support using oracle-instantclient.
>
> If I remove the oracle options (with-oci8 and with-pdo-oci), configure
> passes the ibm-db2 tests, but using oracle-instantclient + db2 seems
> to be
> problematic...

Perhaps they both muck with PATH or something, and one or the other
does it wrong and wipes out the other?

That seems kinda unlikely, but you never know...

The configure script itself may be messed up...

If you compile WITH DB2, and then WITH Oracle, separately, and manage
to keep/copy the .so files where they belong, you might get both to be
extensions you can load with php.ini though.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] define() an array?

2007-04-27 Thread Richard Lynch
On Thu, April 26, 2007 5:43 am, Tijnema ! wrote:
> On 4/20/07, Richard Lynch <[EMAIL PROTECTED]> wrote:
>> On Fri, April 20, 2007 4:46 am, [EMAIL PROTECTED] wrote:
>> > I thought I could define() and array. However, when I do this:
>>
>> Nope. :-(
>>
>> Has to be string or int or boolean or float or other "scalar" type.
>>
>> > define("THECONSTANT", array(1,2,3));
>> > print_r(THECONSTANT);
>> >
>> > it prints THECONSTANT and not the array :(
>> >
>> > according to the manual:
>> >
>> > bool define ( string $name, mixed $value [, bool
>> $case_insensitive] )
>> >
>> > And isn't "mixed" of any type?
>>
>> No.
>>
>> "mixed" just means it's 2 or more types.
>>
>> There could be all kinda of reasons/cases where "mixed" means only
>> scalars, or only compound types or, really, any 2 types you'd care
>> to
>> choose.
>
> So, why isn't such stuff in the manual?
>
> It could be under Paramaters:
> value
> The value of the constant.
> Or, perhaps replacing the mixed by scalar $value.

The fact that you can only have a scalar for the value of a constant
is documented here:
http://us2.php.net/manual/en/language.constants.php

It would be nice, perhaps, to have it also documented in the 'define'
function page, but there it is...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] problem with shared object file

2007-04-27 Thread Richard Lynch
On Thu, April 26, 2007 5:48 am, Marten Lehmann wrote:
> Hello,
>
> I'm trying to include a shared object file with the function dl(). But
> I
> always get:
>
> Warning: dl() [function.dl]: Unable to load dynamic library
> '/homepages/xyz/util.so' - /homepages/xyz/util.so: cannot open shared
> object file: No such file or directory in /homepages/xyz/test.php on
> line 5
>
> But it is definetely there and readable (also executable)!
>
> I tried to include('/homepages/xyz/util.so') which gives same parsing
> errors since this is not php-code, but including works, so it's
> actually
> readable.
>
> What is the real error behind it? How can I find out why dynamic
> loading
> fails? Is it possibly due to different glibc versions?

It's possible that util.so itself is fine, but util.so needs *ANOTHER*
.so file that *it* cannot find...

You may want to check the Apache error log and /var/log/messages to
see if they have anything in them.

Also, I think dl() is going away in PHP 6, so you may want to re-think
this from the get-go...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Uploaded file

2007-04-27 Thread Richard Lynch
On Thu, April 26, 2007 2:08 pm, Stut wrote:
> PHP wrote:
>> How do I pass an uploaded file, from a form, to a class?
>>
>> I have a file type on the form called file.
>>
>> The variable $file is fine in my php code, can be used normally.
>>
>> But, I want to pass it to a class then manipulate the file, but it
>> does not work.
>>
>> $cMyClass->fnManipulateFile($file);

I suspect you are doing like this:

$file = $_FILES['file']['file_name'];
$cMyClass->fnManipulateFile($file);

You could do this instead:
$file = $_FILES['file'];
$cMyClass->fnManipulateFile($file);

Now you have an array coming in with all the elements you need,
file_name, error, original_name, etc.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Opening file

2007-04-27 Thread Richard Lynch
On Thu, April 26, 2007 2:19 pm, ed gregory wrote:
>
> Hi list,
>
> I have been trying to make "printer friendly version" feature for a
> web site and have encountered a problem. Each page of the web site is
> composed of a header.php, footer.php and the content of the page which
> uses "include_once" to include the above mentioned pages. I have tried
> all known methods of reading the file I want to have "printer friendly
> version" for, but all of them return a complete page (page with code
> of footer.php and header.php included, and not the original).
>
> So, here is what I get:
> ***
> 
> aaa
> 
> some content here
> 
> 
> ***
>
> And what I need is:
> ***
>  include_once "header.php"
> ?>
> some content here
>  include_once "footer.php"
> ?>
> ***
>
> After I get the original code I can exclude the "include" php tags and
> print only the main content.

http://freenet.am";);
  preg_match("|]>(.*)|msi", $html, $body);
  echo htmlentities($body):
?>

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Server-Side Speech --- New Project Discussion (PHP/C++ Developers?)

2007-04-27 Thread Richard Lynch


On Fri, April 27, 2007 11:00 am, Daniel Brown wrote:
> Even beyond the scope of what this small project will be, I was
> thinking
> (for once!) that it probably will not be too horribly difficult to
> incorporate some code into PHP itself that would allow functions such
> as
> text2wav(), et al.  After all, the Festival TTS engine itself, which
> we'll
> be using as a foundation (and first floor even), is already written in
> C++,
> so hopefully back-porting it to PHP's native C language core won't
> prove to
> be too much of a nightmare.

Ah!

You're thinking you need to rewrite it in C to make it tie in to PHP.

Not so, I think.

You simply need to write "wrapper" functions in C that let PHP talk to
the compiled library which can just be straight from its C++ source --
Or *any* language that builds a compiled library.

PHP is just a "glue" that is written in C (not C++) to tie together
the various extensions that can be written in ANY language.

In theory, you could take a COBOL program and make a PHP extension out
of it, without re-writing the dang thing in C.

At least, that's how I understand it, having stumbled my way through
writing one silly extension myself...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Parsing CSV files

2007-04-27 Thread Tijnema !

On 4/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:

On Fri, April 27, 2007 1:58 pm, Tijnema ! wrote:
> There are more interesting things to do than updating documentation ;)
>
> I was wanting to extend the CURLOPT_ constants, but it seemed that
> nobody had interest in that, so i didn't ...

I believe the issue here is that having the constants with no body of
code to do something useful when the constants would just be
counter-productive...


Well, actually it was quite simple, adding the constants and adding
them to the function that passes it to the curl library and it would
work. So it has some extra functionality. So, you might never use
them, but somebody else might.

Tijnema


--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?




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



Re: [PHP] Another SYSTEM Function Question

2007-04-27 Thread Nathaniel Hall

Richard Lynch wrote:

On Thu, April 26, 2007 3:27 pm, Nathaniel Hall wrote:
  

The command I am running is system("arp " . $_SERVER['REMOTE_ADDR'] .



See also:
http://php.net/exec

Thanks to all for you help.  I apparently missed that exec was the proper
function to use for what I am wanting.  It all works fine now. :)

--
Nathaniel Hall, GSEC GCFW GCIA GCIH GCFA

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



Re: [PHP] Server-Side Speech --- New Project Discussion (PHP/C++ Developers?)

2007-04-27 Thread Richard Lynch
On Thu, April 26, 2007 2:53 pm, Daniel Brown wrote:
> As a result of an ongoing thread, I am launching a project that
> should
> allow users on shared hosting accounts and other restricted Unix-like
> hosting systems to utilize text-to-speech synthesis, primarily the
> Festival
> TTS engine.  The goal of the project will be to create a miniature,
> portable
> TTS system that a user can upload to their hosting account and use
> right
> away, without the need to compile the system or have access to
> privileged-only libraries.
>
> The ultimate aim here is for a user to be able to do the
> following, from
> start to finish:
>
> 1.) Determine a need for text-to-speech synthesis on the web.
> 2.) Locate this project.
> 3.) Download the compiled binaries and PHP source code.
> 4.) Upload the binaries and code to their existing hosting
> account.
> 5.) Set permissions on directories and configure the system as
> necessary.
> 6.) Integrate the system into their existing architecture and
> design.
> 7.) Use the system.
>
> I may set up a small mailing list for the project, as well as a
> forum to
> use with development, bugtracking, et cetera.  I'm not entirely sure
> whether
> I will be hosting the entire project on one of my servers, or if I
> will use
> SourceForge for some or all of the hosting.
>
> Anyone who's interested in jumping on, let me know.  We may not
> create a
> PHP-based TTS system, but we can do the next best thing.  Besides,
> everything has to start somewhere!

I was thinking more along the lines of a PECL extension...

That comes with some implicit things like:
  hosted at pecl.php.net
  built into PHP source using 'pecl'
  webhosts would install it, or not, as they see fit

It probably wouldn't really help out the person whose host refused to
install this extension in the first place.

But it would increase the number of webhosts who just provide it so
the average developer wouldn't need to dink around trying to install
binaries that might not even be allowed to execute.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Changing Session Timeout

2007-04-27 Thread Aaron Axelsen
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
 
Everything i've read in the documentation states to call session_start
after you have changed your necessary settings.  Do you have a working
example using session cookies I can compare this with?

Richard Lynch wrote:
> On Fri, April 27, 2007 1:37 pm, tedd wrote:
>> At 12:26 PM -0500 4/27/07, Aaron Axelsen wrote:
>>> With the following set, its still timing me out.  I logged in
>>> and waited about 40 minutes, and it was timed out by then. This
>>> is getting very confusing, what else could it be that is
>>> causing this to not work?
>>>
>>> session_name('myapp');
>>>
>>> $mytimeout = 180 * 60; // minutes * 60
>>>
>>> session_set_cookie_params($mytimeout);
>>>
>>> $sessdir = ini_get('session.save_path')."/myapp"; if
>>> (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
>>> ini_set('session.save_path', $sessdir);
>>>
>>> // New Attempt session_cache_limiter();
>>> session_cache_expire($mytimeout / 60);
>>> ini_set('session.gc_maxlifetime', $mytimeout);
>>> #ini_set('session.gc_probability',1);
>>> #ini_set('session.gc_divisor',1);
>>>
>>> session_start();
>>>
>> The above is not the order of your code, is it?
>>
>> If so, move session_start(); to the top, namely the first line of
>>  code.
>
>
> I don't think you want to do that...
>
> You want all those settings to take effect BEFORE you actually
> start the session which sends out the headers.
>

- --
Aaron Axelsen

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 
iD8DBQFGMlEWuucONIvD0AMRAp+4AKDJK9D06s+yWt4tkHw4dUhZvz0VngCgjiA3
x117Mf7dwR3VIpvuhZFxTgg=
=jOud
-END PGP SIGNATURE-

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



Re: [PHP] Another SYSTEM Function Question

2007-04-27 Thread Richard Lynch
On Thu, April 26, 2007 3:27 pm, Nathaniel Hall wrote:
> The command I am running is system("arp " . $_SERVER['REMOTE_ADDR'] .

See also:
http://php.net/exec

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Parsing CSV files

2007-04-27 Thread Richard Lynch
On Fri, April 27, 2007 1:58 pm, Tijnema ! wrote:
> There are more interesting things to do than updating documentation ;)
>
> I was wanting to extend the CURLOPT_ constants, but it seemed that
> nobody had interest in that, so i didn't ...

I believe the issue here is that having the constants with no body of
code to do something useful when the constants would just be
counter-productive...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Parsing CSV files

2007-04-27 Thread Richard Lynch
On Fri, April 27, 2007 9:45 am, Daniel Brown wrote:
> Maybe the PHP site itself should be Wiki-fied so that we could
> just go
> in ourselves and fix the errors.  I don't see that happening any time
> soon
> though

Gah.

php.net as a Wikki would be a nightmare...

If you *really* want to fix the errors, grab the docs source from CVS
and start figuring out what needs doing and submit patches.

The function lookup routine has a whole mess of "special case"
hard-coded lookups that happen before the usual exact match on a
function name lookup.

I dunno why some of those do the things they do, but if you get a
"weird" re-direct (like CSV -> gzeof) then using the search box in the
navbar with "online documentation" instead of "function list" will
almost always get you what you really wanted.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Need to POST multiple values with single name

2007-04-27 Thread Daniel Brown

   For that matter, you don't even need the keys

\n";
   }
   exit;
}
?>

One
Two
Three
Four
Five
Six
Seven
Eight
Nine
Ten




On 4/27/07, Richard Lynch <[EMAIL PROTECTED]> wrote:


On Fri, April 27, 2007 3:02 am, [EMAIL PROTECTED] wrote:
> Need to POST multiple values with single name.
>
> Ex.
> -55751342416306771991025074398
> Content-Disposition: form-data; name="licenses"
>
> lic1
> -55751342416306771991025074398
> Content-Disposition: form-data; name="licenses"
>
> lic2
>
>
> Function http_post_fields() cannot be used due to an _associative_
> array
> of POST values.

PHP will cheefully accept POST data with arrays with keys.





var_dump($_POST['foo']);

--
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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





--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


Re: [PHP] Parsing CSV files

2007-04-27 Thread Richard Lynch
On Thu, April 26, 2007 3:39 pm, Todd Cary wrote:
> Is there a function that can parse a comma delimited file into an
> array?

fgetcsv should work...



-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Changing Session Timeout

2007-04-27 Thread Richard Lynch
On Fri, April 27, 2007 1:37 pm, tedd wrote:
> At 12:26 PM -0500 4/27/07, Aaron Axelsen wrote:
>>With the following set, its still timing me out.  I logged in and
>>waited about 40 minutes, and it was timed out by then.  This is
>>getting very confusing, what else could it be that is causing this to
>>not work?
>>
>>session_name('myapp');
>>
>>$mytimeout = 180 * 60; // minutes * 60
>>
>>session_set_cookie_params($mytimeout);
>>
>>$sessdir = ini_get('session.save_path')."/myapp";
>>if (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
>>ini_set('session.save_path', $sessdir);
>>
>>// New Attempt
>>session_cache_limiter();
>>session_cache_expire($mytimeout / 60);
>>ini_set('session.gc_maxlifetime', $mytimeout);
>>#ini_set('session.gc_probability',1);
>>#ini_set('session.gc_divisor',1);
>>
>>session_start();
>>
>
> The above is not the order of your code, is it?
>
> If so, move session_start(); to the top, namely the first line of
> code.


I don't think you want to do that...

You want all those settings to take effect BEFORE you actually start
the session which sends out the headers.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Re: posting variables to parent frame

2007-04-27 Thread Justin Frim

Tijnema ! wrote:

[snip]
Should you create a header that is 1600 width, and resize it down
until 800 when a user with 800x600 visits? and all images used at
borders and corners? That's the biggest problem in dynamic layouts.
Atm, i repeat small images around the borders, but that's a real pain
in the ass. For now, i mostly design static pages, that are best
viewable with 1024x768, and resolutions higher then that have those
damn borders... If sombody has a better way, i'd like to hear :)


Oh yeah, forgot to mention.  I usually headers and footers outside of my 
"centered expandable block", so they stretch the whole width of the 
screen even if the centered block doesn't.


Again, using the hated "tables for layout" approach, I create a table 
with width=100%, and as many columns as I need for the header or footer 
content.  Then I use a tiled background image in the table for making 
the prettyness stretching across the width page.


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



Re: [PHP] Changing Session Timeout

2007-04-27 Thread Richard Lynch
On Fri, April 27, 2007 12:26 pm, Aaron Axelsen wrote:
> With the following set, its still timing me out.  I logged in and
> waited about 40 minutes, and it was timed out by then.  This is
> getting very confusing, what else could it be that is causing this to
> not work?

The usual suspcect is that your server clock and your desktop clock
may not agree on what time it is.

The problem with relying on Cookie time out is that it relies on the
user's PC clock to be correctly set.

Most PC clocks are not, in fact, correct.

Many are very very very incorrect.

Of course, your server clock could also be "off" as well -- I spent
days tracking down a bug like this that turned out to be caused by a
server clock being off by TEN MINUTES from reality.  Apparently my
boss had never heard of NTP. :-v

Because of this, you're better off to use session cookies or cookies
with super long expiration times, and then micro-manage the timing of
the expiration within PHP.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Re: posting variables to parent frame

2007-04-27 Thread Justin Frim

Tijnema ! wrote:

I guess the same can be done with ... But the main problem is
that there's no real standard for resolution. I see people having
resolution set at 800x600, and 1600x200, how is it ever possible to
make a page look good at both? Resizing it to 1600x1200 would give you
an enormous page, while keeping it at 800 width makes it so damn
small. So lets say you re size it to 1024 width, then you still have
such damn borders on both sides. That doesn't look nice either. And
how would you do deal with pages that have a layout based on pictures?
Should you create a header that is 1600 width, and resize it down
until 800 when a user with 800x600 visits? and all images used at
borders and corners? That's the biggest problem in dynamic layouts.
Atm, i repeat small images around the borders, but that's a real pain
in the ass. For now, i mostly design static pages, that are best
viewable with 1024x768, and resolutions higher then that have those
damn borders... If sombody has a better way, i'd like to hear :)

Tijnema


I posted something in response to Ed by the damn list filters blocked it 
as O.T.


Anyhow, essentially I said my layout conventions will expand as much as 
necessary as the user expands their window size.  Once there is no more 
text being wrapped, no further expansion is possible.  (And it wouldn't 
make sense to do so anyhow, even if it were possible.)  At that point, 
it just centers the *block* of page content, while still keeping the 
actual text left-justified within that block.


I think that's a hell of a lot better than site designs fixed for a 
width of 800px or 1024px or whatever, because if more space becomes 
available (like say 1600px), they still wrap the text within a tiny 
tunnel-vision 800px (or whatever) fixed-width block.  That's unnecessary 
and gross.


An intuitive site designer should be able to identify what parts of 
their layout _can_ expand without looking stupid, and what parts have to 
stay at a specific size.  Then design it accordingly so those sections 
that can expand, will expand (given the opportunity to do so... ie. 
being viewed in a large window.)


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



Re: [PHP] explode in mysql query

2007-04-27 Thread Richard Lynch
On Fri, April 27, 2007 1:33 am, Sebe wrote:
> i have a mysql column that looks like this:
>
> groups
> ---
> 12,7,10,6,14,11,2
>
> is it possible to select the row if `groups` contain 7 or 14?
> trying to avoid running two queries and running explode() on it.
>
> i don't remember but i thought there was a way to use explode() on
> something like this within a single query.

It's a MySQL question, but I suspect that the REGEXP operator in MySQL
would let you find these with something like:

groups REGEXP '\\b7\\b' or groups REGEXP '\\b14\\b'

The \\b being a word boundary, if I remember correctly...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Need to POST multiple values with single name

2007-04-27 Thread Richard Lynch
On Fri, April 27, 2007 3:02 am, [EMAIL PROTECTED] wrote:
> Need to POST multiple values with single name.
>
> Ex.
> -55751342416306771991025074398
> Content-Disposition: form-data; name="licenses"
>
> lic1
> -55751342416306771991025074398
> Content-Disposition: form-data; name="licenses"
>
> lic2
>
>
> Function http_post_fields() cannot be used due to an _associative_
> array
> of POST values.

PHP will cheefully accept POST data with arrays with keys.





var_dump($_POST['foo']);

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



Re: [PHP] Parsing CSV files

2007-04-27 Thread Tijnema !

On 4/27/07, Stut <[EMAIL PROTECTED]> wrote:

Tijnema ! wrote:
> On 4/27/07, Stut <[EMAIL PROTECTED]> wrote:
>> Tijnema ! wrote:
>> > On 4/27/07, Stut <[EMAIL PROTECTED]> wrote:
>> >> Daniel Brown wrote:
>> >> >Maybe the PHP site itself should be Wiki-fied so that we could
>> >> just go
>> >> > in ourselves and fix the errors.  I don't see that happening any
>> >> time soon
>> >> > though
>> >>
>> >> There's nothing stopping you submitting patches to the documentation
>> >> mailing list. As far as I know they welcome decent patches with open
>> >> arms. A wiki would (IMHO) lead to a general and rapid degradation
>> in the
>> >> quality of the documentation.
>> >>
>> >> -Stut
>> >
>> > If you can point me where to find the documentation on the CVS server,
>> > i might write a patch :)
>>
>> http://doc.php.net/php/dochowto/
>>
>> -Stut
>
> Whoops, didn't realise the doc system was so huge :) I thought it was
> just a few (1000 max) lines
>
> But well, it's a lot more, so somebody with a little bit more
> experience could better do it :)

Note that you don't have to create a "patch file". If you want to
contribute to the documentation, join that mailing list and start
submitting changes. If you do it often enough I'm sure they'll manage to
convince you that setting yourself up to submit patch files is worthwhile.

-Stut


There are more interesting things to do than updating documentation ;)

I was wanting to extend the CURLOPT_ constants, but it seemed that
nobody had interest in that, so i didn't ...

Tijnema

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



Re: [PHP] No mail() function

2007-04-27 Thread Tijnema !

On 4/27/07, Stut <[EMAIL PROTECTED]> wrote:

Miles Thompson wrote:
> Does anyone have any ideas?
>
> PHP 5.2 was compiled from source, the mail path is set to /usr/sbin/postfix
> in php.ini, and Apache has been restarted. The mail path shows up in
> phpinfo().
>
> A  trivial PHP script, written to see if mail could be sent from PHP,
> returns this error:
>
> *Fatal error*: Call to undefined function mail() in *
> /var/www/junk/testmail.php* on line *9
>
> *The docs say that mail is a core function, like so:
> "There is no installation needed to use these functions; they are part
> of the PHP core"
>
> It's a UBUNTU server, so when compiling I sudo'ed and configure / make /
> checkinstall (instead of make install) worked fine.
>
> However, in phpinfo() under the "standard"  heading there is no :
> Path to sendmail /usr/sbin/sendmail -t -i
> like there is on our production server.
>
> Suggestions and advice will be welcomed.

When PHP is compiled on UNIX it looks for the sendmail binary. If it
can't find it the mail function will not be included. That's probably
what happened here. I suggest you run configure again and check the
output for mail-related issues. If you need further assistance, email
the install list.

-Stut



I had exactly the same problem, it seems that when compiling the
source, PHP looks in a php.ini file, and there the path to sendmail
needs to be correct.

Tijnema

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



Re: [PHP] No mail() function

2007-04-27 Thread Stut

Miles Thompson wrote:

Does anyone have any ideas?

PHP 5.2 was compiled from source, the mail path is set to /usr/sbin/postfix
in php.ini, and Apache has been restarted. The mail path shows up in
phpinfo().

A  trivial PHP script, written to see if mail could be sent from PHP,
returns this error:

*Fatal error*: Call to undefined function mail() in *
/var/www/junk/testmail.php* on line *9

*The docs say that mail is a core function, like so:
"There is no installation needed to use these functions; they are part
of the PHP core"

It's a UBUNTU server, so when compiling I sudo'ed and configure / make /
checkinstall (instead of make install) worked fine.

However, in phpinfo() under the "standard"  heading there is no :
Path to sendmail /usr/sbin/sendmail -t -i
like there is on our production server.

Suggestions and advice will be welcomed.


When PHP is compiled on UNIX it looks for the sendmail binary. If it 
can't find it the mail function will not be included. That's probably 
what happened here. I suggest you run configure again and check the 
output for mail-related issues. If you need further assistance, email 
the install list.


-Stut

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



Re: [PHP] Changing Session Timeout

2007-04-27 Thread Tijnema !

On 4/27/07, tedd <[EMAIL PROTECTED]> wrote:

At 12:26 PM -0500 4/27/07, Aaron Axelsen wrote:
>With the following set, its still timing me out.  I logged in and
>waited about 40 minutes, and it was timed out by then.  This is
>getting very confusing, what else could it be that is causing this to
>not work?
>
>session_name('myapp');
>
>$mytimeout = 180 * 60; // minutes * 60
>
>session_set_cookie_params($mytimeout);
>
>$sessdir = ini_get('session.save_path')."/myapp";
>if (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
>ini_set('session.save_path', $sessdir);
>
>// New Attempt
>session_cache_limiter();
>session_cache_expire($mytimeout / 60);
>ini_set('session.gc_maxlifetime', $mytimeout);
>#ini_set('session.gc_probability',1);
>#ini_set('session.gc_divisor',1);
>
>session_start();
>

The above is not the order of your code, is it?

If so, move session_start(); to the top, namely the first line of code.

Cheers,

tedd


Uhm, ini_set would come before session_start right? when session start
is executed, then the ini value would be read right?

the order is probably the problem here..

Tijnema

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



Re: [PHP] Changing Session Timeout

2007-04-27 Thread tedd

At 12:26 PM -0500 4/27/07, Aaron Axelsen wrote:

With the following set, its still timing me out.  I logged in and
waited about 40 minutes, and it was timed out by then.  This is
getting very confusing, what else could it be that is causing this to
not work?

session_name('myapp');

$mytimeout = 180 * 60; // minutes * 60

session_set_cookie_params($mytimeout);

$sessdir = ini_get('session.save_path')."/myapp";
if (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
ini_set('session.save_path', $sessdir);

// New Attempt
session_cache_limiter();
session_cache_expire($mytimeout / 60);
ini_set('session.gc_maxlifetime', $mytimeout);
#ini_set('session.gc_probability',1);
#ini_set('session.gc_divisor',1);

session_start();



The above is not the order of your code, is it?

If so, move session_start(); to the top, namely the first line of code.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



[PHP] No mail() function

2007-04-27 Thread Miles Thompson

Does anyone have any ideas?

PHP 5.2 was compiled from source, the mail path is set to /usr/sbin/postfix
in php.ini, and Apache has been restarted. The mail path shows up in
phpinfo().

A  trivial PHP script, written to see if mail could be sent from PHP,
returns this error:

*Fatal error*: Call to undefined function mail() in *
/var/www/junk/testmail.php* on line *9

*The docs say that mail is a core function, like so:
"There is no installation needed to use these functions; they are part
of the PHP core"

It's a UBUNTU server, so when compiling I sudo'ed and configure / make /
checkinstall (instead of make install) worked fine.

However, in phpinfo() under the "standard"  heading there is no :
Path to sendmail /usr/sbin/sendmail -t -i
like there is on our production server.

Suggestions and advice will be welcomed.

Regards - Miles Thompson


[PHP] Re: Make eclipse-php recognise custom extension as php ?

2007-04-27 Thread Roberto Mansfield
Don Don wrote:
> Hi all, i've changed my server's apache config to recognize my custom
> extension for php files. And all my development filenames now come
> with this new extension.
> 
> However my IDE (Php Eclipse) will not recognise this new extension as
> a php file, even though it opens it up but it looses all the php
> features (e.g. syntax highlighting, flags, errors, warnning,
> intellisence etc)
> 
> How can i make php-eclipse recognise my new custom extension as a php
> file ?

I believe what you want to do is setup a file association in your
preferences. Give this a try:

Open Window->Preferences.

Under General->Editors->File Associations, add your new file extension.
Highlight the new extension and use the Associated Editors box below to
tie the extension to the PHP editor.

Good luck,
Roberto

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



Re: [PHP] Server-Side Speech --- New Project Discussion (PHP/C++ Developers?)

2007-04-27 Thread Daniel Brown

   Okay, anyone interested in joining the project can subscribe to the
official mailing list (sounds fancy!) set up for the project at:
   http://isawit.com/mailman/listinfo/php-vox

   I'm looking forward to getting into discussions and debates, and getting
the project off the ground.



On 4/27/07, Tijnema ! <[EMAIL PROTECTED]> wrote:


On 4/27/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
>Even beyond the scope of what this small project will be, I was
thinking
> (for once!) that it probably will not be too horribly difficult to
> incorporate some code into PHP itself that would allow functions such as
> text2wav(), et al.  After all, the Festival TTS engine itself, which
we'll
> be using as a foundation (and first floor even), is already written in
C++,
> so hopefully back-porting it to PHP's native C language core won't prove
to
> be too much of a nightmare.
>
>Just a thought

Is it 100% C++?

that could be a serious problem, AFAIK, unless we are creating a
shared library of course, because from that point, the language
doesn't matter (not sure about static, but i believe it is the same)

And what about other TTS engines? FreeTTS? Festival-lite?

Tijnema
>
>
> On 4/27/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
> >
> >
> > That's what I'm going to try to do, Tedd.  I'll post updates
> > throughout the day to include the new mailing list address and such
(so
> > we're not flooding the PHP list with stuff about a specific project)
and
> > other relevant information.
> >
> > On 4/27/07, tedd <[EMAIL PROTECTED]> wrote:
> > >
> > > At 3:53 PM -0400 4/26/07, Daniel Brown wrote:
> > > >Anyone who's interested in jumping on, let me know.  We may not
> > > create a
> > > >PHP-based TTS system, but we can do the next best thing.  Besides,
> > > >everything has to start somewhere!
> > >
> > > Daniel:
> > >
> > > But of course, you can count me in -- after all, I started this
thread.
> > >
> > > If you can get the project to the point were I can upload something
> > > to my site that can generate a sound file from text, I'll take it
> > > from there.
> > >
> > > The point of all this is to provide a simple way for "civilians" to
> > > have their sites speak.
> > >
> > > I certainly can do all the documentation and design/write the
> > > software that will make it easy for the end user to use -- that's
not
> > > a problem. The problem is having the text-to-sound routines being
> > > autonomous and free from requiring the user to seek assistance from
> > > their host for installation.
> > >
> > > If you can get it to that, this project is doable.
> > >
> > > Cheers,
> > >
> > > tedd
> > >
> > > --
> > > ---
> > > http://sperling.com  http://ancientstones.com
http://earthstones.com
> > >
> >
> >
> >
> > --
> > Daniel P. Brown
> > [office] (570-) 587-7080 Ext. 272
> > [mobile] (570-) 766-8107
> >
>
>
>
> --
> Daniel P. Brown
> [office] (570-) 587-7080 Ext. 272
> [mobile] (570-) 766-8107
>





--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


Re: [PHP] Changing Session Timeout

2007-04-27 Thread Aaron Axelsen
With the following set, its still timing me out.  I logged in and
waited about 40 minutes, and it was timed out by then.  This is
getting very confusing, what else could it be that is causing this to
not work?

session_name('myapp');

$mytimeout = 180 * 60; // minutes * 60

session_set_cookie_params($mytimeout);

$sessdir = ini_get('session.save_path')."/myapp";
if (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
ini_set('session.save_path', $sessdir);

// New Attempt
session_cache_limiter();
session_cache_expire($mytimeout / 60);
ini_set('session.gc_maxlifetime', $mytimeout);
#ini_set('session.gc_probability',1);
#ini_set('session.gc_divisor',1);

session_start();


Tijnema ! wrote:
> On 4/27/07, Aaron Axelsen <[EMAIL PROTECTED]> wrote:
>> I now have the following settings:
>>
>> session_name('myapp');
>> $mytimeout = 180 * 60; // minutes * 60
>>
>> session_set_cookie_params($mytimeout);
>>
>> $sessdir = ini_get('session.save_path')."/myapp";
>> if (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
>> ini_set('session.save_path', $sessdir);
>>
>> // New Attempt
>> session_cache_limiter();
>> session_cache_expire($mytimeout / 60);
>> ini_set('session.gc_maxlifetime', $mytimeout / 60);
>> #ini_set('session.gc_probability',1);
>> #ini_set('session.gc_divisor',1);
>>
>> session_start();
>>
>> I logged in and then left the computer untouched for an hour.  When I
>> came back the session was timed out, and I was required to login.
>> Something still isn't working right.  Any ideas?  I have checked the
>> settings using phpinfo() and confirmed that the values are in fact
>> being
>> set by the above commands.
>>
>> -- Aaron
>
> My mistake, gc_maxlifetime is in seconds, i meant to say that, but i
> said it was in minutes :)
>
> if you change this:
> ini_set('session.gc_maxlifetime', $mytimeout / 60);
> back to
> ini_set('session.gc_maxlifetime', $mytimeout);
>
> It will work i guess :)
>
> Tijnema
>>
>>
>> Tijnema ! wrote:
>> > On 4/27/07, Aaron Axelsen <[EMAIL PROTECTED]> wrote:
>> >> I am trying to change my session timeout to 180 minutes, and
>> everything
>> >> ive tried has not worked.  Does anyone have any idea why this isn't
>> >> working properly?
>> >>
>> >> I currently am trying to set the following:
>> >>
>> >> session_name('myapp');
>> >>
>> >> $mytimeout = 180 * 60; // minutes * 60
>> >>
>> >> session_set_cookie_params($mytimeout);
>> >>
>> >> $sessdir = ini_get('session.save_path')."/myapp";
>> >> if (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
>> >> ini_set('session.save_path', $sessdir);
>> >>
>> >> session_cache_limiter();
>> >> session_cache_expire($mytimeout);
>> >> ini_set('session.gc_maxlifetime', $mytimeout);
>> >> #ini_set('session.gc_probability',1);
>> >> #ini_set('session.gc_divisor',1);
>> >>
>> >> session_start();
>> >>
>> >>
>> >> --
>> >> Aaron Axelsen
>> >> [EMAIL PROTECTED]
>> >>
>> >
>> > session_set_cookie_params requires the number given in seconds,
>> which
>> > you did correct. But session_cache_expire requires the number
>> given in
>> > minutes. and session.gc_maxlifetime is in minutes again. So that is
>> > correct too.
>> >
>> > you could try replace this:
>> > session_cache_expire($mytimeout);
>> > with:
>> > session_cache_expire($mytimeout / 60);
>> >
>> > That should fix it, if not, just come back, but then tell us what
>> > exactly is wrong, does the session timeout too early? does the
>> session
>> > timeout too late? does the session timeout never?
>> >
>> > Tijnema
>> >
>>
>> --
>> Aaron Axelsen
>> [EMAIL PROTECTED]
>>
>> Great hosting, low prices.  Modevia Web Services LLC --
>> http://www.modevia.com
>>
>>
>

-- 
Aaron Axelsen
Technical Director
Modevia Web Services LLC

1-866-451-9198 x802
[EMAIL PROTECTED]
www.modevia.com

-- 
Aaron Axelsen
[EMAIL PROTECTED]

Great hosting, low prices.  Modevia Web Services LLC -- http://www.modevia.com

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



[PHP] Re: PHP & Text Messaging

2007-04-27 Thread Michelle Konzack
Am 2007-04-25 09:28:54, schrieb tedd:
> That's a good idea. But, do you create an entry for every someone or 
> is there a way to use suffixes or something?

The "Authorities for Regulation of Telecommunication" can provide
you with a list of national prefixes since they are open.

If you have customers with a portable cell-phone-number you must
add them manualy to your list.

Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSN LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] Changing Session Timeout

2007-04-27 Thread Aaron Axelsen
I now have the following settings:

session_name('myapp');
$mytimeout = 180 * 60; // minutes * 60

session_set_cookie_params($mytimeout);

$sessdir = ini_get('session.save_path')."/myapp";
if (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
ini_set('session.save_path', $sessdir);

// New Attempt
session_cache_limiter();
session_cache_expire($mytimeout / 60);
ini_set('session.gc_maxlifetime', $mytimeout / 60);
#ini_set('session.gc_probability',1);
#ini_set('session.gc_divisor',1);

session_start();

I logged in and then left the computer untouched for an hour.  When I
came back the session was timed out, and I was required to login. 
Something still isn't working right.  Any ideas?  I have checked the
settings using phpinfo() and confirmed that the values are in fact being
set by the above commands.

-- Aaron


Tijnema ! wrote:
> On 4/27/07, Aaron Axelsen <[EMAIL PROTECTED]> wrote:
>> I am trying to change my session timeout to 180 minutes, and everything
>> ive tried has not worked.  Does anyone have any idea why this isn't
>> working properly?
>>
>> I currently am trying to set the following:
>>
>> session_name('myapp');
>>
>> $mytimeout = 180 * 60; // minutes * 60
>>
>> session_set_cookie_params($mytimeout);
>>
>> $sessdir = ini_get('session.save_path')."/myapp";
>> if (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
>> ini_set('session.save_path', $sessdir);
>>
>> session_cache_limiter();
>> session_cache_expire($mytimeout);
>> ini_set('session.gc_maxlifetime', $mytimeout);
>> #ini_set('session.gc_probability',1);
>> #ini_set('session.gc_divisor',1);
>>
>> session_start();
>>
>>
>> -- 
>> Aaron Axelsen
>> [EMAIL PROTECTED]
>>
>
> session_set_cookie_params requires the number given in seconds, which
> you did correct. But session_cache_expire requires the number given in
> minutes. and session.gc_maxlifetime is in minutes again. So that is
> correct too.
>
> you could try replace this:
> session_cache_expire($mytimeout);
> with:
> session_cache_expire($mytimeout / 60);
>
> That should fix it, if not, just come back, but then tell us what
> exactly is wrong, does the session timeout too early? does the session
> timeout too late? does the session timeout never?
>
> Tijnema
>

-- 
Aaron Axelsen
[EMAIL PROTECTED]

Great hosting, low prices.  Modevia Web Services LLC -- http://www.modevia.com

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



Re: [PHP] Parsing CSV files

2007-04-27 Thread Stut

Tijnema ! wrote:

On 4/27/07, Stut <[EMAIL PROTECTED]> wrote:

Tijnema ! wrote:
> On 4/27/07, Stut <[EMAIL PROTECTED]> wrote:
>> Daniel Brown wrote:
>> >Maybe the PHP site itself should be Wiki-fied so that we could
>> just go
>> > in ourselves and fix the errors.  I don't see that happening any
>> time soon
>> > though
>>
>> There's nothing stopping you submitting patches to the documentation
>> mailing list. As far as I know they welcome decent patches with open
>> arms. A wiki would (IMHO) lead to a general and rapid degradation 
in the

>> quality of the documentation.
>>
>> -Stut
>
> If you can point me where to find the documentation on the CVS server,
> i might write a patch :)

http://doc.php.net/php/dochowto/

-Stut


Whoops, didn't realise the doc system was so huge :) I thought it was
just a few (1000 max) lines

But well, it's a lot more, so somebody with a little bit more
experience could better do it :)


Note that you don't have to create a "patch file". If you want to 
contribute to the documentation, join that mailing list and start 
submitting changes. If you do it often enough I'm sure they'll manage to 
convince you that setting yourself up to submit patch files is worthwhile.


-Stut

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



RE: [PHP] Opening file

2007-04-27 Thread Jay Blanchard
[snip]
I have been trying to make "printer friendly version" feature for a
web site
[/snip]

Use CSS to control what prints.
http://www.google.com/search?hl=en&q=printing+with+CSS

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



Re: [PHP] Parsing CSV files

2007-04-27 Thread Tijnema !

On 4/27/07, Stut <[EMAIL PROTECTED]> wrote:

Tijnema ! wrote:
> On 4/27/07, Stut <[EMAIL PROTECTED]> wrote:
>> Daniel Brown wrote:
>> >Maybe the PHP site itself should be Wiki-fied so that we could
>> just go
>> > in ourselves and fix the errors.  I don't see that happening any
>> time soon
>> > though
>>
>> There's nothing stopping you submitting patches to the documentation
>> mailing list. As far as I know they welcome decent patches with open
>> arms. A wiki would (IMHO) lead to a general and rapid degradation in the
>> quality of the documentation.
>>
>> -Stut
>
> If you can point me where to find the documentation on the CVS server,
> i might write a patch :)

http://doc.php.net/php/dochowto/

-Stut


Whoops, didn't realise the doc system was so huge :) I thought it was
just a few (1000 max) lines

But well, it's a lot more, so somebody with a little bit more
experience could better do it :)

Tijnema




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



Re: [PHP] Changing Session Timeout

2007-04-27 Thread Tijnema !

On 4/27/07, Aaron Axelsen <[EMAIL PROTECTED]> wrote:

I now have the following settings:

session_name('myapp');
$mytimeout = 180 * 60; // minutes * 60

session_set_cookie_params($mytimeout);

$sessdir = ini_get('session.save_path')."/myapp";
if (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
ini_set('session.save_path', $sessdir);

// New Attempt
session_cache_limiter();
session_cache_expire($mytimeout / 60);
ini_set('session.gc_maxlifetime', $mytimeout / 60);
#ini_set('session.gc_probability',1);
#ini_set('session.gc_divisor',1);

session_start();

I logged in and then left the computer untouched for an hour.  When I
came back the session was timed out, and I was required to login.
Something still isn't working right.  Any ideas?  I have checked the
settings using phpinfo() and confirmed that the values are in fact being
set by the above commands.

-- Aaron


My mistake, gc_maxlifetime is in seconds, i meant to say that, but i
said it was in minutes :)

if you change this:
ini_set('session.gc_maxlifetime', $mytimeout / 60);
back to
ini_set('session.gc_maxlifetime', $mytimeout);

It will work i guess :)

Tijnema



Tijnema ! wrote:
> On 4/27/07, Aaron Axelsen <[EMAIL PROTECTED]> wrote:
>> I am trying to change my session timeout to 180 minutes, and everything
>> ive tried has not worked.  Does anyone have any idea why this isn't
>> working properly?
>>
>> I currently am trying to set the following:
>>
>> session_name('myapp');
>>
>> $mytimeout = 180 * 60; // minutes * 60
>>
>> session_set_cookie_params($mytimeout);
>>
>> $sessdir = ini_get('session.save_path')."/myapp";
>> if (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
>> ini_set('session.save_path', $sessdir);
>>
>> session_cache_limiter();
>> session_cache_expire($mytimeout);
>> ini_set('session.gc_maxlifetime', $mytimeout);
>> #ini_set('session.gc_probability',1);
>> #ini_set('session.gc_divisor',1);
>>
>> session_start();
>>
>>
>> --
>> Aaron Axelsen
>> [EMAIL PROTECTED]
>>
>
> session_set_cookie_params requires the number given in seconds, which
> you did correct. But session_cache_expire requires the number given in
> minutes. and session.gc_maxlifetime is in minutes again. So that is
> correct too.
>
> you could try replace this:
> session_cache_expire($mytimeout);
> with:
> session_cache_expire($mytimeout / 60);
>
> That should fix it, if not, just come back, but then tell us what
> exactly is wrong, does the session timeout too early? does the session
> timeout too late? does the session timeout never?
>
> Tijnema
>

--
Aaron Axelsen
[EMAIL PROTECTED]

Great hosting, low prices.  Modevia Web Services LLC -- http://www.modevia.com




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



Re: [PHP] Server-Side Speech --- New Project Discussion (PHP/C++ Developers?)

2007-04-27 Thread Tijnema !

On 4/27/07, Daniel Brown <[EMAIL PROTECTED]> wrote:

   Even beyond the scope of what this small project will be, I was thinking
(for once!) that it probably will not be too horribly difficult to
incorporate some code into PHP itself that would allow functions such as
text2wav(), et al.  After all, the Festival TTS engine itself, which we'll
be using as a foundation (and first floor even), is already written in C++,
so hopefully back-porting it to PHP's native C language core won't prove to
be too much of a nightmare.

   Just a thought


Is it 100% C++?

that could be a serious problem, AFAIK, unless we are creating a
shared library of course, because from that point, the language
doesn't matter (not sure about static, but i believe it is the same)

And what about other TTS engines? FreeTTS? Festival-lite?

Tijnema



On 4/27/07, Daniel Brown <[EMAIL PROTECTED]> wrote:
>
>
> That's what I'm going to try to do, Tedd.  I'll post updates
> throughout the day to include the new mailing list address and such (so
> we're not flooding the PHP list with stuff about a specific project) and
> other relevant information.
>
> On 4/27/07, tedd <[EMAIL PROTECTED]> wrote:
> >
> > At 3:53 PM -0400 4/26/07, Daniel Brown wrote:
> > >Anyone who's interested in jumping on, let me know.  We may not
> > create a
> > >PHP-based TTS system, but we can do the next best thing.  Besides,
> > >everything has to start somewhere!
> >
> > Daniel:
> >
> > But of course, you can count me in -- after all, I started this thread.
> >
> > If you can get the project to the point were I can upload something
> > to my site that can generate a sound file from text, I'll take it
> > from there.
> >
> > The point of all this is to provide a simple way for "civilians" to
> > have their sites speak.
> >
> > I certainly can do all the documentation and design/write the
> > software that will make it easy for the end user to use -- that's not
> > a problem. The problem is having the text-to-sound routines being
> > autonomous and free from requiring the user to seek assistance from
> > their host for installation.
> >
> > If you can get it to that, this project is doable.
> >
> > Cheers,
> >
> > tedd
> >
> > --
> > ---
> > http://sperling.com  http://ancientstones.com  http://earthstones.com
> >
>
>
>
> --
> Daniel P. Brown
> [office] (570-) 587-7080 Ext. 272
> [mobile] (570-) 766-8107
>



--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107



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



Re: [PHP] Server-Side Speech --- New Project Discussion (PHP/C++ Developers?)

2007-04-27 Thread Daniel Brown

   Even beyond the scope of what this small project will be, I was thinking
(for once!) that it probably will not be too horribly difficult to
incorporate some code into PHP itself that would allow functions such as
text2wav(), et al.  After all, the Festival TTS engine itself, which we'll
be using as a foundation (and first floor even), is already written in C++,
so hopefully back-porting it to PHP's native C language core won't prove to
be too much of a nightmare.

   Just a thought


On 4/27/07, Daniel Brown <[EMAIL PROTECTED]> wrote:



That's what I'm going to try to do, Tedd.  I'll post updates
throughout the day to include the new mailing list address and such (so
we're not flooding the PHP list with stuff about a specific project) and
other relevant information.

On 4/27/07, tedd <[EMAIL PROTECTED]> wrote:
>
> At 3:53 PM -0400 4/26/07, Daniel Brown wrote:
> >Anyone who's interested in jumping on, let me know.  We may not
> create a
> >PHP-based TTS system, but we can do the next best thing.  Besides,
> >everything has to start somewhere!
>
> Daniel:
>
> But of course, you can count me in -- after all, I started this thread.
>
> If you can get the project to the point were I can upload something
> to my site that can generate a sound file from text, I'll take it
> from there.
>
> The point of all this is to provide a simple way for "civilians" to
> have their sites speak.
>
> I certainly can do all the documentation and design/write the
> software that will make it easy for the end user to use -- that's not
> a problem. The problem is having the text-to-sound routines being
> autonomous and free from requiring the user to seek assistance from
> their host for installation.
>
> If you can get it to that, this project is doable.
>
> Cheers,
>
> tedd
>
> --
> ---
> http://sperling.com  http://ancientstones.com  http://earthstones.com
>



--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107





--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


Re: [PHP] Parsing CSV files

2007-04-27 Thread Stut

Tijnema ! wrote:

On 4/27/07, Stut <[EMAIL PROTECTED]> wrote:

Daniel Brown wrote:
>Maybe the PHP site itself should be Wiki-fied so that we could 
just go
> in ourselves and fix the errors.  I don't see that happening any 
time soon

> though

There's nothing stopping you submitting patches to the documentation
mailing list. As far as I know they welcome decent patches with open
arms. A wiki would (IMHO) lead to a general and rapid degradation in the
quality of the documentation.

-Stut


If you can point me where to find the documentation on the CVS server,
i might write a patch :)


http://doc.php.net/php/dochowto/

-Stut

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



Re: [PHP] Parsing CSV files

2007-04-27 Thread Tijnema !

On 4/27/07, Stut <[EMAIL PROTECTED]> wrote:

Daniel Brown wrote:
>Maybe the PHP site itself should be Wiki-fied so that we could just go
> in ourselves and fix the errors.  I don't see that happening any time soon
> though

There's nothing stopping you submitting patches to the documentation
mailing list. As far as I know they welcome decent patches with open
arms. A wiki would (IMHO) lead to a general and rapid degradation in the
quality of the documentation.

-Stut


If you can point me where to find the documentation on the CVS server,
i might write a patch :)

Tijnema

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



Re: [PHP] Parsing CSV files

2007-04-27 Thread Daniel Brown

   Yeah, that's why I followed-up with saying, "I don't see that happening
any time soon though"

   Not only would you have unqualified people putting in bad (though not
intentionally wrong) information, there would always be the presence of
vandalism, as on any other Wiki.  The serious problem here, though, is that
it's a programming language, so severe havoc could definitely be wreaked.

On 4/27/07, Stut <[EMAIL PROTECTED]> wrote:


Daniel Brown wrote:
>Maybe the PHP site itself should be Wiki-fied so that we could just
go
> in ourselves and fix the errors.  I don't see that happening any time
soon
> though

There's nothing stopping you submitting patches to the documentation
mailing list. As far as I know they welcome decent patches with open
arms. A wiki would (IMHO) lead to a general and rapid degradation in the
quality of the documentation.

-Stut





--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


Re: [PHP] Parsing CSV files

2007-04-27 Thread Stut

Daniel Brown wrote:

   Maybe the PHP site itself should be Wiki-fied so that we could just go
in ourselves and fix the errors.  I don't see that happening any time soon
though


There's nothing stopping you submitting patches to the documentation 
mailing list. As far as I know they welcome decent patches with open 
arms. A wiki would (IMHO) lead to a general and rapid degradation in the 
quality of the documentation.


-Stut

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



Re: [PHP] Parsing CSV files

2007-04-27 Thread Daniel Brown

   Maybe the PHP site itself should be Wiki-fied so that we could just go
in ourselves and fix the errors.  I don't see that happening any time soon
though


On 4/27/07, Eric Butera <[EMAIL PROTECTED]> wrote:


On 4/27/07, Edward Kay <[EMAIL PROTECTED]> wrote:
>
> > When I searched for "csv" against on php.net I got redirected to
> > http://us2.php.net/manual/en/function.gzeof.php.  That isn't exactly
> > obvious is it?
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> OK, sorry for being critical. As Tijnema showed, the different mirrors
seem to be giving different search results. Searching for 'csv' on
http://uk.php.net goes to http://uk.php.net/manual-lookup.php?pattern=csvwhich 
clearly lists the suitable functions.
>
> It looks as if some of the mirrors are a bit dirty :)
>
> Edward
>
>

I checked the UK mirror before I posted and noted it went to the
correct function.  I just wanted to state for anybody looking at this
that sometimes people can actually be trying to find out what it is
and aren't going to get any help from the site and need a little
nudge.  Granted some people might not try hard enough but still it is
worth considering.  =)

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





--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


Re: [PHP] Server-Side Speech --- New Project Discussion (PHP/C++ Developers?)

2007-04-27 Thread Daniel Brown

   That's what I'm going to try to do, Tedd.  I'll post updates throughout
the day to include the new mailing list address and such (so we're not
flooding the PHP list with stuff about a specific project) and other
relevant information.

On 4/27/07, tedd <[EMAIL PROTECTED]> wrote:


At 3:53 PM -0400 4/26/07, Daniel Brown wrote:
>Anyone who's interested in jumping on, let me know.  We may not
create a
>PHP-based TTS system, but we can do the next best thing.  Besides,
>everything has to start somewhere!

Daniel:

But of course, you can count me in -- after all, I started this thread.

If you can get the project to the point were I can upload something
to my site that can generate a sound file from text, I'll take it
from there.

The point of all this is to provide a simple way for "civilians" to
have their sites speak.

I certainly can do all the documentation and design/write the
software that will make it easy for the end user to use -- that's not
a problem. The problem is having the text-to-sound routines being
autonomous and free from requiring the user to seek assistance from
their host for installation.

If you can get it to that, this project is doable.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com





--
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107


Re: [PHP] Parsing CSV files

2007-04-27 Thread Eric Butera

On 4/27/07, Edward Kay <[EMAIL PROTECTED]> wrote:


> When I searched for "csv" against on php.net I got redirected to
> http://us2.php.net/manual/en/function.gzeof.php.  That isn't exactly
> obvious is it?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

OK, sorry for being critical. As Tijnema showed, the different mirrors seem to 
be giving different search results. Searching for 'csv' on http://uk.php.net 
goes to http://uk.php.net/manual-lookup.php?pattern=csv which clearly lists the 
suitable functions.

It looks as if some of the mirrors are a bit dirty :)

Edward




I checked the UK mirror before I posted and noted it went to the
correct function.  I just wanted to state for anybody looking at this
that sometimes people can actually be trying to find out what it is
and aren't going to get any help from the site and need a little
nudge.  Granted some people might not try hard enough but still it is
worth considering.  =)

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



Re: [PHP] Re: posting variables to parent frame OT

2007-04-27 Thread Robert Cummings
On Fri, 2007-04-27 at 16:19 +0200, Tijnema ! wrote:
> On 4/27/07, tedd <[EMAIL PROTECTED]> wrote:
> > At 3:44 PM +0200 4/27/07, Tijnema ! wrote:
> > >>
> > >
> > >Never knew anything of ems, i use % for al dynamic stuff. Is there any
> > >diference between those 2?
> >
> > Google "em css":
> >
> > http://htmlhelp.com/reference/css/units.html
> >
> > Lot's of stuff there -- just another way to size stuff. However, IMO,
> > it's the best method.
> >
> > Cheers,
> >
> > tedd
> 
> Ah i see, ems are relative to the font size, and % is relative to the
> browser width/height.
> Maybe a  combination of both would create "the perfect" (or something
> close to that) layout :)

% is relative to the parent.

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] Parsing CSV files

2007-04-27 Thread Tijnema !

On 4/27/07, Edward Kay <[EMAIL PROTECTED]> wrote:


> When I searched for "csv" against on php.net I got redirected to
> http://us2.php.net/manual/en/function.gzeof.php.  That isn't exactly
> obvious is it?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

OK, sorry for being critical. As Tijnema showed, the different mirrors seem to 
be giving different search results. Searching for 'csv' on http://uk.php.net 
goes to http://uk.php.net/manual-lookup.php?pattern=csv which clearly lists the 
suitable functions.

It looks as if some of the mirrors are a bit dirty :)

Edward



Some... It looks like it more then half of the mirrors. Seems a small
bug in the site, bug report?

Tijnema

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



RE: [PHP] Parsing CSV files

2007-04-27 Thread Edward Kay

> When I searched for "csv" against on php.net I got redirected to
> http://us2.php.net/manual/en/function.gzeof.php.  That isn't exactly
> obvious is it?
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

OK, sorry for being critical. As Tijnema showed, the different mirrors seem to 
be giving different search results. Searching for 'csv' on http://uk.php.net 
goes to http://uk.php.net/manual-lookup.php?pattern=csv which clearly lists the 
suitable functions.

It looks as if some of the mirrors are a bit dirty :)

Edward

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



Re: [PHP] Re: posting variables to parent frame OT

2007-04-27 Thread Tijnema !

On 4/27/07, tedd <[EMAIL PROTECTED]> wrote:

At 3:44 PM +0200 4/27/07, Tijnema ! wrote:
>>
>
>Never knew anything of ems, i use % for al dynamic stuff. Is there any
>diference between those 2?

Google "em css":

http://htmlhelp.com/reference/css/units.html

Lot's of stuff there -- just another way to size stuff. However, IMO,
it's the best method.

Cheers,

tedd


Ah i see, ems are relative to the font size, and % is relative to the
browser width/height.
Maybe a  combination of both would create "the perfect" (or something
close to that) layout :)

Tijnema

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



Re: [PHP] Parsing CSV files

2007-04-27 Thread Tijnema !

On 4/27/07, Eric Butera <[EMAIL PROTECTED]> wrote:

On 4/26/07, Edward Kay <[EMAIL PROTECTED]> wrote:
> Todd Cary wrote:
> > Is there a function that can parse a comma delimited file into an array?
> >
> > Todd
> >
> fgetcsv - http://uk.php.net/fgetcsv
>
> Did you even try looking in the manual?
>
> Edward
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
When I searched for "csv" against on php.net I got redirected to
http://us2.php.net/manual/en/function.gzeof.php.  That isn't exactly
obvious is it?
.


It seems that some mirrors do that (us2, us3, nl3) but others don't
(nl2,fr2,ar2,fr3)
Aren't they keeping the same pages?

Tijnema

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



Re: [PHP] Server-Side Speech --- New Project Discussion (PHP/C++ Developers?)

2007-04-27 Thread tedd

At 3:53 PM -0400 4/26/07, Daniel Brown wrote:

   Anyone who's interested in jumping on, let me know.  We may not create a
PHP-based TTS system, but we can do the next best thing.  Besides,
everything has to start somewhere!


Daniel:

But of course, you can count me in -- after all, I started this thread.

If you can get the project to the point were I can upload something 
to my site that can generate a sound file from text, I'll take it 
from there.


The point of all this is to provide a simple way for "civilians" to 
have their sites speak.


I certainly can do all the documentation and design/write the 
software that will make it easy for the end user to use -- that's not 
a problem. The problem is having the text-to-sound routines being 
autonomous and free from requiring the user to seek assistance from 
their host for installation.


If you can get it to that, this project is doable.

Cheers,

tedd

--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Parsing CSV files

2007-04-27 Thread Eric Butera

On 4/26/07, Edward Kay <[EMAIL PROTECTED]> wrote:

Todd Cary wrote:
> Is there a function that can parse a comma delimited file into an array?
>
> Todd
>
fgetcsv - http://uk.php.net/fgetcsv

Did you even try looking in the manual?

Edward

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



When I searched for "csv" against on php.net I got redirected to
http://us2.php.net/manual/en/function.gzeof.php.  That isn't exactly
obvious is it?

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



Re: [PHP] Re: posting variables to parent frame OT

2007-04-27 Thread Tijnema !

On 4/27/07, tedd <[EMAIL PROTECTED]> wrote:

At 11:56 AM +0200 4/27/07, Tijnema ! wrote:
>I guess the same can be done with ... But the main problem is
>that there's no real standard for resolution. I see people having
>resolution set at 800x600, and 1600x200, how is it ever possible to
>make a page look good at both? Resizing it to 1600x1200 would give you
>an enormous page, while keeping it at 800 width makes it so damn
>small. So lets say you re size it to 1024 width, then you still have
>such damn borders on both sides. That doesn't look nice either. And
>how would you do deal with pages that have a layout based on pictures?
>Should you create a header that is 1600 width, and resize it down
>until 800 when a user with 800x600 visits? and all images used at
>borders and corners? That's the biggest problem in dynamic layouts.
>Atm, i repeat small images around the borders, but that's a real pain
>in the ass. For now, i mostly design static pages, that are best
>viewable with 1024x768, and resolutions higher then that have those
>damn borders... If sombody has a better way, i'd like to hear :)
>
>Tijnema

If you use css and em's properly, it doesn't make any difference what
the user's monitor size is.

For example, look at this:

http://earthstones.com/

That's my wife's site and I based the entire site on em's -- as explained here:


When i zoom in as max as possible, with current resolution @ 1280x1204
(not even 1600x1200) i still have borders...


http://sperling.com/examples/zoom/

IMO, static sites don't use the medium well -- the web is not print.


Never knew anything of ems, i use % for al dynamic stuff. Is there any
diference between those 2?




Cheers,

tedd

PS: I'm redoing her site -- it's dated.


haha, you're also on that site :P
It's more youre site then hers i guess, you made it, and you're on it.
She's on it too but well, what more? :P

Tijnema

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



Re: [PHP] Re: posting variables to parent frame OT

2007-04-27 Thread tedd

At 11:56 AM +0200 4/27/07, Tijnema ! wrote:

I guess the same can be done with ... But the main problem is
that there's no real standard for resolution. I see people having
resolution set at 800x600, and 1600x200, how is it ever possible to
make a page look good at both? Resizing it to 1600x1200 would give you
an enormous page, while keeping it at 800 width makes it so damn
small. So lets say you re size it to 1024 width, then you still have
such damn borders on both sides. That doesn't look nice either. And
how would you do deal with pages that have a layout based on pictures?
Should you create a header that is 1600 width, and resize it down
until 800 when a user with 800x600 visits? and all images used at
borders and corners? That's the biggest problem in dynamic layouts.
Atm, i repeat small images around the borders, but that's a real pain
in the ass. For now, i mostly design static pages, that are best
viewable with 1024x768, and resolutions higher then that have those
damn borders... If sombody has a better way, i'd like to hear :)

Tijnema


If you use css and em's properly, it doesn't make any difference what 
the user's monitor size is.


For example, look at this:

http://earthstones.com/

That's my wife's site and I based the entire site on em's -- as explained here:

http://sperling.com/examples/zoom/

IMO, static sites don't use the medium well -- the web is not print.

Cheers,

tedd

PS: I'm redoing her site -- it's dated.
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Re: PHP & Text Messaging [Straying Way OT]

2007-04-27 Thread Robert Cummings
On Fri, 2007-04-27 at 09:22 -0400, tedd wrote:
> At 2:35 PM -0400 4/26/07, Daniel Brown wrote:
> >Interesting and being in Pennsylvania, I'm in the "all-consent"
> >group but being originally from New Jersey, where I still thought it was
> >law, I'm confused isn't there a Federal mandate about this as well?
> 
> You want confusing, try putting the telephone conversation on 
> speaker-phone and having a nearby  tape recorder recording office 
> conversations.
> 
> Is that wire taping? I duno, but I won a six figure law suit doing it.

Were the first 5 figures 0? :B 

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] Re: PHP & Text Messaging [Straying Way OT]

2007-04-27 Thread tedd

At 2:35 PM -0400 4/26/07, Daniel Brown wrote:

   Interesting and being in Pennsylvania, I'm in the "all-consent"
group but being originally from New Jersey, where I still thought it was
law, I'm confused isn't there a Federal mandate about this as well?


You want confusing, try putting the telephone conversation on 
speaker-phone and having a nearby  tape recorder recording office 
conversations.


Is that wire taping? I duno, but I won a six figure law suit doing it.

Cheers,

tedd
--
---
http://sperling.com  http://ancientstones.com  http://earthstones.com

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



Re: [PHP] Re: everything printed suddenly has blue text, as if were a link

2007-04-27 Thread Philip Thompson

On Apr 26, 2007, at 6:31 AM, Jonathan wrote:


Thufir wrote:

When I print out my list of apartments, everything after


Re: [PHP] Make eclipse-php recognise custom extension as php ?

2007-04-27 Thread Miles Thompson

On 4/27/07, Don Don <[EMAIL PROTECTED]> wrote:


Hi all, i've changed my server's apache config to recognize my custom
extension for php files. And all my development filenames now come with this
new extension.

  However my IDE (Php Eclipse) will not recognise this new extension as a
php file, even though it opens it up but it looses all the php features (
e.g. syntax highlighting, flags, errors, warnning, intellisence etc)

  How can i make php-eclipse recognise my new custom extension as a php
file ?

  Cheers



Use .php extension? Or rewrite PHPEclipse or its configuration file?

There is such a thing as being too clever.

M.


Re: [PHP] Another SYSTEM Function Question

2007-04-27 Thread Jochem Maas
Nathaniel Hall wrote:
> I have another question regarding running a system command on a web
> server.  Let me explain again, I am creating a login page that is to be
> used on my local lan only.  I am wanting to lock down a maximum number
> of logins to up to 2 MAC addresses.  I finally got the arp command
> working, but now I have another issue with new lines.
> 
> The command I am running is system("arp " . $_SERVER['REMOTE_ADDR'] . "
> | grep " . $_SERVER['REMOTE_ADDR'] . " | cut -b34-50");
> 
> The command runs correctly, however the output is directly and not by
> using echo.  I would like to be able to assign what is returned to a
> variable so that I can do additional work on it.  Any ideas?

http://php.net/manual/en/function.exec.php

use the third argument to retrieve the command/shell output.

> 
> -- 
> Nathaniel Hall, GSEC GCFW GCIA GCIH GCFA
> 

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



Re: [PHP] Opening file

2007-04-27 Thread Jonathan

Zoltán Németh wrote:

2007. 04. 26, csütörtök keltezéssel 23.19-kor ed gregory ezt írta:

Hi list,

I have been trying to make "printer friendly version" feature for a
web site and have encountered a problem. Each page of the web site is
composed of a header.php, footer.php and the content of the page which
uses "include_once" to include the above mentioned pages. I have tried
all known methods of reading the file I want to have "printer friendly
version" for, but all of them return a complete page (page with code
of footer.php and header.php included, and not the original).

So, here is what I get:
***

aaa

some content here


***

And what I need is:
***

some content here

***

After I get the original code I can exclude the "include" php tags and
print only the main content.

So, the question is: is there any way (except for FTP functions) to
solve this?


well you either execute the script and get the result as in your first
example, or you either read the php file (using file() or fread() or
something) but then it won't be executed at all, which would give you
php code instead of the markup you want

I've done printer friendly version once as a separate "mode" of the
page, in which case I echoed only the stuff needed for the printer
friendly version

greets
Zoltán Németh


Thank you.

Best regards,
Ed

--
http://www.freenet.am/



Ed you may consider using CSS for screen and print versions.

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



Re: [PHP] Recursive function for array task?

2007-04-27 Thread Stewart Macdonald
Thanks! I don't understand how it works, but it does! That's the main  
thing!


I've been pulling my hair out over this for the last two days.

You're a legend!


Thanks again,

Stewart

On 27/04/2007, at 8:28:41 PM, [EMAIL PROTECTED] wrote:

First versions got a bug, i did not merged the groups when found a  
pair which should connect them.


This one is better:


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



Re: [PHP] List

2007-04-27 Thread Jochem Maas
Wolf wrote:
> Command line tool...  bork no!

yeah ok - my memory was rusty.
although I don't know exactly what swedish chefs have to do with.
(maybe outlook was written by swedish chefs)

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



Re: [PHP] Recursive function for array task?

2007-04-27 Thread [EMAIL PROTECTED]
First versions got a bug, i did not merged the groups when found a pair  
which should connect them.


This one is better:
 array('X'),
"C" => array('Q','K'),
"D" => array('M'),
"F" => array('V'),
"G" => array('N'),
"I" => array('X','M'),
"K" => array('C'),
"M" => array('I','V'),
"Q" => array('C'),
"R" => array('U'),
"V" => array('M'),
"X" => array('I'),
);

$right = array();
foreach($left as $key1 => $values)
foreach($values as $key2)
$right[$key2][] = $key1;

$pairs = array();
foreach($left as $key1 => $values)
foreach($values as $key2)
if (in_array($key1, $right[$key2]))
$pairs[] = array($key1,$key2);

$groups = array();
foreach($pairs as $keys)
{
list($key1, $key2) = $keys;
$foundGroups = array();
foreach($groups as $i => &$group)
if (in_array($key1, $group) || in_array($key2, $group))
$foundGroups[] = $i;
$newGroup = $keys;
foreach($foundGroups as $i)
{
$newGroup = array_merge($newGroup, $groups[$i]);
unset($groups[$i]);
}
$groups[] = $newGroup;
}

foreach($groups as &$group)
$group = array_unique($group);

print_r($groups);
?>


Am 27.04.2007, 11:57 Uhr, schrieb [EMAIL PROTECTED] <[EMAIL PROTECTED]>:


What you want is strange...

but this is the solution

 array('X'),
 "C" => array('Q','K'),
 "D" => array('M'),
 "F" => array('V'),
 "G" => array('N'),
 "I" => array('X','M'),
 "K" => array('C'),
 "M" => array('I','V'),
 "Q" => array('C'),
 "R" => array('U'),
 "V" => array('M'),
 "X" => array('I'),
);

$right = array();
foreach($left as $key1 => $values)
 foreach($values as $key2)
 $right[$key2][] = $key1;

$pairs = array();
foreach($left as $key1 => $values)
 foreach($values as $key2)
 if (in_array($key1, $right[$key2]))
 $pairs[] = array(min($key1, $key2), max($key1, $key2));

$groups = array();
foreach($pairs as $keys)
{
 list($key1, $key2) = $keys;
 $foundGroup = false;
 foreach($groups as &$group)
 {
 if (in_array($key1, $group))
 {
 $group[] = $key2;
 $foundGroup = true;
 break;
 }
 else if (in_array($key2, $group))
 {
 $group[] = $key1;
 $foundGroup = true;
 break;
 }
 }
 if ($foundGroup == false)
 $groups[] = $keys;
}

foreach($groups as &$group)
 $group = array_unique($group);

print_r($groups);
?>

Am 27.04.2007, 11:13 Uhr, schrieb Stewart Macdonald  
<[EMAIL PROTECTED]>:



Hi all,

I've got a bit of a logic problem that I can't figure out.

I've got an array:

Array
(
 [B] => X
 [C] => Q,K
 [D] => M
 [F] => V
 [G] => N
 [I] => X,M
 [K] => C
 [M] => I,V
 [Q] => C
 [R] => U
 [V] => M
 [X] => I
)

This array shows groupings of objects:
  B is paired with X
  X is also paired with I
  I is also paired with M
  M is paired with V and D
  V is paired with F
F and D aren't paired with anything else, so that's the end of one  
group.
There are a few other pairs in the array. So this array contains the  
following groups:

  B,X,I,M,V,F,D
  C,Q,K
  G,N
  R,U

The general structure of each element in the array is:
[key] -> code1, code2, code3, . codeN

N is theoretically unlimited (but practically limited to about 50).
The key can be a value in the array multiple times, but each key should  
be unique.


It's easy to look at the array and manually work out these groups, but  
I can't find a way to programatically work out groups.


I've tried to write a recursive function to do it. The function works  
most times, but it's stalling on the above array.


Does PHP have an array function that would let me 'collapse' all these  
together somehow? If it makes it easier (i.e., there's a way of doing  
this if the original array is formatted differently) I can re-write the  
code that generates the original array.


I'm sure I'm overlooking something simple. Can anyone offer any help? I  
don't want to manually work out groups from thousands of arrays!



Thanks!

Stewart



--
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] Re: posting variables to parent frame

2007-04-27 Thread Stut

Tijnema ! wrote:

I guess the same can be done with ... But the main problem is
that there's no real standard for resolution. I see people having
resolution set at 800x600, and 1600x200, how is it ever possible to
make a page look good at both? Resizing it to 1600x1200 would give you
an enormous page, while keeping it at 800 width makes it so damn
small. So lets say you re size it to 1024 width, then you still have
such damn borders on both sides. That doesn't look nice either. And
how would you do deal with pages that have a layout based on pictures?
Should you create a header that is 1600 width, and resize it down
until 800 when a user with 800x600 visits? and all images used at
borders and corners? That's the biggest problem in dynamic layouts.
Atm, i repeat small images around the borders, but that's a real pain
in the ass. For now, i mostly design static pages, that are best
viewable with 1024x768, and resolutions higher then that have those
damn borders... If sombody has a better way, i'd like to hear :)


This attitude is why most web "design" sucks. It seems to me that the 
really successful applications these days are "designed" to be flexible. 
Always use relative sizes like % or preferably em, never use px or pt. 
That will allow your users to change the font size on their browser to 
their preference without screwing up your design. Yes, it will require 
you to do more testing at different font sizes, but it will be worth it.


As far as images go, there are ways to get around this problem by using 
relative size definitions and making the actual size of the image a 
compromise between looking good when your site is viewed with a large 
font size, and not being too big that site performance suffers. At 
smaller font sizes the browser will resize the image for you (with 
varying degrees of quality). I'm sure this is one area of browser 
technology that will see some innovations in the next few years.


Fixed width sites are bad unless 1) they resize properly with font size 
changes, or 2) the user is using a browser that can properly zoom fixed 
layouts (opera does this very well).


Content is king. There has been a period recently when this wasn't the 
case, but it's coming back as the primary concern for most web users - 
the fluff don't work no more! And if content is king, the accessibility 
of that content is the queen - the thing that makes the king look good!


People are easily turned off something, and not being able to read the 
text on a site, or having to battle against a poor user experience for 
the sake of a pretty design will easily prevent your site from being a 
success.


-Stut

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



[PHP] Make eclipse-php recognise custom extension as php ?

2007-04-27 Thread Don Don
Hi all, i've changed my server's apache config to recognize my custom extension 
for php files. And all my development filenames now come with this new 
extension.
   
  However my IDE (Php Eclipse) will not recognise this new extension as a php 
file, even though it opens it up but it looses all the php features (e.g. 
syntax highlighting, flags, errors, warnning, intellisence etc)
   
  How can i make php-eclipse recognise my new custom extension as a php file ?
   
  Cheers
   

   
-
Ahhh...imagining that irresistible "new car" smell?
 Check outnew cars at Yahoo! Autos.

Re: [PHP] Recursive function for array task?

2007-04-27 Thread Stewart Macdonald

On 27/04/2007, at 7:57:45 PM, Edward Kay wrote:

Interesting problem. I've got a few ideas but please could you  
clarify what

you want as the output? Is it just an array of the groups, i.e.

Array
(
[0] => 'B,X,I,M,V,F,D'
[1] => 'C,Q,K'
[2] => 'G,N'
[3] => 'R,U'
)


Hi Edward,

Yep, an array like that would be great.


Thanks,

Stewart

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



Re: [PHP] Recursive function for array task?

2007-04-27 Thread [EMAIL PROTECTED]

What you want is strange...

but this is the solution

 array('X'),
"C" => array('Q','K'),
"D" => array('M'),
"F" => array('V'),
"G" => array('N'),
"I" => array('X','M'),
"K" => array('C'),
"M" => array('I','V'),
"Q" => array('C'),
"R" => array('U'),
"V" => array('M'),
"X" => array('I'),
);

$right = array();
foreach($left as $key1 => $values)
foreach($values as $key2)
$right[$key2][] = $key1;

$pairs = array();
foreach($left as $key1 => $values)
foreach($values as $key2)
if (in_array($key1, $right[$key2]))
$pairs[] = array(min($key1, $key2), max($key1, $key2));

$groups = array();
foreach($pairs as $keys)
{
list($key1, $key2) = $keys;
$foundGroup = false;
foreach($groups as &$group)
{
if (in_array($key1, $group))
{
$group[] = $key2;
$foundGroup = true;
break;
}
else if (in_array($key2, $group))
{
$group[] = $key1;
$foundGroup = true;
break;
}
}
if ($foundGroup == false)
$groups[] = $keys;
}

foreach($groups as &$group)
$group = array_unique($group);

print_r($groups);
?>

Am 27.04.2007, 11:13 Uhr, schrieb Stewart Macdonald  
<[EMAIL PROTECTED]>:



Hi all,

I've got a bit of a logic problem that I can't figure out.

I've got an array:

Array
(
 [B] => X
 [C] => Q,K
 [D] => M
 [F] => V
 [G] => N
 [I] => X,M
 [K] => C
 [M] => I,V
 [Q] => C
 [R] => U
 [V] => M
 [X] => I
)

This array shows groupings of objects:
  B is paired with X
  X is also paired with I
  I is also paired with M
  M is paired with V and D
  V is paired with F
F and D aren't paired with anything else, so that's the end of one group.
There are a few other pairs in the array. So this array contains the  
following groups:

  B,X,I,M,V,F,D
  C,Q,K
  G,N
  R,U

The general structure of each element in the array is:
[key] -> code1, code2, code3, . codeN

N is theoretically unlimited (but practically limited to about 50).
The key can be a value in the array multiple times, but each key should  
be unique.


It's easy to look at the array and manually work out these groups, but I  
can't find a way to programatically work out groups.


I've tried to write a recursive function to do it. The function works  
most times, but it's stalling on the above array.


Does PHP have an array function that would let me 'collapse' all these  
together somehow? If it makes it easier (i.e., there's a way of doing  
this if the original array is formatted differently) I can re-write the  
code that generates the original array.


I'm sure I'm overlooking something simple. Can anyone offer any help? I  
don't want to manually work out groups from thousands of arrays!



Thanks!

Stewart



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



RE: [PHP] Recursive function for array task?

2007-04-27 Thread Edward Kay


> -Original Message-
> From: Stewart Macdonald [mailto:[EMAIL PROTECTED]
> Sent: 27 April 2007 10:13
> To: php-general@lists.php.net
> Subject: [PHP] Recursive function for array task?
>
>
> Hi all,
>
> I've got a bit of a logic problem that I can't figure out.
>
> I've got an array:
>
> Array
> (
>  [B] => X
>  [C] => Q,K
>  [D] => M
>  [F] => V
>  [G] => N
>  [I] => X,M
>  [K] => C
>  [M] => I,V
>  [Q] => C
>  [R] => U
>  [V] => M
>  [X] => I
> )
>
> This array shows groupings of objects:
>   B is paired with X
>   X is also paired with I
>   I is also paired with M
>   M is paired with V and D
>   V is paired with F
> F and D aren't paired with anything else, so that's the end of one
> group.
> There are a few other pairs in the array. So this array contains the
> following groups:
>   B,X,I,M,V,F,D
>   C,Q,K
>   G,N
>   R,U
>
> The general structure of each element in the array is:
> [key] -> code1, code2, code3, . codeN
>
> N is theoretically unlimited (but practically limited to about 50).
> The key can be a value in the array multiple times, but each key
> should be unique.
>
> It's easy to look at the array and manually work out these groups,
> but I can't find a way to programatically work out groups.
>
> I've tried to write a recursive function to do it. The function works
> most times, but it's stalling on the above array.
>
> Does PHP have an array function that would let me 'collapse' all
> these together somehow? If it makes it easier (i.e., there's a way of
> doing this if the original array is formatted differently) I can re-
> write the code that generates the original array.
>
> I'm sure I'm overlooking something simple. Can anyone offer any help?
> I don't want to manually work out groups from thousands of arrays!
>
>
> Thanks!
>
> Stewart
>

Interesting problem. I've got a few ideas but please could you clarify what
you want as the output? Is it just an array of the groups, i.e.

Array
(
[0] => 'B,X,I,M,V,F,D'
[1] => 'C,Q,K'
[2] => 'G,N'
[3] => 'R,U'
)

Edward

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



Re: [PHP] Re: posting variables to parent frame

2007-04-27 Thread Tijnema !

On 4/27/07, Justin Frim <[EMAIL PROTECTED]> wrote:

Edward Vermillion wrote:

> So you're saying that if I "maximize" my browser window, all the
> sites that you made with tables will "actually look good", at 1680 x
> 1050, because they are stretchy-pages?
>
> Honestly, I have no clue as to why some folks think that a "stretchy"/
> liquid/dynamic layout has anything to do with good design... I have
> yet to see one that did anyway*... :P
>
> On the other hand, if I increase my font size (which I almost always
> do) I expect the layout to "grow" so that I can actually read what's
> on the page, without the words all running together. But that's a
> different thing than being "stretchy".
>
> Ed
>
> [*] I'm often wrong, but I'm open to different viewpoints if you've
> got an example to prove me wrong. ;)


Ok, this is attempt #2 since the list rejected the previous attempt.

Well one of my biggest pet peeves with absolute-positioned-element pages
is if I maximize my window, I still just have a tiny little blob in the
centre which has the actual page content, with lines of text still
needlessly wrapping around their artificial constraints.  Then I see
trash like "this site looks best in 1024x768" or something similar.
What ever happened to device-independent design?  What's next, a trip
down memory lane to 1998 when sites had "looks best with Internet
Explorer" and "looks best with Netscape" plastered all over them!?  I
scoffed at anyone who back in the day used to say "most people view web
sites at 800x600, so design for that".  No.  I say design something
that's still readable at 640x480, and make it liquid so it will expand
to whatever's available up to the point where it no longer needs
expansion.  At that point, just make sure it's centered.

So what I usually do is I put my page content in a rectangular
boundary.  (sometimes I'll put page headers and footers outside this
bounding box, but the main content stays inside.)  I then left-justify
all the inner content to the box.  (English reads left-to-right, so
left-justified paragraphs look 10 000 times better centered text.)  But
if someone expands their window to a huge size, it looks dorky to have
_everything_ stuck to the left of the window!  So the *bounding box* is
what's centered in the window.

Everything inside the bounding box is then set with percentage-based
widths where "stretchyness" is ok (eg. for blocks of text), or pixel
values where it should never change (eg. for images placed on the
page).  For the percentage-based widths, this is a percentage of the
bounding box size.  The actual size of the bounding box is nice and
liquid, stretching as wide as necessary until there are no more lines of
text that need to be wrapped.

I think that results in the best page layout, all the way from tiny PDA
screens at 160x240 to your 1680x1050 behemoth!  :-)

If there's an elegant way of doing this with CSS, let me know.  But I've
found this usually works well for a simple site layout that has headers
and footers as wide as the window, and a menu down the left made with
120px wide graphics.







   
  
   
   
  
   






The coments commented as "Liquid / stretchy text..." can then have divs
completely dynamic tables and whatever, which are all scaled to whatever
size that particular table cell (with width="*") happens to end up being
rendered at.



I guess the same can be done with ... But the main problem is
that there's no real standard for resolution. I see people having
resolution set at 800x600, and 1600x200, how is it ever possible to
make a page look good at both? Resizing it to 1600x1200 would give you
an enormous page, while keeping it at 800 width makes it so damn
small. So lets say you re size it to 1024 width, then you still have
such damn borders on both sides. That doesn't look nice either. And
how would you do deal with pages that have a layout based on pictures?
Should you create a header that is 1600 width, and resize it down
until 800 when a user with 800x600 visits? and all images used at
borders and corners? That's the biggest problem in dynamic layouts.
Atm, i repeat small images around the borders, but that's a real pain
in the ass. For now, i mostly design static pages, that are best
viewable with 1024x768, and resolutions higher then that have those
damn borders... If sombody has a better way, i'd like to hear :)

Tijnema

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



Re: [PHP] Changing Session Timeout

2007-04-27 Thread Tijnema !

On 4/27/07, Aaron Axelsen <[EMAIL PROTECTED]> wrote:

I am trying to change my session timeout to 180 minutes, and everything
ive tried has not worked.  Does anyone have any idea why this isn't
working properly?

I currently am trying to set the following:

session_name('myapp');

$mytimeout = 180 * 60; // minutes * 60

session_set_cookie_params($mytimeout);

$sessdir = ini_get('session.save_path')."/myapp";
if (!is_dir($sessdir)) { mkdir($sessdir, 0777); }
ini_set('session.save_path', $sessdir);

session_cache_limiter();
session_cache_expire($mytimeout);
ini_set('session.gc_maxlifetime', $mytimeout);
#ini_set('session.gc_probability',1);
#ini_set('session.gc_divisor',1);

session_start();


--
Aaron Axelsen
[EMAIL PROTECTED]



session_set_cookie_params requires the number given in seconds, which
you did correct. But session_cache_expire requires the number given in
minutes. and session.gc_maxlifetime is in minutes again. So that is
correct too.

you could try replace this:
session_cache_expire($mytimeout);
with:
session_cache_expire($mytimeout / 60);

That should fix it, if not, just come back, but then tell us what
exactly is wrong, does the session timeout too early? does the session
timeout too late? does the session timeout never?

Tijnema

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



[PHP] Recursive function for array task?

2007-04-27 Thread Stewart Macdonald

Hi all,

I've got a bit of a logic problem that I can't figure out.

I've got an array:

Array
(
[B] => X
[C] => Q,K
[D] => M
[F] => V
[G] => N
[I] => X,M
[K] => C
[M] => I,V
[Q] => C
[R] => U
[V] => M
[X] => I
)

This array shows groupings of objects:
 B is paired with X
 X is also paired with I
 I is also paired with M
 M is paired with V and D
 V is paired with F
F and D aren't paired with anything else, so that's the end of one  
group.
There are a few other pairs in the array. So this array contains the  
following groups:

 B,X,I,M,V,F,D
 C,Q,K
 G,N
 R,U

The general structure of each element in the array is:
[key] -> code1, code2, code3, . codeN

N is theoretically unlimited (but practically limited to about 50).
The key can be a value in the array multiple times, but each key  
should be unique.


It's easy to look at the array and manually work out these groups,  
but I can't find a way to programatically work out groups.


I've tried to write a recursive function to do it. The function works  
most times, but it's stalling on the above array.


Does PHP have an array function that would let me 'collapse' all  
these together somehow? If it makes it easier (i.e., there's a way of  
doing this if the original array is formatted differently) I can re- 
write the code that generates the original array.


I'm sure I'm overlooking something simple. Can anyone offer any help?  
I don't want to manually work out groups from thousands of arrays!



Thanks!

Stewart

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



Re: FW: [PHP] Need to POST multiple values with single name

2007-04-27 Thread Zoltán Németh
2007. 04. 27, péntek keltezéssel 04.14-kor Buesching, Logan J ezt írta:
> Just make sure you use []'s in your name, such as:
> 
> 
> Then it will fill $bob as an array, instead of a string.

I think he's not using a form but tries to construct the POST request
from php

then it would be possible to put a sub-array of fields into
http_post_fields() or not?

greets
Zoltán Németh

> 
> http://us2.php.net/manual/en/faq.html.php#faq.html.arrays
> 
> -Logan
> 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> > Sent: Friday, April 27, 2007 4:02 AM
> > To: php-general@lists.php.net
> > Subject: [PHP] Need to POST multiple values with single name
> >
> > Need to POST multiple values with single name.
> >
> > Ex.
> > -55751342416306771991025074398
> > Content-Disposition: form-data; name="licenses"
> >
> > lic1
> > -55751342416306771991025074398
> > Content-Disposition: form-data; name="licenses"
> >
> > lic2
> >
> >
> > Function http_post_fields() cannot be used due to an _associative_
> array
> > of POST values.
> >
> > Any ideas?
> >
> > Maxim <[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] Find a what class a variable is

2007-04-27 Thread Edward Kay
> -Original Message-
> From: John Comerford [mailto:[EMAIL PROTECTED]
> Sent: 27 April 2007 08:41
> To: php-general@lists.php.net
> Subject: [PHP] Find a what class a variable is
>
>
> Hi Folks,
>
> Is is possible to detect what class a variable is eg.
>
> $JC1 = new Button();
> $JC2 = new TickBox();
>
>
> Is it possible to find out what class $JC1 is ?
>
> TIA,
>   JC

If you want check it is of a certain type, use the instanceof operator, e.g.

if ($JC2 instanceof TickBox)
echo '$JC2 is a TickBox';
else
echo '$JC2 is not a TickBox';

E

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



FW: [PHP] Need to POST multiple values with single name

2007-04-27 Thread Buesching, Logan J
Just make sure you use []'s in your name, such as:


Then it will fill $bob as an array, instead of a string.

http://us2.php.net/manual/en/faq.html.php#faq.html.arrays

-Logan

> -Original Message-
> From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
> Sent: Friday, April 27, 2007 4:02 AM
> To: php-general@lists.php.net
> Subject: [PHP] Need to POST multiple values with single name
>
> Need to POST multiple values with single name.
>
> Ex.
> -55751342416306771991025074398
> Content-Disposition: form-data; name="licenses"
>
> lic1
> -55751342416306771991025074398
> Content-Disposition: form-data; name="licenses"
>
> lic2
>
>
> Function http_post_fields() cannot be used due to an _associative_
array
> of POST values.
>
> Any ideas?
>
> Maxim <[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] explode in mysql query

2007-04-27 Thread Buesching, Logan J

> -Original Message-
> From: Paul Novitski [mailto:[EMAIL PROTECTED]
> Sent: Friday, April 27, 2007 3:01 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] explode in mysql query
> 
> At 4/26/2007 11:33 PM, Sebe wrote:
> >i have a mysql column that looks like this:
> >
> >groups
> >---
> >12,7,10,6,14,11,2
You should never have tables that look like this.  If this is early in
the application development, look into 3rd normal form for SQL tables
(don't worry about 4th or 5th).  In a nutshell, here is what you should
be doing: you have a many to many relationship (big thing to note).
Whatever holds groups (lets call it foo) to groups.

So you should do something like this:

===
Foo <--A table
===
Id <-- columns
groups
Coln

===
Groups
===
Id
Col1
Col2
Col3

So then you create a 3rd table named

===
Foo_has_groups (or groups_has_foo, whichever sounds best)
===
Fooid
groupsid

So then, you can do much more powerful queries, with much less overhead.

Such as: 
SELECT t1.* FROM foo t1, groups t2 WHERE t1.id=t2.whatever_id AND
(t2.group=7 OR t2.group=14);

If you are reluctant to do any of these optimizations to your database,
then you better not worry about anywhere in your PHP code to do _ANY_
optimizations.  This will be your system bottleneck!  99% of the time
(maybe less) when you get a slow application, your bottlenecks will
be in your sql queries/design. 

Hopefully that all made sense

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



[PHP] Need to POST multiple values with single name

2007-04-27 Thread Maxim . Sedelnikov
Need to POST multiple values with single name.

Ex.
-55751342416306771991025074398
Content-Disposition: form-data; name="licenses"

lic1
-55751342416306771991025074398
Content-Disposition: form-data; name="licenses"

lic2


Function http_post_fields() cannot be used due to an _associative_ array
of POST values.

Any ideas?

Maxim <[EMAIL PROTECTED]>

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



Re: [PHP] explode in mysql query

2007-04-27 Thread Sebe

Paul Novitski wrote:

At 4/26/2007 11:33 PM, Sebe wrote:

i have a mysql column that looks like this:

groups
---
12,7,10,6,14,11,2

is it possible to select the row if `groups` contain 7 or 14?
trying to avoid running two queries and running explode() on it.



I would think a more efficient strategy would be a simple string 
search.  If you append a comma to the beginning and the end of your 
list so it becomes:


,12,7,10,6,14,11,2,

then you can search for:

,#,

where # is the desired integer.

Therefore you could use the MySQL syntax:

WHERE CONCAT(',', `groups`, ',') LIKE '%,7,%'
   OR CONCAT(',', `groups`, ',') LIKE '%,14,%'

Regards,

Paul


thanks for the idea.. i also just came up with a solution using mysql 
FIND_IN_SET


eg: FIND_IN_SET('7', groups) OR FIND_IN_SET('14', groups)

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



Re: [PHP] define() an array?

2007-04-27 Thread M.Sokolewicz

Chris wrote:

Tijnema ! wrote:

On 4/20/07, Richard Lynch <[EMAIL PROTECTED]> wrote:

On Fri, April 20, 2007 4:46 am, [EMAIL PROTECTED] wrote:
> I thought I could define() and array. However, when I do this:

Nope. :-(

Has to be string or int or boolean or float or other "scalar" type.

> define("THECONSTANT", array(1,2,3));
> print_r(THECONSTANT);
>
> it prints THECONSTANT and not the array :(
>
> according to the manual:
>
> bool define ( string $name, mixed $value [, bool $case_insensitive] )
>
> And isn't "mixed" of any type?

No.

"mixed" just means it's 2 or more types.

There could be all kinda of reasons/cases where "mixed" means only
scalars, or only compound types or, really, any 2 types you'd care to
choose.


So, why isn't such stuff in the manual?


Post a documentation patch/bug/feature request in http://bugs.php.net :)



I have updated the (english) php-documentation to explicitly state that 
only scalar values are allowed.


- tul

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



Re: [PHP] Find a what class a variable is

2007-04-27 Thread [EMAIL PROTECTED]

echo get_class($JC1);

Am 27.04.2007, 09:41 Uhr, schrieb John Comerford  
<[EMAIL PROTECTED]>:



Hi Folks,

Is is possible to detect what class a variable is eg.

$JC1 = new Button();
$JC2 = new TickBox();


Is it possible to find out what class $JC1 is ?

TIA,
  JC



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



[PHP] Find a what class a variable is

2007-04-27 Thread John Comerford

Hi Folks,

Is is possible to detect what class a variable is eg.

$JC1 = new Button();
$JC2 = new TickBox();


Is it possible to find out what class $JC1 is ?

TIA,
 JC

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



Re: [PHP] define() an array?

2007-04-27 Thread Chris

Tijnema ! wrote:

On 4/20/07, Richard Lynch <[EMAIL PROTECTED]> wrote:

On Fri, April 20, 2007 4:46 am, [EMAIL PROTECTED] wrote:
> I thought I could define() and array. However, when I do this:

Nope. :-(

Has to be string or int or boolean or float or other "scalar" type.

> define("THECONSTANT", array(1,2,3));
> print_r(THECONSTANT);
>
> it prints THECONSTANT and not the array :(
>
> according to the manual:
>
> bool define ( string $name, mixed $value [, bool $case_insensitive] )
>
> And isn't "mixed" of any type?

No.

"mixed" just means it's 2 or more types.

There could be all kinda of reasons/cases where "mixed" means only
scalars, or only compound types or, really, any 2 types you'd care to
choose.


So, why isn't such stuff in the manual?


Post a documentation patch/bug/feature request in http://bugs.php.net :)

--
Postgresql & php tutorials
http://www.designmagick.com/

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



  1   2   >