php-general Digest 6 Oct 2009 07:44:11 -0000 Issue 6376

Topics (messages 298618 through 298630):

Re: a trivial little function (PostToHost)
        298618 by: Kirk.Johnson.zootweb.com

Re: Self-Process php forms or not?
        298619 by: Manuel Lemos

How do YOU set default function/method params?
        298620 by: Jim Lucas
        298622 by: Eddie Drapkin
        298624 by: Jim Lucas
        298627 by: paragasu
        298628 by: Mert Oztekin
        298629 by: Jim Lucas

Re: SWF Manipulation with PHP
        298621 by: Manuel Lemos

Re: sending HTML email
        298623 by: Manuel Lemos

Re: A really wacky design decision
        298625 by: clancy_1.cybec.com.au

Re: Spry, XML, PHP and XSLT Hell
        298626 by: Andrew Mason
        298630 by: Tommy Pham

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
tedd <tedd.sperl...@gmail.com> wrote on 10/05/2009 01:44:00 PM:

[snip]
 
> Hi Kirk:
> 
> Okay, but what specifically is that script?
> 
> I have written a script at server B to print_r($_POST), but I don't 
> get anything other than log errors (see below*).
> 
> Here's an example:
> 
> http://www.webbytedd.com/aa/send-form/index.php
> 
> You can enter anything into the webbytedd.com form (Server A) and 
> click submit, but the php1.net form (Server B) won't show anything -- 
> what am I doing wrong?
> 
> Cheers,
> 
> tedd
> 
> * Log errors: [05-Oct-2009 15:08:54] PHP Warning:  PHP Startup: 
> mm_create(0, /session_mm_cgi-fcgi522) failed, err mm:core: failed to 
> open semaphore file (Permission denied) in Unknown on line 0

I am not familiar with this PHP error. Was this on server B? With "PHP 
Startup" in the error message, it looks like a setup problem on server B, 
rather than being related to the PostToHost operation.

Once that error is cleared up, start simple for the PostToHost piece. Just 
have the script on server B return "hello,world!", then echo out that 
response in the script on server A. The PostToHost function you found is 
correct. Make sure you are passing in valid arguments, so that you end up 
with a valid HTTP POST message.

Kirk

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

on 10/05/2009 03:02 PM Philip Thompson said the following:
>>> I try to avoid the use of hidden form elements as much as possible,
>>> especially for tracking whether a user has submitted a form or not...
>>>
>>> I use name="submit" for the submit button instead, that will pass the
>>> value of the submit button to the action script.
>>>
>>> above all i use a template engine, smarty to take care of the
>>> presentation for me(like deciding whether to show the form and/or a
>>> success/failure message)
>>
>> That only works if the user clicks on that submit button. If the user
>> hits the enter key in a text input, the form is submitted but the submit
>> input variable is not set. That is why an hidden input is a safer
>> solution.
> 
> If you need the button to be *clicked*...
> 
> <form onsubmit="$('submitButton').fireEvent('click');" ...>
> 
> Or something along those lines.

That does not make much sense and is pointless. First that syntax you
mentioned probably requires JQuery or some other large Javascript
library. something like this['submitButton'].click() would emulate the
click event. Second, by the time that onsubmit is called, the event that
 triggered it was already dispatched. Emulating the click on a button
would probably fire the form submission and onsubmit code would be run
again, leading to an infinite loop sucking machine CPU.


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

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

--- End Message ---
--- Begin Message ---
Here is a problem that I have had for years now.  I have been trying to come up
with the perfect solution for this problem.  But, I have come down to two
different methods for solving it.

Here is the problem...

<?php

function sendEmail(
    $to,
    $from,
    $subject,
    $body,
    $attachments=array(),
    $headers=array()
    ) { # I typically do not put each argument on seperate lines, but I ran
        #out of width in this email...

    # do something here...
    mail(...);

}

sendEmail('j...@doe.com',
    'maryk...@uhhh.net',
    'Hi!',
    'Check out my new pictures!!!',
    $hash_array_of_pictures
    );

