php-general Digest 21 Jan 2004 12:12:28 -0000 Issue 2543

Topics (messages 175248 through 175284):

Re: Flash-PHP Socket Connection
        175248 by: Marc Greenstock
        175249 by: daniel.electroteque.org
        175259 by: Miles Thompson

PHPSESSIONID altering  each time the page is loaded in IE
        175250 by: Tarrant Costelloe
        175251 by: daniel.electroteque.org
        175252 by: Tarrant Costelloe

Re: hello to making the php pages
        175253 by: Raditha Dissanayake
        175254 by: John Nichel
        175273 by: Dagfinn Reiersøl

Search Script????
        175255 by: Student
        175256 by: John Nichel
        175271 by: Manuel Lemos

Re: Specifying file paths in Windows
        175257 by: Luke

Re: Odd Code Error.
        175258 by: Tom Rogers
        175263 by: Luke
        175264 by: Robert Cummings
        175266 by: Luke
        175268 by: Robert Cummings
        175269 by: Luke
        175270 by: Jason Wong
        175282 by: Jay Blanchard

Re: thumbnail
        175260 by: Chris Edwards

IRCG - php windows extension HELP!
        175261 by: Marc Greenstock

Re: authentication problems!
        175262 by: Luke

Email results
        175265 by: BigMark
        175267 by: Jason Wong

Re: XML to PDF with XSL
        175272 by: Aidan Lister

Re: Running PHP as a CGI, chasing my own tail....
        175274 by: Stuart

Problems with $_POST
        175275 by: Reidar Solberg
        175276 by: Binay
        175277 by: Toby Irmer
        175278 by: Aidan Lister

Re: Regexp help (simple)
        175279 by: Victor Spång Arthursson

mcrypt win32 install problem ?
        175280 by: Vincent DUPONT
        175281 by: Tom Rogers

Re: Create PDF FIle
        175283 by: Jay Blanchard

Online Community Project
        175284 by: Ralph Guzman

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 ---
I am doing the same thing at the moment,

I'm building a Flash/PHP/MySQL chat system capable of handling over 1000
users online at one time.

GET and POST just doesn't cut it, so I began to explore other avenues, and
XML Socket's seem like the best and only option. But I expect to burn the
midnight oil on this one.

Marc

"Ben Ramsey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> I guess that's good enough reason for me.  As far as connecting with
> sockets, though: you should connect from Flash to the PHP file, not from
> PHP to the Flash file, I think.  And, in order to do that, you would
> need to ask some people who specialize in Flash and ActionScript, so the
> boards at Macromedia.com may be the best place to ask.
>
> Then again, I could be absolutely wrong. ;-)
>
> -Ben
>
>
> Eric Bolikowski wrote:
>
> > Hey Ben
> >
> > I know it may sound nuts, but I really want to make a socket connection
> > between a Flash and a PHP file.
> >
> > Normally I would simply read in a text file/read XML/send data with GET
or
> > POST, but I'm looking for a socket connections of following reasons:
> >
> > 1) I want a fast connection
> > 2) I'm looking at this as a challenge, because it doesn't seem like
anyone
> > else has done this before
> >
> > Eric
> >
> > "Ben Ramsey" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> >>What I mean is: you shouldn't need to use sockets to read in a file from
> >>Flash unless you're trying to do something more complicated, but from
> >>the way it sounds, you just want to pull data from MySQL with a PHP
> >>script and output it to Flash.  The PHP script could just echo plain
> >>text and Flash can read that in just fine without needing to connect via
> >>a socket.
> >>-Ben
> >>
> >>Ben Ramsey wrote:
> >>
> >>
> >>>Flash has the ability to read in text files, so you could use PHP to
> >>>output data in the correct format and use Flash to read the PHP script
> >>>like it reads a text file.  We did this in ASP once upon a time.
> >>>
> >>>Here's a tutorial about reading text files into Flash:
> >>>http://www.virtual-fx.net/tutorials/html/loadtextfile.htm
> >>>
> >>>Also, from what I understand, Flash now has a great XML parser, so you
> >>>could use PHP to generate XML and Flash could read in the XML as
> >>>variables.  You might want to look into that, but I think it's only
> >>>available in the newest version.
> >>>
> >>>-Ben
> >>>
> >>>
> >>>Eric Bolikowski wrote:
> >>>
> >>>
> >>>>Hi everybody
> >>>>
> >>>>I'm working on a site that will be based on Flash, PHP and MySQL. PHP
> >>>>will
> >>>>work as a middleware for Flash and MySQL.
> >>>>
> >>>>My problem is communication between Flash and PHP.
> >>>>I'm really out looking for using the socket functions in PHP and Flash
> >
> > to
> >
> >>>>make fast connection.
> >>>>
> >>>>I have googled for almost an hour now, and I can't seem to find any
> >>>>interesting. The only info I find, is about sending data between Flash
> >>>>and
> >>>>PHP with HTTP GET or HTTP POST.
> >>>>
> >>>>So if anybody has some general information on this or a link to a
> >>>>tutorial
> >>>>on the subject, I would like to get those resources.
> >>>>
> >>>>Thanks a lot
> >>>>
> >>>>Eric

