php-windows Digest 1 Sep 2004 17:00:32 -0000 Issue 2379

Topics (messages 24484 through 24492):

Re: gd error
        24484 by: Philip Dahlstr�m

Re: Strange 'if' test bug?
        24485 by: Svensson, B.A.T. (HKG)
        24489 by: Christian Zambrano
        24490 by: Charles P. Killmer
        24491 by: Yigal Rifkind
        24492 by: Gryffyn, Trevor

Re: using the mail function in php
        24486 by: Christian Fersch

Re: Persistant Socket Across Different Scripts
        24487 by: Christian Fersch

Re: interacting with Java or C
        24488 by: Frank M. Kromann

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message --- Rafi Sheikh wrote:
I am trying to use jpgrap with php.  For that I need gd enabled.  Following
is from my php.ini-as you can sees, it is listed.  However, I do not see gd
related info when I run php_info()

; Directory in which the loadable extensions (modules) reside.
extension_dir = "c:\php"
extension=php_gd2.dll

What am I missing?


RS


This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately.

You'll have to set your extension dir ti "c:\php\ext" if it is PHP5 else "c:\php\extensions"

--- End Message ---
--- Begin Message ---
You can always use type casting if you want to change the built in
behaviour:

http://nl3.php.net/manual/en/language.types.type-juggling.php#language.types
.typecasting

hence what you ask for is there already.


-----Original Message-----
From: Charles P. Killmer
To: [EMAIL PROTECTED]
Sent: 31/08/2004 18:03
Subject: RE: [PHP-WIN] Strange 'if' test bug?

I would think that PHP should make the conversion in the other direction
to avoid losing data.  In other words, if a conversion is necessary,
convert to the data type that can handle the greater variety of data.
In this case to strings.  It would probably always be to strings though.

Charles 