Now, we all have a function or method like this floating around somewhere.

My question is, how do YOU go about setting the required entries of the $headers
array() ?

I see three possible solutions.  I want to see a clean and simple solution.

Here are my ideas so far:

function sendEmail(
    $to,
    $from,
    $subject,
    $body,
    $attachments=array(),
    $headers=array()
    ) { # I typically do not put each argument on seperate lines, but I ran
        #out of width in this email...

    if ( empty($headers['Date']) ) {
        $headers['Date'] = date('c');
    }
    if ( empty($headers['Message-ID']) ) {
        $headers['Date'] = md5($to.$subject);
    }
    # and the example goes on...

    # do something here...
    mail(...);

}

Or, another example.  (I will keep it to the guts of the solution now)

    $headers['Date']       = empty($headers['Date']) ?
                             date('c') : $headers['Date'];
    $headers['Message-ID'] = empty($headers['Message-ID']) ?
                             md5($to.$subject) : $headers['Message-ID'];

OR, yet another example...

$defaults = array(
    'Date'       => date('c'),
    'Message-ID' => md5($to.$subject),
);

$headers += $defaults;

END of examples...

Now, IMO, the last one is the simplest one and for me, I think it will be the
new way that I solve this type of problem.

But, my question that I put out to all of you is...

        How would you solve this problem?

TIA

Jim Lucas

--- End Message ---
--- Begin Message ---
On Mon, Oct 5, 2009 at 8:48 PM, Jim Lucas <li...@cmsws.com> wrote:
> Here is a problem that I have had for years now.  I have been trying to come 
> up
> with the perfect solution for this problem.  But, I have come down to two
> different methods for solving it.
>
> Here is the problem...
>
> <?php
>
> function sendEmail(
>    $to,
>    $from,
>    $subject,
>    $body,
>    $attachments=array(),
>    $headers=array()
>    ) { # I typically do not put each argument on seperate lines, but I ran
>        #out of width in this email...
>
>    # do something here...
>    mail(...);
>
> }
>
> sendEmail('j...@doe.com',
>    'maryk...@uhhh.net',
>    'Hi!',
>    'Check out my new pictures!!!',
>    $hash_array_of_pictures
>    );
>
> Now, we all have a function or method like this floating around somewhere.
>
> My question is, how do YOU go about setting the required entries of the 
> $headers
> array() ?
>
> I see three possible solutions.  I want to see a clean and simple solution.
>
> Here are my ideas so far:
>
> function sendEmail(
>    $to,
>    $from,
>    $subject,
>    $body,
>    $attachments=array(),
>    $headers=array()
>    ) { # I typically do not put each argument on seperate lines, but I ran
>        #out of width in this email...
>
>    if ( empty($headers['Date']) ) {
>        $headers['Date'] = date('c');
>    }
>    if ( empty($headers['Message-ID']) ) {
>        $headers['Date'] = md5($to.$subject);
>    }
>    # and the example goes on...
>
>    # do something here...
>    mail(...);
>
> }
>
> Or, another example.  (I will keep it to the guts of the solution now)
>
>    $headers['Date']       = empty($headers['Date']) ?
>                             date('c') : $headers['Date'];
>    $headers['Message-ID'] = empty($headers['Message-ID']) ?
>                             md5($to.$subject) : $headers['Message-ID'];
>
> OR, yet another example...
>
> $defaults = array(
>    'Date'       => date('c'),
>    'Message-ID' => md5($to.$subject),
> );
>
> $headers += $defaults;
>
> END of examples...
>
> Now, IMO, the last one is the simplest one and for me, I think it will be the
> new way that I solve this type of problem.
>
> But, my question that I put out to all of you is...
>
>        How would you solve this problem?
>
> TIA
>
> Jim Lucas
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

How does this look to you?