--- End Message ---
--- Begin Message ---
check out http://www.php.net/manual/en/ref.ircg.php

and

http://www.schumann.cx/ircg/


> I am doing the same thing at the moment,
>
> I'm building a Flash/PHP/MySQL chat system capable of handling over
> 1000 users online at one time.
>
> GET and POST just doesn't cut it, so I began to explore other avenues,
> and XML Socket's seem like the best and only option. But I expect to
> burn the midnight oil on this one.
>
> Marc
>
> "Ben Ramsey" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>> I guess that's good enough reason for me.  As far as connecting with
>> sockets, though: you should connect from Flash to the PHP file, not
>> from PHP to the Flash file, I think.  And, in order to do that, you
>> would need to ask some people who specialize in Flash and
>> ActionScript, so the boards at Macromedia.com may be the best place to
>> ask.
>>
>> Then again, I could be absolutely wrong. ;-)
>>
>> -Ben
>>
>>
>> Eric Bolikowski wrote:
>>
>> > Hey Ben
>> >
>> > I know it may sound nuts, but I really want to make a socket
>> > connection between a Flash and a PHP file.
>> >
>> > Normally I would simply read in a text file/read XML/send data with
>> > GET
> or
>> > POST, but I'm looking for a socket connections of following reasons:
>> >
>> > 1) I want a fast connection
>> > 2) I'm looking at this as a challenge, because it doesn't seem like
> anyone
>> > else has done this before
>> >
>> > Eric
>> >
>> > "Ben Ramsey" <[EMAIL PROTECTED]> wrote in message
>> > news:[EMAIL PROTECTED]
>> >
>> >>What I mean is: you shouldn't need to use sockets to read in a file
>> >>from Flash unless you're trying to do something more complicated,
>> >>but from the way it sounds, you just want to pull data from MySQL
>> >>with a PHP script and output it to Flash.  The PHP script could just
>> >>echo plain text and Flash can read that in just fine without needing
>> >>to connect via a socket.
>> >>-Ben
>> >>
>> >>Ben Ramsey wrote:
>> >>
>> >>
>> >>>Flash has the ability to read in text files, so you could use PHP
>> >>>to output data in the correct format and use Flash to read the PHP
>> >>>script like it reads a text file.  We did this in ASP once upon a
>> >>>time.
>> >>>
>> >>>Here's a tutorial about reading text files into Flash:
>> >>>http://www.virtual-fx.net/tutorials/html/loadtextfile.htm
>> >>>
>> >>>Also, from what I understand, Flash now has a great XML parser, so
>> >>>you could use PHP to generate XML and Flash could read in the XML
>> >>>as variables.  You might want to look into that, but I think it's
>> >>>only available in the newest version.
>> >>>
>> >>>-Ben
>> >>>
>> >>>
>> >>>Eric Bolikowski wrote:
>> >>>
>> >>>
>> >>>>Hi everybody
>> >>>>
>> >>>>I'm working on a site that will be based on Flash, PHP and MySQL.
>> >>>>PHP will
>> >>>>work as a middleware for Flash and MySQL.
>> >>>>
>> >>>>My problem is communication between Flash and PHP.
>> >>>>I'm really out looking for using the socket functions in PHP and
>> >>>>Flash
>> >
>> > to
>> >
>> >>>>make fast connection.
>> >>>>
>> >>>>I have googled for almost an hour now, and I can't seem to find
>> >>>>any interesting. The only info I find, is about sending data
>> >>>>between Flash and
>> >>>>PHP with HTTP GET or HTTP POST.
>> >>>>
>> >>>>So if anybody has some general information on this or a link to a
>> >>>>tutorial
>> >>>>on the subject, I would like to get those resources.
>> >>>>
>> >>>>Thanks a lot
>> >>>>
>> >>>>Eric
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message --- Use xmlReceiver to trigger the back end PHP script. Have that script generate XML which you parse in Flash. Plain text will work, but a single quotation mark in the text sends you off to never never land. Here's an example:

xmlReceiver.load( "http://"; + host + "feed_xml_article.php");

I know it's not a socket, but it's plenty fast.

Regards - Miles Thompson

PS What good would a socket to PHP do, anyway? (I probably just revealed my ignorance!) /mt

At 11:03 PM 1/20/2004 +0100, Eric Bolikowski wrote:
Hey Ben

I know it may sound nuts, but I really want to make a socket connection
between a Flash and a PHP file.

Normally I would simply read in a text file/read XML/send data with GET or
POST, but I'm looking for a socket connections of following reasons:

1) I want a fast connection
2) I'm looking at this as a challenge, because it doesn't seem like anyone
else has done this before

Eric