-----Original Message-----
From: Christian Zambrano [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 31, 2004 10:35 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Strange 'if' test bug?

$key=0;
$key=="muppet"?TRUE:FALSE;
The reason this last comparison returns true is that since you are
comparing an integer with a string, the strings gets converted to an
integer and since "muppet" does not have any numeric character it gets
converted to 0. In other words as far PHP in concerned you are comparing
0 with 0 which is why the result of comparison is a true statement.

Any thoughts on this?

Thanks
Christian

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

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

--- End Message ---
--- Begin Message ---
I think PHP converts to whatever type is on the left of the equal sign which
will make a lot of sense to me. I haven't thoroughly tested it.

Christian
----- Original Message ----- 
From: "Charles P. Killmer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 31, 2004 11:03 AM
Subject: RE: [PHP-WIN] Strange 'if' test bug?


> I would think that PHP should make the conversion in the other direction
> to avoid losing data.  In other words, if a conversion is necessary,
> convert to the data type that can handle the greater variety of data.
> In this case to strings.  It would probably always be to strings though.
>
> Charles
>
> -----Original Message-----
> From: Christian Zambrano [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 31, 2004 10:35 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] Strange 'if' test bug?
>
> $key=0;
> $key=="muppet"?TRUE:FALSE;
> The reason this last comparison returns true is that since you are
> comparing an integer with a string, the strings gets converted to an
> integer and since "muppet" does not have any numeric character it gets
> converted to 0. In other words as far PHP in concerned you are comparing
> 0 with 0 which is why the result of comparison is a true statement.
>
> Any thoughts on this?
>
> Thanks
> Christian
>
> --
> PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
>
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I tried switching the order, and still the same results.  That would
make sense to me to though.

Charles 

-----Original Message-----
From: Christian Zambrano [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 01, 2004 10:07 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-WIN] Strange 'if' test bug?

I think PHP converts to whatever type is on the left of the equal sign
which will make a lot of sense to me. I haven't thoroughly tested it.

Christian
----- Original Message -----
From: "Charles P. Killmer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 31, 2004 11:03 AM
Subject: RE: [PHP-WIN] Strange 'if' test bug?


> I would think that PHP should make the conversion in the other
direction
> to avoid losing data.  In other words, if a conversion is necessary,
> convert to the data type that can handle the greater variety of data.
> In this case to strings.  It would probably always be to strings
though.
>
> Charles
>
> -----Original Message-----
> From: Christian Zambrano [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, August 31, 2004 10:35 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] Strange 'if' test bug?
>
> $key=0;
> $key=="muppet"?TRUE:FALSE;
> The reason this last comparison returns true is that since you are
> comparing an integer with a string, the strings gets converted to an
> integer and since "muppet" does not have any numeric character it gets
> converted to 0. In other words as far PHP in concerned you are
comparing
> 0 with 0 which is why the result of comparison is a true statement.
>
> Any thoughts on this?
>
> Thanks
> Christian
>
> --
> PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit:
> http://www.php.net/unsub.php
>
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

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

--- End Message ---
--- Begin Message --- strange question: I'm trying to figure out how to build a dating website? Anyone have any off the cuff advice for me...

I know next to nothing about PHP, and am desperately trying to teach myself.

-Yigal


From: "Christian Zambrano" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Subject: Re: [PHP-WIN] Strange 'if' test bug?
Date: Wed, 1 Sep 2004 10:07:06 -0500

I think PHP converts to whatever type is on the left of the equal sign which
will make a lot of sense to me. I haven't thoroughly tested it.


Christian
----- Original Message -----
From: "Charles P. Killmer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 31, 2004 11:03 AM
Subject: RE: [PHP-WIN] Strange 'if' test bug?


> I would think that PHP should make the conversion in the other direction > to avoid losing data. In other words, if a conversion is necessary, > convert to the data type that can handle the greater variety of data. > In this case to strings. It would probably always be to strings though. > > Charles > > -----Original Message----- > From: Christian Zambrano [mailto:[EMAIL PROTECTED] > Sent: Tuesday, August 31, 2004 10:35 AM > To: [EMAIL PROTECTED] > Subject: Re: [PHP-WIN] Strange 'if' test bug? > > $key=0; > $key=="muppet"?TRUE:FALSE; > The reason this last comparison returns true is that since you are > comparing an integer with a string, the strings gets converted to an > integer and since "muppet" does not have any numeric character it gets > converted to 0. In other words as far PHP in concerned you are comparing > 0 with 0 which is why the result of comparison is a true statement. > > Any thoughts on this? > > Thanks > Christian > > -- > PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: > http://www.php.net/unsub.php > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >

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


_________________________________________________________________
Designer Mail isn't just fun to send, it's fun to receive. Use special stationery, fonts and colors. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN� Premium right now and get the first two months FREE*.

--- End Message ---
--- Begin Message ---
I did a quick check, putting the switching the "muppet" and the 0 and it
did exactly the same thing.  Yeah, I thought of that too. Order of
precendence or something, but the quick check I did seemed to show that
it'd convert it to an int no matter what order they were in.

-TG

> -----Original Message-----
> From: Christian Zambrano [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, September 01, 2004 11:07 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP-WIN] Strange 'if' test bug?
> 
> 
> I think PHP converts to whatever type is on the left of the 
> equal sign which
> will make a lot of sense to me. I haven't thoroughly tested it.
> 
> Christian
> ----- Original Message ----- 
> From: "Charles P. Killmer" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, August 31, 2004 11:03 AM
> Subject: RE: [PHP-WIN] Strange 'if' test bug?
> 
> 
> > I would think that PHP should make the conversion in the 
> other direction
> > to avoid losing data.  In other words, if a conversion is necessary,
> > convert to the data type that can handle the greater 
> variety of data.
> > In this case to strings.  It would probably always be to 
> strings though.
> >
> > Charles
> >
> > -----Original Message-----
> > From: Christian Zambrano [mailto:[EMAIL PROTECTED]
> > Sent: Tuesday, August 31, 2004 10:35 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: [PHP-WIN] Strange 'if' test bug?
> >
> > $key=0;
> > $key=="muppet"?TRUE:FALSE;
> > The reason this last comparison returns true is that since you are
> > comparing an integer with a string, the strings gets converted to an
> > integer and since "muppet" does not have any numeric 
> character it gets
> > converted to 0. In other words as far PHP in concerned you 
> are comparing
> > 0 with 0 which is why the result of comparison is a true statement.
> >
> > Any thoughts on this?
> >
> > Thanks
> > Christian
> >
> > --
> > PHP Windows Mailing List (http://www.php.net/) To 
> unsubscribe, visit:
> > http://www.php.net/unsub.php
> >
> > -- 
> > PHP Windows Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

--- End Message ---
--- Begin Message ---
Neil wrote:

Hi Justin

I'm not sure I appreciate the aggro. I am new to .php and so this is a
learning exercise for me.

THERE IS NO SLASHES in the data being submitted so obviously something is
putting them in.

So again thank you for your help - the stripslashes did work.

Screaming like little children :P
have a look at "magic_quotes_gpc". You will find your answers there, little padawan. :)


(search the php manual for it, google - whatever you want, you just can't miss the answer ;)

greetings, Christian
--- End Message ---
--- Begin Message --- Justin Borodinsky wrote:
I would like to be able to communicate over this stream with the
client using a browser and PHP.  I can open the stream when the script
runs for the first time, but each time the user gets the script again
the connection is being re-made.  I tried pfsockopen but it seemed to
work the same of fsockopen.

pfsockopen isn't the right way here. There is no way to do this with php. You would have to write a program, that is running in the background and keeps the connection open, to which you pass data with php.

--- End Message ---
--- Begin Message ---
Or if you have a library written in C you can use the FFI extension from
PECL. But if you are to write a C library, why not write a PHP extension
directly?

- Frank

> Hi!
> 
> It would be possible to create a C or Java server that uses sockets to
cater
> a PHP client's request. This is the quickest and easiest solution...
> 
> OR...
> 
> You can create a C or Java HTTP client to receive responses from an XML
file
> generated in PHP (much like RSS readers and RSS feeds or SOAP services
and
> clients)...
> 
> Peace!
> 
> -- 
> 
> Running 'ojtibi' on '127.0.0.1' (BATCH_OPTIMISTIC mode).
> "Live free() or die()."
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

--- End Message ---

Reply via email to