function sendEmail(
        $to,
        $from,
        $subject,
        $body,
        $attachments=array(),
        $headers=array()
        ) {
        # I typically do not put each argument on seperate lines, but I ran
    #out of width in this email...

        $default_headers = array(
                'Date' => date('c'),
                'Message-ID' => md5($to.$subject)
        );

   $headers = array_merge($default_headers, $headers);
   # and the example goes on...

   # do something here...
   mail(...);

}

--- End Message ---
--- Begin Message ---
Eddie Drapkin wrote:
On Mon, Oct 5, 2009 at 8:48 PM, Jim Lucas <li...@cmsws.com> wrote:
Here is a problem that I have had for years now.  I have been trying to come up
with the perfect solution for this problem.  But, I have come down to two
different methods for solving it.

Here is the problem...

<?php

function sendEmail(
   $to,
   $from,
   $subject,
   $body,
   $attachments=array(),
   $headers=array()
   ) { # I typically do not put each argument on seperate lines, but I ran
       #out of width in this email...

   # do something here...
   mail(...);

}

sendEmail('j...@doe.com',
   'maryk...@uhhh.net',
   'Hi!',
   'Check out my new pictures!!!',
   $hash_array_of_pictures
   );

Now, we all have a function or method like this floating around somewhere.

My question is, how do YOU go about setting the required entries of the $headers
array() ?

I see three possible solutions.  I want to see a clean and simple solution.

Here are my ideas so far:

function sendEmail(
   $to,
   $from,
   $subject,
   $body,
   $attachments=array(),
   $headers=array()
   ) { # I typically do not put each argument on seperate lines, but I ran
       #out of width in this email...

   if ( empty($headers['Date']) ) {
       $headers['Date'] = date('c');
   }
   if ( empty($headers['Message-ID']) ) {
       $headers['Date'] = md5($to.$subject);
   }
   # and the example goes on...

   # do something here...
   mail(...);

}

Or, another example.  (I will keep it to the guts of the solution now)

   $headers['Date']       = empty($headers['Date']) ?
                            date('c') : $headers['Date'];
   $headers['Message-ID'] = empty($headers['Message-ID']) ?
                            md5($to.$subject) : $headers['Message-ID'];

OR, yet another example...

$defaults = array(
   'Date'       => date('c'),
   'Message-ID' => md5($to.$subject),
);

$headers += $defaults;

END of examples...

Now, IMO, the last one is the simplest one and for me, I think it will be the
new way that I solve this type of problem.

But, my question that I put out to all of you is...

       How would you solve this problem?

TIA

Jim Lucas

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



How does this look to you?

function sendEmail(
        $to,
        $from,
        $subject,
        $body,
        $attachments=array(),
        $headers=array()
        ) {
        # I typically do not put each argument on seperate lines, but I ran
    #out of width in this email...

        $default_headers = array(
                'Date' => date('c'),
                'Message-ID' => md5($to.$subject)
        );

   $headers = array_merge($default_headers, $headers);
   # and the example goes on...

   # do something here...
   mail(...);

}


Good, since it is a combination of the examples I gave.

I am looking at how you would solve the problem. Unless this is the way you would solve the problem.. :-D

Jim

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

--- End Message ---
--- Begin Message ---
why bother, i use available good library

http://swiftmailer.org/