"Ben Ramsey" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> What I mean is: you shouldn't need to use sockets to read in a file from
> Flash unless you're trying to do something more complicated, but from
> the way it sounds, you just want to pull data from MySQL with a PHP
> script and output it to Flash.  The PHP script could just echo plain
> text and Flash can read that in just fine without needing to connect via
> a socket.
> -Ben
>
> Ben Ramsey wrote:
>
> > Flash has the ability to read in text files, so you could use PHP to
> > output data in the correct format and use Flash to read the PHP script
> > like it reads a text file.  We did this in ASP once upon a time.
> >
> > Here's a tutorial about reading text files into Flash:
> > http://www.virtual-fx.net/tutorials/html/loadtextfile.htm
> >
> > Also, from what I understand, Flash now has a great XML parser, so you
> > could use PHP to generate XML and Flash could read in the XML as
> > variables.  You might want to look into that, but I think it's only
> > available in the newest version.
> >
> > -Ben
> >
> >
> > Eric Bolikowski wrote:
> >
> >> Hi everybody
> >>
> >> I'm working on a site that will be based on Flash, PHP and MySQL. PHP
> >> will
> >> work as a middleware for Flash and MySQL.
> >>
> >> My problem is communication between Flash and PHP.
> >> I'm really out looking for using the socket functions in PHP and Flash
to
> >> make fast connection.
> >>
> >> I have googled for almost an hour now, and I can't seem to find any
> >> interesting. The only info I find, is about sending data between Flash
> >> and
> >> PHP with HTTP GET or HTTP POST.
> >>
> >> So if anybody has some general information on this or a link to a
> >> tutorial
> >> on the subject, I would like to get those resources.
> >>
> >> Thanks a lot
> >>
> >> Eric

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

--- End Message ---
--- Begin Message ---
As the subject says, I posted this bug report on the official php bugs
page http://bugs.php.net/bug.php?id=26950 and have now changed my
storing of user information to use cookies as such:

setcookie("cookie_auth_memberID", $row['id'], time()+604800,'/');
setcookie("cookie_auth_Username", $frmUsername, time()+604800,'/');
setcookie("cookie_auth_Password", $frmPassword, time()+604800,'/');
setcookie("cookie_auth_Group", $row['membergroup'], time()+604800,'/');

However anyway, on displaying my PHPSESSIONID in Internet Explorer 6, I
am now noticing that on the refresh of any page (by clicking on any
internal site link) the PHPSESSIONID is changing!???? This doesn't
happen in Mozilla or Opera, any ideas folks?

Top of each page looks like such:

session_save_path("/home/tazonlin/webs/www.planet-tolkien.com/sessions")
; 
session_start();

Regards,
 
Tarrant Costelloe

--- End Message ---
--- Begin Message ---
> As the subject says, I posted this bug report on the official php bugs
> page http://bugs.php.net/bug.php?id=26950 and have now changed my
> storing of user information to use cookies as such:
>
> setcookie("cookie_auth_memberID", $row['id'], time()+604800,'/');
> setcookie("cookie_auth_Username", $frmUsername, time()+604800,'/');
> setcookie("cookie_auth_Password", $frmPassword, time()+604800,'/');
> setcookie("cookie_auth_Group", $row['membergroup'], time()+604800,'/');
>
> However anyway, on displaying my PHPSESSIONID in Internet Explorer 6, I
> am now noticing that on the refresh of any page (by clicking on any
> internal site link) the PHPSESSIONID is changing!???? This doesn't
> happen in Mozilla or Opera, any ideas folks?
>

The only thing i have experienced is if you are calling session_start
twice ?



--- End Message ---
--- Begin Message ---
Nope, calling it once. For some odd reason as I have detailed here
http://bugs.php.net/bug.php?id=26950 IE is loosing all it's cookie data
on different clicks around the website. A piece at a time, however MOZ
and Opera are fine.

In Fellowship,
Tarrant 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: 21 January 2004 00:22
To: [EMAIL PROTECTED]
Subject: Re: [PHP] PHPSESSIONID altering each time the page is loaded in
IE


> As the subject says, I posted this bug report on the official php bugs

> page http://bugs.php.net/bug.php?id=26950 and have now changed my 
> storing of user information to use cookies as such:
>
> setcookie("cookie_auth_memberID", $row['id'], time()+604800,'/'); 
> setcookie("cookie_auth_Username", $frmUsername, time()+604800,'/'); 
> setcookie("cookie_auth_Password", $frmPassword, time()+604800,'/'); 
> setcookie("cookie_auth_Group", $row['membergroup'], 
> time()+604800,'/');
>
> However anyway, on displaying my PHPSESSIONID in Internet Explorer 6, 
> I am now noticing that on the refresh of any page (by clicking on any 
> internal site link) the PHPSESSIONID is changing!???? This doesn't 
> happen in Mozilla or Opera, any ideas folks?
>

The only thing i have experienced is if you are calling session_start
twice ?



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

--- End Message ---
--- Begin Message --- Hi,
I think mr chris w parker you have not read the manual or the list newbie guide.


I couldn't resist either :-)

Chris W. Parker wrote:

hello you,

i am here to ask of help from the mailing list.

i have PHP Codes like this kind:

echo "Welcome to my homepage Mom. See my brand new wife!":

I have problem with PHP Codes from above. Where to fix Codes?





:P
























Sorry I couldn't resist!!!






--
Raditha Dissanayake.
------------------------------------------------------------------------
http://www.radinks.com/sftp/         | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 150 KB | with progress bar.

--- End Message ---
--- Begin Message --- Chris W. Parker wrote:

hello you,

Hello me.


i am here to ask of help from the mailing list.

I think the mailing list is gone for the day. Try back tomorrow.


i have PHP Codes like this kind:

What's PHP?


echo "Welcome to my homepage Mom. See my brand new wife!":

You must echo out what happened to your old wife before you send new wife to the brower.


I have problem with PHP Codes from above. Where to fix Codes?

Joe's garage and PHP service station. They have specials on Friday's.


;)

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message ---
echo "Welcome to my homepage Mom. See my brand new wife!":


You must echo out what happened to your old wife before you send new wife to the brower.

If he kept the old wife, he needs to talk to both wives. If not, replacing the colon with a semicolon might help.



I have problem with PHP Codes from above. Where to fix Codes?


Joe's garage and PHP service station. They have specials on Friday's.

;)


--- End Message ---
--- Begin Message ---
I have my web site with file extensions .php .php3 .html .htm .shtml  Now i
(am looking for a script or) would like to write a php script so that users
can search my web site for information.... Can anyone help me get started.
I want to include a search in my web site..

--- End Message ---
--- Begin Message --- Student wrote:

I have my web site with file extensions .php .php3 .html .htm .shtml  Now i
(am looking for a script or) would like to write a php script so that users
can search my web site for information.... Can anyone help me get started.
I want to include a search in my web site..


Cross post bad. Mean people come and bite off your kneecaps.


--
By-Tor.com
It's all about the Rush
http://www.by-tor.com

--- End Message ---
--- Begin Message --- Hello,

On 01/20/2004 11:22 PM, Student wrote:
I have my web site with file extensions .php .php3 .html .htm .shtml  Now i
(am looking for a script or) would like to write a php script so that users
can search my web site for information.... Can anyone help me get started.
I want to include a search in my web site..

If you can install HTDig to index your site, you can use this class that will simplify your site interface to Htdig.



http://freshmeat.net/projects/htdiginterfacefromphp/


--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/

--- End Message ---
--- Begin Message ---
try removing the dot and /

so

if (is_file("filedir/test.txt")) echo "Found it!";
else echo "Not found";

that should work on windows and unix platforms, i dont think windows likes
the single dot, but you can use relative referencing, by just using the
directory name.

-- 
Luke
"Todd Cary" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> The \filedir is under the phpcode directory
>
> c:\webroot
>    |
>    |--\application
>       |
>       |--\php_code
>          |
>          |--\filedir
>
>
> Eric Bolikowski wrote:
>
> > "Todd Cary" <[EMAIL PROTECTED]> wrote in message
> > news:[EMAIL PROTECTED]
> >
> >>I moved an application from Linux to my Client's NT system and is_file
> >>cannot file the file on the NT system.  My directory structure is as
> >>follows:
> >>
> >>c:\webroot
> >>   \application
> >>     \php_code
> >>       \filedir
> >>
> >>The code is
> >>
> >
> > //two dots!
> >
> >>if (is_file("../filedir/test.txt")) echo "Found it!";
> >>else echo "Not found";
> >>
> >>This is working with Linux, but it does not work with NT.  Can someone
> >>tell me why it does not work?
> >>
> >>Todd

--- End Message ---
--- Begin Message ---
Hi,

Wednesday, January 21, 2004, 8:55:01 AM, you wrote:
JP> I am so frustrated at the moment with coding.  I had an odd error with
JP> some PHP coding.  And in the process I came across this error.

JP> Please try this out!! Because for me on my machine it does the first
JP> part of the if statement.  I can make a work around in my code to fix
JP> the error.  BUT I would rather know why this is evaluating incorrectly.

JP> <?PHP

JP>     $EA = 0;

JP>     if ($EA == "NFH")
JP>     {
JP>             echo "<br>EA is Equal To NFH see $EA<br>";
JP>     }
JP>     else
JP>     {
JP>             echo "<br>EA is NOT EQUAL to NFH see $EA<br>";
JP>     }
?>>

JP> Thanks in advance.


JP> Jonathan Pitcher


Try swapping positions

if("NFH" == $EA)

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
yeah its strange,

$test is equal to $test2,
$test is equal to $test3
but $test2 is not equal to $test3,

$test = "string";
$test2 = true;
$test3 = 0;
if($test == $test2){
 echo "hi";
}

somone tell me im wrong please? else thats seriously weird