On 10/6/09, Jim Lucas <li...@cmsws.com> wrote:
> Eddie Drapkin wrote:
>> On Mon, Oct 5, 2009 at 8:48 PM, Jim Lucas <li...@cmsws.com> wrote:
>>> Here is a problem that I have had for years now.  I have been trying to
>>> come up
>>> with the perfect solution for this problem.  But, I have come down to two
>>> different methods for solving it.
>>>
>>> Here is the problem...
>>>
>>> <?php
>>>
>>> function sendEmail(
>>>    $to,
>>>    $from,
>>>    $subject,
>>>    $body,
>>>    $attachments=array(),
>>>    $headers=array()
>>>    ) { # I typically do not put each argument on seperate lines, but I
>>> ran
>>>        #out of width in this email...
>>>
>>>    # do something here...
>>>    mail(...);
>>>
>>> }
>>>
>>> sendEmail('j...@doe.com',
>>>    'maryk...@uhhh.net',
>>>    'Hi!',
>>>    'Check out my new pictures!!!',
>>>    $hash_array_of_pictures
>>>    );
>>>
>>> Now, we all have a function or method like this floating around
>>> somewhere.
>>>
>>> My question is, how do YOU go about setting the required entries of the
>>> $headers
>>> array() ?
>>>
>>> I see three possible solutions.  I want to see a clean and simple
>>> solution.
>>>
>>> Here are my ideas so far:
>>>
>>> function sendEmail(
>>>    $to,
>>>    $from,
>>>    $subject,
>>>    $body,
>>>    $attachments=array(),
>>>    $headers=array()
>>>    ) { # I typically do not put each argument on seperate lines, but I
>>> ran
>>>        #out of width in this email...
>>>
>>>    if ( empty($headers['Date']) ) {
>>>        $headers['Date'] = date('c');
>>>    }
>>>    if ( empty($headers['Message-ID']) ) {
>>>        $headers['Date'] = md5($to.$subject);
>>>    }
>>>    # and the example goes on...
>>>
>>>    # do something here...
>>>    mail(...);
>>>
>>> }
>>>
>>> Or, another example.  (I will keep it to the guts of the solution now)
>>>
>>>    $headers['Date']       = empty($headers['Date']) ?
>>>                             date('c') : $headers['Date'];
>>>    $headers['Message-ID'] = empty($headers['Message-ID']) ?
>>>                             md5($to.$subject) : $headers['Message-ID'];
>>>
>>> OR, yet another example...
>>>
>>> $defaults = array(
>>>    'Date'       => date('c'),
>>>    'Message-ID' => md5($to.$subject),
>>> );
>>>
>>> $headers += $defaults;
>>>
>>> END of examples...
>>>
>>> Now, IMO, the last one is the simplest one and for me, I think it will be
>>> the
>>> new way that I solve this type of problem.
>>>
>>> But, my question that I put out to all of you is...
>>>
>>>        How would you solve this problem?
>>>
>>> TIA
>>>
>>> Jim Lucas
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>>
>>
>> How does this look to you?
>>
>> function sendEmail(
>>      $to,
>>      $from,
>>      $subject,
>>      $body,
>>      $attachments=array(),
>>      $headers=array()
>>      ) {
>>      # I typically do not put each argument on seperate lines, but I ran
>>     #out of width in this email...
>>
>>      $default_headers = array(
>>              'Date' => date('c'),
>>              'Message-ID' => md5($to.$subject)
>>      );
>>
>>    $headers = array_merge($default_headers, $headers);
>>    # and the example goes on...
>>
>>    # do something here...
>>    mail(...);
>>
>> }
>>
>
> Good, since it is a combination of the examples I gave.
>
> I am looking at how you would solve the problem.  Unless this is the way you
> would solve the
> problem.. :-D
>
> Jim
>
> --
> Jim Lucas
>
>     "Some men are born to greatness, some achieve greatness,
>         and some have greatness thrust upon them."
>
> Twelfth Night, Act II, Scene V
>      by William Shakespeare
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
IMO, array_merge() is easy to use, however it suppose to use more cpu than 
other options. If you are a performance freak, i suggest you to not choose 
array_merge() solution. (also you execute date() and md5() functions even if 
you wont need to use them)

In the other way, I think first option (with if() ones) seems more readable 
than other ones.

-----Original Message-----
From: Jim Lucas [mailto:li...@cmsws.com]
Sent: Tuesday, October 06, 2009 4:21 AM
To: Eddie Drapkin
Cc: php General List
Subject: Re: [PHP] How do YOU set default function/method params?

Eddie Drapkin wrote:
> On Mon, Oct 5, 2009 at 8:48 PM, Jim Lucas <li...@cmsws.com> wrote:
>> Here is a problem that I have had for years now.  I have been trying to come 
>> up
>> with the perfect solution for this problem.  But, I have come down to two
>> different methods for solving it.
>>
>> Here is the problem...
>>
>> <?php
>>
>> function sendEmail(
>>    $to,
>>    $from,
>>    $subject,
>>    $body,
>>    $attachments=array(),
>>    $headers=array()
>>    ) { # I typically do not put each argument on seperate lines, but I ran
>>        #out of width in this email...
>>
>>    # do something here...
>>    mail(...);
>>
>> }
>>
>> sendEmail('j...@doe.com',
>>    'maryk...@uhhh.net',
>>    'Hi!',
>>    'Check out my new pictures!!!',
>>    $hash_array_of_pictures
>>    );
>>
>> Now, we all have a function or method like this floating around somewhere.
>>
>> My question is, how do YOU go about setting the required entries of the 
>> $headers
>> array() ?
>>
>> I see three possible solutions.  I want to see a clean and simple solution.
>>
>> Here are my ideas so far:
>>
>> function sendEmail(
>>    $to,
>>    $from,
>>    $subject,
>>    $body,
>>    $attachments=array(),
>>    $headers=array()
>>    ) { # I typically do not put each argument on seperate lines, but I ran
>>        #out of width in this email...
>>
>>    if ( empty($headers['Date']) ) {
>>        $headers['Date'] = date('c');
>>    }
>>    if ( empty($headers['Message-ID']) ) {
>>        $headers['Date'] = md5($to.$subject);
>>    }
>>    # and the example goes on...
>>
>>    # do something here...
>>    mail(...);
>>
>> }
>>
>> Or, another example.  (I will keep it to the guts of the solution now)
>>
>>    $headers['Date']       = empty($headers['Date']) ?
>>                             date('c') : $headers['Date'];
>>    $headers['Message-ID'] = empty($headers['Message-ID']) ?
>>                             md5($to.$subject) : $headers['Message-ID'];
>>
>> OR, yet another example...
>>
>> $defaults = array(
>>    'Date'       => date('c'),
>>    'Message-ID' => md5($to.$subject),
>> );
>>
>> $headers += $defaults;
>>
>> END of examples...
>>
>> Now, IMO, the last one is the simplest one and for me, I think it will be the
>> new way that I solve this type of problem.
>>
>> But, my question that I put out to all of you is...
>>
>>        How would you solve this problem?
>>
>> TIA
>>
>> Jim Lucas
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>>
>
> How does this look to you?
>
> function sendEmail(
>       $to,
>       $from,
>       $subject,
>       $body,
>       $attachments=array(),
>       $headers=array()
>       ) {
>       # I typically do not put each argument on seperate lines, but I ran
>     #out of width in this email...
>
>       $default_headers = array(
>               'Date' => date('c'),
>               'Message-ID' => md5($to.$subject)
>       );
>
>    $headers = array_merge($default_headers, $headers);
>    # and the example goes on...
>
>    # do something here...
>    mail(...);
>
> }
>

Good, since it is a combination of the examples I gave.

I am looking at how you would solve the problem.  Unless this is the way you 
would solve the
problem.. :-D

Jim

--
Jim Lucas

    "Some men are born to greatness, some achieve greatness,
        and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
     by William Shakespeare

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



  ________________________________
Bu mesaj ve ekleri, mesajda gönderildiği belirtilen kişi/kişilere özeldir ve 
gizlidir. Size yanlışlıkla ulaşmışsa lütfen gönderen kisiyi bilgilendiriniz ve 
mesajı sisteminizden siliniz. Mesaj ve eklerinin içeriği ile ilgili olarak 
şirketimizin herhangi bir hukuki sorumluluğu bulunmamaktadır. Şirketimiz 
mesajın ve bilgilerinin size değişikliğe uğrayarak veya geç ulaşmasından, 
bütünlüğünün ve gizliliğinin korunamamasından, virüs içermesinden ve bilgisayar 
sisteminize verebileceği herhangi bir zarardan sorumlu tutulamaz.