-- 
Luke
<[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> i've never had a problem doing if ($var=="test") ??
>
> > I've come across this recently too. I think what's happening is that
> > PHP is converting "NFH" to an integer, which would be zero in this
> > case. Thus zero == zero is true...
> >
> > Try doing type checking too:
> > if ($EA === "NFH")
> >
> > Martin
> >

--- End Message ---
--- Begin Message ---
On Tue, 2004-01-20 at 22:39, Luke wrote:
> yeah its strange,
> 
> $test is equal to $test2,
> $test is equal to $test3
> but $test2 is not equal to $test3,
> 
> $test = "string";
> $test2 = true;
> $test3 = 0;
> if($test == $test2){
>  echo "hi";
> }
> 

Looks fine to me...

$test == $test2: $test is not an empty string and thus evaluates to
                 true.

$test == $test3: $test is converted to an integer to compare against
                 $test3. Conversion of $test to integer results in 0,
                 which happens to be equal to $test3

You should read the section on type juggling.

    http://ca2.php.net/language.types.type-juggling

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

--- End Message ---
--- Begin Message ---
ok, i read the section, but even so

if $a == $b
and $a == $c
then $b should be equal to $c

but php is saying otherwise?

this sounds confusing i want to try n get my head round it

a string equals a integer of zero, and a string equals true, but the reason
the bool doesnt equal the int is because when the string and int are
compared, the string is zero (because it has no numerical value)?

did that make sense? am i right?

-- 
Luke

"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tue, 2004-01-20 at 22:39, Luke wrote:
> > yeah its strange,
> >
> > $test is equal to $test2,
> > $test is equal to $test3
> > but $test2 is not equal to $test3,
> >
> > $test = "string";
> > $test2 = true;
> > $test3 = 0;
> > if($test == $test2){
> >  echo "hi";
> > }
> >
>
> Looks fine to me...
>
> $test == $test2: $test is not an empty string and thus evaluates to
>                  true.
>
> $test == $test3: $test is converted to an integer to compare against
>                  $test3. Conversion of $test to integer results in 0,
>                  which happens to be equal to $test3
>
> You should read the section on type juggling.
>
>     http://ca2.php.net/language.types.type-juggling
>
> 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.          |
> `------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
On Tue, 2004-01-20 at 23:00, Luke wrote:
> ok, i read the section, but even so
> 
> if $a == $b
> and $a == $c
> then $b should be equal to $c

No this is not true, since types conversions can be different between a
and b, a and c or between b and c. If you want the above logic to be
true then you must use === for equality based on type also.

> but php is saying otherwise?

PHPis following the rules of type conversion which are not necessarily
commutative (hope that's the right term).

> this sounds confusing i want to try n get my head round it
> 
> a string equals a integer of zero,

A non-numeric string equals 0 by the rules of string to integer type
conversion (that's not entirely true since I think the first numerical
portion is the part converted as per atoi()).

> and a string equals true, but the reason

A non empty string equals true according to the rules of string to
boolean type conversion, unless (I think) the string is '0'.

> the bool doesnt equal the int is because when the string and int are
> compared, the string is zero (because it has no numerical value)?

You are talking about bool, string and int with respect to a bool-int
equality check. This is confusing, only two values can be compared. From
what hat did you pull the string?

> did that make sense? am i right?

You didn't make sense :)

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

--- End Message ---
--- Begin Message ---
i think i got it now :)
i wont bother trying to explain my understanding, i think that will confuse
the matter hehe

but i think mainly the usual rule, that if an apple and a banana are fruit,
and a pear is the same as a banana, then a pear must be fruit too (AND I
think im fruit loops....)

bah im goin bananas, its time to go to band practise anyways,

-- 
Luke

"Robert Cummings" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Tue, 2004-01-20 at 23:00, Luke wrote:
> > ok, i read the section, but even so
> >
> > if $a == $b
> > and $a == $c
> > then $b should be equal to $c
>
> No this is not true, since types conversions can be different between a
> and b, a and c or between b and c. If you want the above logic to be
> true then you must use === for equality based on type also.
>
> > but php is saying otherwise?
>
> PHPis following the rules of type conversion which are not necessarily
> commutative (hope that's the right term).
>
> > this sounds confusing i want to try n get my head round it
> >
> > a string equals a integer of zero,
>
> A non-numeric string equals 0 by the rules of string to integer type
> conversion (that's not entirely true since I think the first numerical
> portion is the part converted as per atoi()).
>
> > and a string equals true, but the reason
>
> A non empty string equals true according to the rules of string to
> boolean type conversion, unless (I think) the string is '0'.
>
> > the bool doesnt equal the int is because when the string and int are
> > compared, the string is zero (because it has no numerical value)?
>
> You are talking about bool, string and int with respect to a bool-int
> equality check. This is confusing, only two values can be compared. From
> what hat did you pull the string?
>
> > did that make sense? am i right?
>
> You didn't make sense :)
>
> 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.          |
> `------------------------------------------------------------'

--- End Message ---
--- Begin Message ---
On Wednesday 21 January 2004 12:27, Luke wrote:

> but i think mainly the usual rule, that if an apple and a banana are fruit,
> and a pear is the same as a banana, then a pear must be fruit too (AND I
> think im fruit loops....)
>
> bah im goin bananas, its time to go to band practise anyways,

All non-GM oranges are orange ==> TRUE
All objects that are orange are oranges ==> FALSE

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Watch all-night Donna Reed reruns until your mind resembles oatmeal.
*/

--- End Message ---
--- Begin Message ---
[snip]
> Interesting. I wouldn't have expected that. However, that is how it
> should work. Check out table K-2 on this page:
>
> http://us4.php.net/manual/en/types.comparisons.php
>
> '==' is a loose comparison. You can use '===' instead which will give
> you the results you are looking for.
>
> if ($EA === "NFH")
>

Hmm after all this time, are you saying its best to use === instead of
==
in any application ?
[/snip]

For strings, yes. And you should also re-order the question ...

if("NFH" === $EA)

Why, you ask? Because this will prevent possible assignment errors. If
you accidentally type

if($EA = "NFH") 

NFH gets assigned to $EA and is true...you might not see the error until
quite a bit later. However if you accidentally type

if("NFH" = $EA)

an error will get thrown right away.

--- End Message ---
--- Begin Message ---
This works like a charm on JPG, haven't tried it on other files types. This
came from the www.php.net


function image_createThumb($src,$dest,$maxWidth,$maxHeight,$quality=100) {
   if (file_exists($src)  && isset($dest)) {
       // path info
       $destInfo  = pathInfo($dest);

       // image src size
       $srcSize  = getImageSize($src);

       // image dest size $destSize[0] = width, $destSize[1] = height
       $srcRatio  = $srcSize[0]/$srcSize[1]; // width/height ratio
       $destRatio = $maxWidth/$maxHeight;
       if ($destRatio > $srcRatio) {
           $destSize[1] = $maxHeight;
           $destSize[0] = $maxHeight*$srcRatio;
       }
       else {
           $destSize[0] = $maxWidth;
           $destSize[1] = $maxWidth/$srcRatio;
       }

       // path rectification
       if ($destInfo['extension'] == "gif") {
           $dest = substr_replace($dest, 'jpg', -3);
       }

       // true color image, with anti-aliasing
       $destImage = imageCreateTrueColor($destSize[0],$destSize[1]);

//CAE       imageAntiAlias($destImage,true);

       // src image
       switch ($srcSize[2]) {
           case 1: //GIF
           $srcImage = imageCreateFromGif($src);
           break;

           case 2: //JPEG
           $srcImage = imageCreateFromJpeg($src);
           break;

           case 3: //PNG
           $srcImage = imageCreateFromPng($src);
           break;

           default:
           return false;
           break;
       }

       // resampling
       imageCopyResampled($destImage, $srcImage, 0, 0, 0,
0,$destSize[0],$destSize[1],$srcSize[0],$srcSize[1]);

       // generating image
       switch ($srcSize[2]) {
           case 1:
           case 2:
           imageJpeg($destImage,$dest,$quality);
           break;

           case 3:
           imagePng($destImage,$dest);
           break;
       }
       return true;
   }
   else {
       return false;
   }
}
//// Calling code

     if ($photosize >= 102400 ) {
        $blReduce = true;
     }
     // reduce the size of a file down to 720x720 pixels at 80% quality
     if ($blReduce) {
        image_createThumb($src,$src,720,720,80);
     }

    //Create a thumbnail were the maximum width or height is 100 pixels at
100% quality
    // $src is the full path/filename of the large jpg file
   //$desc is the full path/filename of the thumbnail to be created
    image_createThumb($src,$dest,100,100,100);




----- Original Message ----- 
From: "Matt Matijevich" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, January 20, 2004 6:24 PM
Subject: Re: [PHP] thumbnail


> [snip]
> OK, but how? I already use GD, I need to now how to create a thumbnail,
>
> somebody now how to use the GD functions to create a thumbnail???
> [/snip]
>
> http://www.php.net/GD
>
> I think you want to look at:
> imagecopyresampled -- Copy and resize part of an image with resampling
> imagecopyresized -- Copy and resize part of an image
>
> or try this pear class  http://pear.php.net/package/Image_Transform
> like <[EMAIL PROTECTED]> suggested.
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I'm trying to install IRCG as an extension to my Apache 2 PHP server running
on Windows XP. Trouble is IRCG for windows comes as a standalone package,
that doesn't seem to load in as an extension to php declaired in php.ini.

I've typed in all the extensions but i continue to get an error for each dll
that the module can not be found.

Has anyone installed IRCG as an extension for windows?

Marc

--- End Message ---
--- Begin Message ---
Yeah, i think i mentioned the same thing(or was going to :/ )

you should be able to use the local filesystem, and reffer to it relatively!
and then you can stream it and you wont need any authentication, and noone
will be able to directly link to the file

-- 
Luke

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Wednesday 21 January 2004 05:49, Scott Taylor wrote:
>
> Please trim your posts!
>
> > Of course there is not problem if the user is entering the information
> > him or her self.  But just using this code:
> >
> >         $file = 'http://miningstocks.com/protected/Dec03PostPress.pdf';
> >
> >         //now view the PDF file
> >         header("Content-Type: application/pdf");
> >         header("Accept-Ranges: bytes");
> >         header("Content-Length: ".filesize($file));
> >         readfile($file);
> >
> > from a PHP page where no authentication has occured does not work at
all.
>
> Did you not read my reply to your previous thread about this? Use a local
> filesystem path to read the file.
>
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.biz
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> ------------------------------------------
> Search the list archives before you post
> http://marc.theaimsgroup.com/?l=php-general
> ------------------------------------------
> /*
> "A dirty mind is a joy forever."
> -- Randy Kunkee
> */

--- End Message ---
--- Begin Message ---
A: How can i send an email with the contents of a table

B: can it be sent automatically when a certain field has data.

--- End Message ---
--- Begin Message ---
On Wednesday 21 January 2004 11:46, BigMark wrote:
> A: How can i send an email with the contents of a table

Assuming a database table:

1) query database
2) format results into a nice string
3) mail() it