This message and attachments are confidential and intended for the 
individual(s) stated in this message. If you received this message in error, 
please immediately notify the sender and delete it from your system. Our 
company has no legal responsibility for the contents of the message and its 
attachments. Our company shall have no liability for any changes or late 
receiving, loss of integrity and confidentiality, viruses and any damages 
caused in anyway to your computer system.

--- End Message ---
--- Begin Message ---
paragasu wrote:
why bother, i use available good library

http://swiftmailer.org/


Ok, bad example. I already use SwiftMailer. My "problem" though has nothing to do with sending an email. I should have known someone would take it too literally.

Think a little more general.  This is not a specific thing to simply sending an 
email.

Could be database method calls from a class object, HTML CGI function, etc...

As for a different example. Say you had a function that you had to pass (multiple) arguments to. But, with those arguments, you had defaults that you would like to inside the function even if they were not sent when you called your function. But you do not want to be forced into entering ALL the arguments of a function call in a certain order.

Try this

function createHTMLBox($title, $content, $params=array() ) {

    $defaults = array(
        'id'     = uniq(),
        'class'  = 'box',
        'encode' = TRUE,
    );

    $params += $defaults;

    if ( $params['encode'] ) {
        $title   = htmlspecialchars($title);
        $content = htmlspecialchars($content);
    }

    # Obviously, I will be using the DomDocument class for this in the real 
world
    # But for simplicities sake, I used the following.
    $box = <<<BOX

<div id="{$params['id']}" class="{$params['class']}">
  <h4 class="boxTitleBar">{$title}</h4>
  <div class="boxContent">{$content}</div>
</div>

BOX;

    return $box;

}


Then, I call it like this:

echo createHTMLBox('This is my TITLE',
               '<ul><li>Item 1</li><li>Item 2</li></ul>',
               array('encode' => FALSE));

echo createHTMLBox('This is my TITLE',
               '<ul><li>Item 1</li><li>Item 2</li></ul>');

Both of the above will have different output to the screen.

Hope this clears things up.

--
Jim Lucas

   "Some men are born to greatness, some achieve greatness,
       and some have greatness thrust upon them."

Twelfth Night, Act II, Scene V
    by William Shakespeare

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

on 10/05/2009 11:52 AM Igor Escobar said the following:
> Hi Folks!
> 
> A very long time ago i spend a little bit of my time to find how i can load
> a swf file, load an specific frame of that SWF File and save this like a JPG
> or any other format.
> 
> I try the "ming" but it can't load a external swf movie. You only can CREATE
> a swf. I try the libswf too but i not have a success.
> 
> Anyone have ANY idea that works?

I wonder if it is something like this class that you are looking for:

http://www.phpclasses.org/swf_to_jpg

There are other PHP Flash solutions here:

http://www.phpclasses.org/browse/class/102.html

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

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

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

on 10/05/2009 11:27 AM John Corry said the following:
> I've inherited a PHP application, first task of which was relocating to a
> new server.
> We've installed and configured all of the files on a dedicated linux server
> at 1 and 1 (using qmail as an MTA).
> 
> Since the move, the client is complaining that *some* of the recipients of
> the HTML email that the server sends out to all of the users are receiving
> plain HTML code in their mail clients...not the nice, rendered, styled
> content they intend.
> 
> It looks fine to me.
> 
> I found one small error in the HTML that was sent and fixed it (there may be
> more)...
> 
> But the client is telling me that this is a new problem as of the server
> move.
> 
> Any suggestions which direction to look to try to resolve this?

You may want to take a look at this slide presentation. It is from a
talk precisely about issues that prevent messages from reaching the
destination:

http://www.phpclasses.org/browse/video/3/package/9.html

Look in special at slide 19, as it presents several reasons that may
make your messages be confused with spam.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

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