> B: can it be sent automatically when a certain field has data.

Yes.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
------------------------------------------
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
------------------------------------------
/*
Blessed is he who expects no gratitude, for he shall not be disappointed.
                -- W.C. Bennett
*/

--- End Message ---
--- Begin Message ---
Is this possible?

I'm purely interested in PHP5 examples of transforming an XML file into PDF
using an XSL stylesheet.

Thanks.

--- End Message ---
--- Begin Message --- pw wrote:
I can't use the php module because a third party application
requires php to be available via CGI.

CGI or CLI? I'm betting on the latter because I'm not aware of any feature a script could require that is only provided by the PHP executable and not the module. In which case you can have both the module and the CLI version running at the same time.


--
Stuart

--- End Message ---
--- Begin Message ---
I have a FORM for entering data into a DB.

I use:
...
...
if ($_POST['submit'] == 'Register') {
...
code for INSERT into DB.

This works OK, but if I REFRESH the page, it  duplicates the "dataset" in
the table.

How can I reset  $_POST['submit']  so it don't make this happen?

Rgds
Reidar Solberg

--- End Message ---
--- Begin Message ---
Hi

What is the primary key in your tble? Using tht primary key check for duplicate 
entry... Theres no way u can change the posted data ... so even if u reset 
$_POST['submit']  after the insert operation is done, next time u refresh it will be 
set and hence will duplicate...so check for duplicate entries urself only based on 
primary key or unique values in ur table.

Hope this helps

Cheers
Binay

U wrote..
<
I have a FORM for entering data into a DB.

I use:
...
...
if ($_POST['submit'] == 'Register') {
...
code for INSERT into DB.

This works OK, but if I REFRESH the page, it  duplicates the "dataset" in
the table.

How can I reset  $_POST['submit']  so it don't make this happen?

Rgds
Reidar Solberg
>

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


--- End Message ---
--- Begin Message ---
You can use a token to check if a form has been sent before...

<?
class formReload {

 var $tokenarray = '__token';
 var $tokenname = '__token';

 function createToken()
 {
  $tok = md5(uniqid("mytoken"));
  return sprintf("<input type='hidden' name='%s'
value='%s'>",$this->tokenname,htmlspecialchars($tok));
 }

 function easyCheck()
 {
  $tok = $_REQUEST[$this->tokenname];
  if (isset($_SESSION[$this->tokenarray][$tok]))
  {
   return false;
  }
  else
  {
   $_SESSION[$this->tokenarray][$tok] = true;
   return true;
  }
 }
}
?>

hth

toby


----- Original Message -----
From: "Binay" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Reidar Solberg" <[EMAIL PROTECTED]>
Sent: Wednesday, January 21, 2004 9:23 AM
Subject: Re: [PHP] Problems with $_POST


Hi

What is the primary key in your tble? Using tht primary key check for
duplicate entry... Theres no way u can change the posted data ... so even if
u reset $_POST['submit']  after the insert operation is done, next time u
refresh it will be set and hence will duplicate...so check for duplicate
entries urself only based on primary key or unique values in ur table.

Hope this helps

Cheers
Binay

U wrote..
<
I have a FORM for entering data into a DB.

I use:
...
...
if ($_POST['submit'] == 'Register') {
...
code for INSERT into DB.

This works OK, but if I REFRESH the page, it  duplicates the "dataset" in
the table.

How can I reset  $_POST['submit']  so it don't make this happen?

Rgds
Reidar Solberg
>

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

--- End Message ---
--- Begin Message ---
Or,

After you've dumped the data into the DB, issue a header('location:
/path/to/script');

This will also solve the problem of IE saying "are you sure you want to
resend the form data".


"Toby Irmer" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> You can use a token to check if a form has been sent before...
>
> <?
> class formReload {
>
>  var $tokenarray = '__token';
>  var $tokenname = '__token';
>
>  function createToken()
>  {
>   $tok = md5(uniqid("mytoken"));
>   return sprintf("<input type='hidden' name='%s'
> value='%s'>",$this->tokenname,htmlspecialchars($tok));
>  }
>
>  function easyCheck()
>  {
>   $tok = $_REQUEST[$this->tokenname];
>   if (isset($_SESSION[$this->tokenarray][$tok]))
>   {
>    return false;
>   }
>   else
>   {
>    $_SESSION[$this->tokenarray][$tok] = true;
>    return true;
>   }
>  }
> }
> ?>
>
> hth
>
> toby
>
>
> ----- Original Message -----
> From: "Binay" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; "Reidar Solberg" <[EMAIL PROTECTED]>
> Sent: Wednesday, January 21, 2004 9:23 AM
> Subject: Re: [PHP] Problems with $_POST
>
>
> Hi
>
> What is the primary key in your tble? Using tht primary key check for
> duplicate entry... Theres no way u can change the posted data ... so even
if
> u reset $_POST['submit']  after the insert operation is done, next time u
> refresh it will be set and hence will duplicate...so check for duplicate
> entries urself only based on primary key or unique values in ur table.
>
> Hope this helps
>
> Cheers
> Binay
>
> U wrote..
> <
> I have a FORM for entering data into a DB.
>
> I use:
> ...
> ...
> if ($_POST['submit'] == 'Register') {
> ...
> code for INSERT into DB.
>
> This works OK, but if I REFRESH the page, it  duplicates the "dataset" in
> the table.
>
> How can I reset  $_POST['submit']  so it don't make this happen?
>
> Rgds
> Reidar Solberg
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

--- End Message ---
--- Begin Message ---
2004-01-20 kl. 10.41 skrev Dagfinn Reiersøl:


[EMAIL PROTECTED] wrote:

$string = 'ab12345-1';
if (preg_match('/^([a-zåäö]{2,3})([0-9]{4,5}(\-[0-9]{1,2}){0,1})$/i',
$string,
$m='')) {
  echo $m[1]; // -> ab
  echo $m[2]; // -> 12345-1
}

g. martin luethi

You can replace {0,1} with a question mark and [0-9] with \d (digit). Also, and I
think this is not in the PHP documentation, you can use POSIX character classes
inside the brackets. If you want to match alphabetical characters including
the Swedish and various other international ones like æ or ü, you can use [:alpha:].
You may not need it in this example, but it's excellent for internationalized regex matching.


if (preg_match('/^([[:alpha:]]{2,3})(\d{4,5}(\-\d{1,2})?)$/i',

Have been playing around a bit with this code, but I can't get it to work with international characters… For example, if I feed my function:


function split_bokid($bokid)
{
if (preg_match('/^([a-zåäö]{2,3})([0-9]{4,5}(\-[0-9]{1,2}){0,1})$/ i',$bokid,$m='')) {
return $m;
}
else
{
return false;
}
}


returns, with the following code:

        $test = split_bokid("ääö123");
        echo $test[1];
        echo $test[2];

the values:
        ŠŠš
        12345

So, is there any way I can set the encoding on the incoming values, which will come from url's and databases, so that they don't fuck up?

Sincerely,

Victor
--- End Message ---
--- Begin Message ---
Hi,
 
I want to use the mcrypt module and I followed the instructions to install the dll for 
Win32 users :
I copied the libmcrypt.dll file under c:\winnt\system32
I uncommented the  "extension=php_mcrypt.dll" in the php.ini
I restarted the computer
 
I tried many examples available in the Net. The result is always the same : 
I can crypt a plain text but I cannot Uncrypt that text. Do you see any potential 
reason to this?
I guess this problem is related to my computer / configuration...
 
current config 
PHP 4.3.4
Win 2000
PEAR
 
 
php in fo seems correct about mcrypt

--- End Message ---
--- Begin Message ---
Hi,

Wednesday, January 21, 2004, 9:09:40 PM, you wrote:
VD> Hi,
 
VD> I want to use the mcrypt module and I followed the
VD> instructions to install the dll for Win32 users :
VD> I copied the libmcrypt.dll file under c:\winnt\system32
VD> I uncommented the  "extension=php_mcrypt.dll" in the php.ini
VD> I restarted the computer
 
VD> I tried many examples available in the Net. The result is always the same :
VD> I can crypt a plain text but I cannot Uncrypt that text. Do
VD> you see any potential reason to this?
VD> I guess this problem is related to my computer / configuration...
 
VD> current config 
VD> PHP 4.3.4
VD> Win 2000
VD> PEAR
 
 
VD> php in fo seems correct about mcrypt

It seems they changed the name of the deinit function in windows, use

mcrypt_generic_end($td);

instead  of
mcrypt_generic_deinit($td);

-- 
regards,
Tom

--- End Message ---
--- Begin Message ---
[snip]
I use the pdf class from

http://www.potentialtech.com

Todd
[/snip]

There are built-in PDF functions http://us4.php.net/pdf and others use
the class from http://www.fpdf.org

--- End Message ---
--- Begin Message ---
I want to develop a friendster like program in php. I've searched the net to
see if there are any similar programs or projects but I have not found
anything.  

Anybody seen or come across any programs or projects for developing a
friendster like community?

--- End Message ---

Reply via email to