--- End Message ---
--- Begin Message ---
On Sun, 4 Oct 2009 14:52:36 +0200, an_...@hotmail.com (Andrea Giammarchi) wrote:

>
>
>
>>      $a = 2260; $b = 226e1; $c = 2.26e3; $d = 2260.0;
>> 
>>      $a==$b==$c==$d,
>> 
>> and
>>      $b===$c===$d
>
>$b , $c, and $d are the same indeed ... they represent the floating point 
>2260.0 in I think every language ... it's like saying that 1.0 is not 1.0000 
>... both floating point numbers, so I don't get your problem ...

IF they are actually floating point numbers. My problem is that I'm working 
with values
which are strings, but which sometimes look like either integers or floating 
point
numbers. And I apologise for falsely contradicting your previous message; I 
realised
subsequently that I had forgotten to specify the variables as strings in my 
test. Thus, if
I write:

        $a = 2260; $b = '2260'; the exact comparison returns 'false'.

The same applies to all the cases I had been complaining about, and the exact 
comparison
does indeed work as you stated. This piece of carelessness arose because my 
data is
represented in the simple form, eg:

A;e;21TH;AP;;;;Musical education;090701

but is implicitly converted into strings when it is entered.

(And I tend to be wary of determining the rules experimentally. I learned my 
programming
on CDC3200 Fortran fortysomething years ago. Manuals were brief and textbooks
non-existent, so whenever we were not sure of something we would try it. 
Unfortunately the
Fortran had some very strange design features, which we learnt about when our 
employer
upgraded to a CDC 6600. This used a much more standard Fortran, and many of the 
tricks we
had discovered no longer worked.)


--- End Message ---
--- Begin Message ---
On Tue, Oct 6, 2009 at 4:37 AM, Nathan Nobbe <quickshif...@gmail.com> wrote:
> On Mon, Oct 5, 2009 at 10:10 AM, Matthew Croud <m...@obviousdigital.com>wrote:
>
>> Hello,
>>
>> Is there anyone here who uses Spry with XML and PHP and understands XSLT,
>> At the moment i'm in development hell and have a rather bloated question to
>> ask someone who is knowledgeable in the above areas.
>>
>> My head is about to explode and I can't find any answers,
>> If there are Spry/XML folk here i'll spill the beans about my issue.
>>
>
> ive not used spry, but have the rest of the lot.., hell, i think we can give
> it a crack..; lay it on us brother ;)
>
> -nathan
>

I don't know what spry is but I use PHP and XSLT all the time.

--- End Message ---
--- Begin Message ---
----- Original Message ----
> From: Andrew Mason <slackma...@gmail.com>
> To: Nathan Nobbe <quickshif...@gmail.com>
> Cc: Matthew Croud <m...@obviousdigital.com>; PHP General list 
> <php-gene...@lists.php.net>
> Sent: Mon, October 5, 2009 8:56:12 PM
> Subject: Re: [PHP] Spry, XML, PHP and XSLT Hell
> 
> On Tue, Oct 6, 2009 at 4:37 AM, Nathan Nobbe wrote:
> > On Mon, Oct 5, 2009 at 10:10 AM, Matthew Croud wrote:
> >
> >> Hello,
> >>
> >> Is there anyone here who uses Spry with XML and PHP and understands XSLT,
> >> At the moment i'm in development hell and have a rather bloated question to
> >> ask someone who is knowledgeable in the above areas.
> >>
> >> My head is about to explode and I can't find any answers,
> >> If there are Spry/XML folk here i'll spill the beans about my issue.
> >>
> >
> > ive not used spry, but have the rest of the lot.., hell, i think we can give
> > it a crack..; lay it on us brother ;)
> >
> > -nathan
> >
> 
> I don't know what spry is but I use PHP and XSLT all the time.
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Spry is Adobe's AJAX framework similar to jQuery.  Are you having problems 
doing remote ajax call for xml data via Spry?


--- End Message ---

Reply via email to