OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
php-general Digest 30 Mar 2006 16:00:12 -0000 Issue 4043

php-general-digest-helplists.php.net
Date: Thu Mar 30 2006 - 10:00:12 CST


php-general Digest 30 Mar 2006 16:00:12 -0000 Issue 4043

Topics (messages 232883 through 232930):

Re: addslashes()
        232883 by: tedd
        232889 by: Curt Zirzow

PHP MVC
        232884 by: SLaVKa
        232885 by: Paul Scott
        232886 by: SLaVKa
        232887 by: Paul Scott

Re: A Problem!
        232888 by: Curt Zirzow
        232894 by: Barry
        232895 by: Curt Zirzow

QUARANTINED: Returned mail: see transcript for details
        232890 by: WorkgroupMail Content Filter

Re: IP Address Filtering
        232891 by: Curt Zirzow
        232920 by: Rahul S. Johari
        232921 by: Barry
        232922 by: Rahul S. Johari

Re: Download problems
        232892 by: Curt Zirzow

Re: Array Question again
        232893 by: Barry

parent constructor
        232896 by: SLaVKa
        232897 by: Jasper Bryant-Greene
        232898 by: Jochem Maas

Outputting text "<?" how to?
        232899 by: Merlin
        232900 by: nicolas figaro
        232901 by: Jasper Bryant-Greene
        232902 by: Hugh Danaher
        232924 by: tedd

Re: php error reporting problem
        232903 by: Ford, Mike
        232919 by: Ford, Mike

PHP and CakePHP
        232904 by: Pham Huu Le Quoc Phuc
        232907 by: chris smith
        232908 by: Pham Huu Le Quoc Phuc

Re: How to create RSS feeds with PHP?
        232905 by: Merlin
        232906 by: chris smith
        232909 by: Merlin

Re: calling method on returned object
        232910 by: Karl Glennon
        232911 by: Petar Nedyalkov
        232912 by: Jasper Bryant-Greene

PHP 5 and XSLT again
        232913 by: MA

Overloading Limitation- Can Someone Confirm?
        232914 by: Chris
        232915 by: Jasper Bryant-Greene
        232916 by: Jochem Maas
        232918 by: Jasper Bryant-Greene
        232928 by: Jochem Maas

XML-RPC or SOAP
        232917 by: Merlin

upgrade of PHP failed
        232923 by: Merlin
        232925 by: Barry

webservice
        232926 by: Diana Castillo
        232927 by: John Wells

Re: Can't get XSLT on PHP
        232929 by: Georgi Ivanov

Can "output_buffering" be set in a script?
        232930 by: Todd Cary

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscribelists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscribelists.php.net

To post to the list, e-mail:
        php-generallists.php.net

----------------------------------------------------------------------

attached mail follows:


Hi:

I just posted a solution I used recently. Here it is:

One way to turn off magic quotes is to place a ".htaccess" file in
your root folder. It's simply a text file that contains:

php_value magic_quotes_gpc 0
php_value magic_quotes_sybase 0
php_value magic_quotes_runtime 0

It works for me.

tedd

It's at: http://www.weberforums.com/ftopic8718.html&highlight=

At 5:32 PM -0600 3/29/06, Chris Boget wrote:
>I totally blew past that part with the sybase because we aren't
>using sybase. I guess I should have paid more attention. I'm
>curious why that directive affects general PHP code and not just the
>sybase functions.
>
>Oh, well.
>
>Thanks for the heads up.
>
>thnx,
>Chris
>
>----- Original Message ----- From: "Jasper Bryant-Greene" <jasperalbum.co.nz>
>To: "Chris Boget" <chris.bogetwild.net>
>Cc: "PHP General" <php-generallists.php.net>
>Sent: Wednesday, March 29, 2006 5:29 PM
>Subject: Re: [PHP] addslashes()
>
>>From http://php.net/addslashes :
>>
>>"Having the PHP directive magic_quotes_sybase set to on will mean
>>' is instead escaped with another '."
>>
>>Jasper
>>
>>Chris Boget wrote:
>>>Can someone explain something to me:
>>>
>>><script language="php">
>>> $string = "Bob's carwash's door";
>>> echo 'addslashes(): ' . addslashes( $string ) . '<br>';
>>> echo 'mysql_escape_string(): ' . mysql_escape_string( $string ) . '<br>';
>>></script>
>>>
>>>Outputs:
>>>
>>>addslashes(): Bob''s carwash''s door
>>>mysql_escape_string(): Bob\'s carwash\'s door
>>>
>>>According to the documentation
>>>(http://us2.php.net/manual/en/function.addslashes.php),
>>>addslashes() should be doing exactly what mysql_escape_string is
>>>doing above (namely, add backslashes in front of each apostrophe).
>>>However, it's merely adding an additional apostrophe. Why?
>>>
>>>I'm running 4.3.11 on Windows NT 5.2 build 3790.
>>>
>>>thnx,
>>>Chris
>>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php

--
--------------------------------------------------------------------------------
http://sperling.com

attached mail follows:


On Wed, Mar 29, 2006 at 05:32:25PM -0600, Chris Boget wrote:
> I totally blew past that part with the sybase because we aren't using
> sybase. I guess I should have paid more attention. I'm curious why that
> directive affects general PHP code and not just the sybase functions.

This is why magic_* is evil.

PHP noticed that the magic_*_sybase was on and said to you.. watch
this, i bet you can't tell how I did that :)

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

attached mail follows:


Hey all, I am desiging my own MVC framework, now i know you can pass
views in the string like index.php?view=displayAdmin , but what if the
admin model has a choice of displaying a few views as well, like editing
user, or editing product etc, how do i pass subviews, in other words is
there elegant solution someone can suggest?

attached mail follows:


On Thu, 2006-03-30 at 15:29 +1000, SLaVKa wrote:
> Hey all, I am desiging my own MVC framework, now i know you can pass
> views in the string like index.php?view=displayAdmin , but what if the
> admin model has a choice of displaying a few views as well, like editing
> user, or editing product etc, how do i pass subviews, in other words is
> there elegant solution someone can suggest?
>

You could take a look at the way we do it in our MVC Framework.
Basically in the controller you set up a switch with "action" cases.
depending on the action in the query string, it will return a template.

To see it in action, go to http://fsiu.uwc.ac.za
get the code at http://avoir.uwc.ac.za/projects/nextgen/ I would
recommend doing an anonymous CVS checkout here, as we only do a new
release on Friday...

--Paul

attached mail follows:


Paul Scott wrote:
> On Thu, 2006-03-30 at 15:29 +1000, SLaVKa wrote:
>> Hey all, I am desiging my own MVC framework, now i know you can pass
>> views in the string like index.php?view=displayAdmin , but what if the
>> admin model has a choice of displaying a few views as well, like editing
>> user, or editing product etc, how do i pass subviews, in other words is
>> there elegant solution someone can suggest?
>>
>
> You could take a look at the way we do it in our MVC Framework.
> Basically in the controller you set up a switch with "action" cases.
> depending on the action in the query string, it will return a template.
>
> To see it in action, go to http://fsiu.uwc.ac.za
> get the code at http://avoir.uwc.ac.za/projects/nextgen/ I would
> recommend doing an anonymous CVS checkout here, as we only do a new
> release on Friday...
>
> --Paul

So you only have one level of actions/views , what happens in a
situation where the page you are loading has various sections which want
either displayed or hidden?

attached mail follows:


On Thu, 2006-03-30 at 15:58 +1000, SLaVKa wrote:
> So you only have one level of actions/views , what happens in a
> situation where the page you are loading has various sections which want
> either displayed or hidden?
>

We use a finely grained permissions system. ACL and groups will
determine what the user will see on the final rendering of the
templates. The actions are simple, things like "backupdb" and "view".
The permissions system then takes over and will either allow/deny the
user to proceed. In many of our modules, we use something along these
lines:

if($this->objUser->isAdmin()) {
        //allow the user to do something
} else {
        //redirect the user to another action or module
        $this->nextAction('anotherAction', 'anotherModule');
}

--Paul

attached mail follows:


On Thu, Mar 30, 2006 at 08:46:46AM +0800, Tom Wong (Yakang Accessories) wrote:
> Dear All:

Looks good so far.

>
> ----------------------------------------------------------------------------
> ----------------------------------------------------------------------------
> -----------------
> Àý×ÓA£¨Ê¹ÓÃHTML TAG£©

Try describing it in english. If I could understand chinese chars I
might be able to help a little, on top of that, well i dont have
the ability display the charset gb2312, characters.

> <Form Enctype="multipart/form-data" Action="_URL_" Method="POST">
> <Input Type="hidden" Name="MAX_FILE_SIZE" Value="1000">
> Send this file:
> <Input Name="userfile" Type="file">
> <Input Type="submit" Value="Send File">
> </From>
> ...

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

attached mail follows:


Tom Wong (Yakang Accessories) wrote:
> Dear All:
>
> ----------------------------------------------------------------------------
> ----------------------------------------------------------------------------
> -----------------
> Àý×ÓA£¨Ê¹ÓÃHTML TAG£©
> <Form Enctype="multipart/form-data" Action="_URL_" Method="POST">
> <Input Type="hidden" Name="MAX_FILE_SIZE" Value="1000">
> Send this file:
> <Input Name="userfile" Type="file">
> <Input Type="submit" Value="Send File">
> </From>
Here it should be </form> not </from>

Btw. most of the list don't speak Chinese so please Post your Problem in
English if you can because it would be a lot easier to help you.

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

attached mail follows:


On Thu, Mar 30, 2006 at 09:20:28AM +0200, Barry wrote:
> Tom Wong (Yakang Accessories) wrote:
> > Dear All:
> >
> > ----------------------------------------------------------------------------
> > ----------------------------------------------------------------------------
> > -----------------
> > Àý×ÓA£¨Ê¹ÓÃHTML TAG£©
> > <Form Enctype="multipart/form-data" Action="_URL_" Method="POST">
> > <Input Type="hidden" Name="MAX_FILE_SIZE" Value="1000">
> > Send this file:
> > <Input Name="userfile" Type="file">
> > <Input Type="submit" Value="Send File">
> > </From>
> Here it should be </form> not </from>

Nice catch, and I even included that part in my original reply.

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

attached mail follows:


The message "Returned mail: see transcript for details" from MAILER-DAEMON, sent on 3/30/2006 05:30 was quarantined because it contained either an executable file, a batch file or a screen saver file. All of these types of attachments are considered security risks. Please consult your mail administrator who can release the message.

This message was checked by MailScan for WorkgroupMail.
www.workgroupmail.com

attached mail follows:


On Wed, Mar 29, 2006 at 02:52:39PM -0500, Rahul S. Johari wrote:
>
> Ave,
>
> I¹ve run into a slight problem. We maintain a Guestbook for our company¹s
> website. Lately we have been getting a lot of ³Spam² entries into the
> Guestbook.

Is this a common guestbook, like a 3rd party tool you got and added
to the web site? If so, do they already have a solution in place
with an add-on or such.

>
> I added a snippet into the PHP Script & a field in the mySQL database to
> record the IP Address of posters. However, for the SPAM posts, it records
> ³Null² instead of an IP Address. I¹m using $REMOTE_ADDR to records the IP.
> It records IP Addresses of any genuine poster... But NULL for the spam
> poster.

You really want to use $_SERVER['REMOTE_ADDR'];

>
> What else can I do to block the SPAM entry? Is there some other Unique
> Identifier that I can record of the Spam poster and then block him?

Well, i'll try to keep this short without going into a big rant
about SPAM...

A common method (now adays) is have the form that is being posted
provide a challange/response method (like CAPTCHA) to verify that
someone is actually sitting there filling out the form instead of a
script doing the work.

One of the problems with this method is well it limits your
"visually" impared audience from being able to add to the
guestbook, since it requires a visual response to the challenge.

Another method is to require javascript for a challenge response
method, this of course limits your audience to those who have
javascript enabled, and I'm not sure if it really 'visually
impared' friendly.

Even with those two methods, all we are doing is securing the form
from spam by obscurity. Even if it sounds like these ideas are good
because it will remove the un-needed spam i get. Consider this:

  Email gets prbably the worst spam, and there are several
  applications that go out and harvest emails for spamming
  purposes. So we all think hey they are looking form:

    userdomain.com

  ... so thus we think, lets not write it that way but
  make it so a person can read it. So now we enter this so it isn't
  harvested:

    user [at] domain [dot] com

  now, if you think about this for a moment, if everyone used the
  latter format to write their emails on the web, would it not be
  easy for a email harvester to come up with a little regex to read
  either or?

Ok, i promised not to rant to much about spam, so yeah, this is a
tuff thing to get around and very hard to find a realistic
solution for.
  
Curt.
--
cat .signature: No such file or directory

attached mail follows:


Ave,

I have to say I absolutely love your idea! It¹s probably a solution for my
problem, at the same time, like the other guy said, freaking hilarious!!!
:0)

I think I¹ll probably write up a script that displays everything except
records with NULL as IP for regular audience... And displays all records
with NULL as IP for audience who¹s IP is recorded as NULL.

Thanks!

Rahul S. Johari
Coordinator, Internet & Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: rahulinformed-sources.com
http://www.informed-sources.com

On 3/29/06 4:13 PM, "Joe Harman" <cjharmangmail.com> wrote:

> if you really want to mess with them.. only show the user with the
> NULL IP address all the spam posts.. .make them think that they've
> been successful
>
> On 3/29/06, Rahul S. Johari <rjoharinycap.rr.com> wrote:
>
>
> --
> Joe Harman
> ---------
> * My programs never have bugs, they just develop random features.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

attached mail follows:


Rahul S. Johari wrote:
> Ave,
>
> I have to say I absolutely love your idea! It¹s probably a solution for my
> problem, at the same time, like the other guy said, freaking hilarious!!!
> :0)
>
> I think I¹ll probably write up a script that displays everything except
> records with NULL as IP for regular audience... And displays all records
> with NULL as IP for audience who¹s IP is recorded as NULL.
>
> Thanks!
>
Could ipv6 make problems here?

If apache or similiar apps don't recognize it you also will get NULL.

Greets
        Barry

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

attached mail follows:


Ave,

Curt, thanks for your response.

> Is this a common guestbook, like a 3rd party tool you got and added
> to the web site? If so, do they already have a solution in place
> with an add-on or such.

No, actually it's a script I have written myself from scratch. And
unfortunately (or fortunately perhaps), I haven't ever run into this problem
before.

> You really want to use $_SERVER['REMOTE_ADDR'];

That is should, I agree!
 

> A common method (now adays) is have the form that is being posted
> provide a challange/response method (like CAPTCHA) to verify that
> someone is actually sitting there filling out the form instead of a
> script doing the work.
>
> One of the problems with this method is well it limits your
> "visually" impared audience from being able to add to the
> guestbook, since it requires a visual response to the challenge.
>
> Another method is to require javascript for a challenge response
> method, this of course limits your audience to those who have
> javascript enabled, and I'm not sure if it really 'visually
> impared' friendly.

I have implemented both those methods in different scripts I have written
and maintain across different websites. Visual Confirmation using Image
Verification and JavaScript Confirmation. However, I honestly don't want to
add such an 'extra' step in my Guestbook for users who simply wish to put in
a nice comment about the site, at least not at this point, which is why I do
want to stay away from these methods for the Guestbook for now.

Let me try a few other suggestions first and see how it goes, and then I'll
decide if I need to add more capabilities/security to the Guestbook.

Thanks for your insight, always brain-enhancing.

Rahul S. Johari
Coordinator, Internet & Administration
Informed Marketing Services Inc.
500 Federal Street, Suite 201
Troy NY 12180

Tel: (518) 687-6700 x154
Fax: (518) 687-6799
Email: rahulinformed-sources.com
http://www.informed-sources.com

attached mail follows:


On Wed, Mar 29, 2006 at 05:16:54PM +0200, bsnottumhkskole.no wrote:
>
>
>
> -------------------------- Opprinnelig melding ---------------------------
> Emne: Download problems
> Fra: bsnottumhkskole.no
> Dato: ons 29. mars 2006 9:53
> Til: php-general-digestlists.php.net
> --------------------------------------------------------------------------
>
> Hallo!
>
> I am running php-4.3.10-2.4 on an fedora core 2. My webserver is apache -
> httpd-2.0.51-2.9.
>
> I am also running a program called phpWebFTP which accesses my ftp server
> via port 80.

I would suggest contacting phpWebFTP about this.

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

attached mail follows:


cybermalandro cybermalandro wrote:
> Let me try this again. I want to take an array that may look like this
>
Opening new Threads over and over don't do any good.
Please stick to your opened thread about that issue please.

Greets
        Barry

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

attached mail follows:


Hey guys just a general question... if you have a
parent::__constructor() call in your constructor function, should that
call ideally be placed before or after the code inside the current
constructor? or it doesnt really matter

attached mail follows:


SLaVKa wrote:
> Hey guys just a general question... if you have a
> parent::__constructor() call in your constructor function, should that
> call ideally be placed before or after the code inside the current
> constructor? or it doesnt really matter

That depends on which code you want to run first. Seriously.

Jasper

attached mail follows:


Jasper Bryant-Greene wrote:
> SLaVKa wrote:
>
>> Hey guys just a general question... if you have a
>> parent::__constructor() call in your constructor function, should that
>> call ideally be placed before or after the code inside the current
>> constructor? or it doesnt really matter
>
>
> That depends on which code you want to run first. Seriously.

true in practice but in theory the parent ctor should be called
first before anything else is done - the theory is that the
'base of the object' should be completely setup before you construct
stuff in the current level (which may rely on stuff that is configured/setup
in the parent ctor).

so, what Jasper said, basically.

NB: it's parent::__construct() not parent::__constructor()

>
> Jasper
>

attached mail follows:


Hi there,

I would like to output following text with php:
<?xml version="1.0" encoding="ISO-8859-1" ?>

How can I do that? I tried to escape the ? with \? but this did
not help.

Any ideas?

Thank you for any hint,

Merlin

attached mail follows:


Merlin a écrit :
> Hi there,
>
> I would like to output following text with php:
> <?xml version="1.0" encoding="ISO-8859-1" ?>
>
> How can I do that? I tried to escape the ? with \? but this did
> not help.
>
htmlentities perhaps ?

N F
> Any ideas?
>
> Thank you for any hint,
>
> Merlin
>

attached mail follows:


Merlin wrote:
> Hi there,
>
> I would like to output following text with php:
> <?xml version="1.0" encoding="ISO-8859-1" ?>
>
> How can I do that? I tried to escape the ? with \? but this did
> not help.

Either:

1. Turn off short tags (good idea if you plan on distributing your code).

2. Just echo or print that text. Like:

<?php
echo '<?xml version="1.0" encoding="ISO-8859-1"?>' . "\n";
?>

--
Jasper Bryant-Greene
General Manager
Album Limited

http://www.album.co.nz/ 0800 4 ALBUM
jasperalbum.co.nz 021 708 334

attached mail follows:


Look up htmlentities() in the php manual and see if it'll work for you.
Hugh
----- Original Message -----
From: "Merlin" <news.groupsweb.de>
To: <php-generallists.php.net>
Sent: Thursday, March 30, 2006 1:28 AM
Subject: [PHP] Outputting text "<?" how to?

> Hi there,
>
> I would like to output following text with php:
> <?xml version="1.0" encoding="ISO-8859-1" ?>
>
> How can I do that? I tried to escape the ? with \? but this did
> not help.
>
> Any ideas?
>
> Thank you for any hint,
>
> Merlin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.385 / Virus Database: 268.3.3/295 - Release Date: 3/28/2006
>
>

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.385 / Virus Database: 268.3.3/295 - Release Date: 3/28/2006

attached mail follows:


At 11:28 AM +0200 3/30/06, Merlin wrote:
>Hi there,
>
>I would like to output following text with php:
><?xml version="1.0" encoding="ISO-8859-1" ?>
>
>How can I do that? I tried to escape the ? with \? but this did
>not help.
>
>Any ideas?
>
>Thank you for any hint,
>
>Merlin

Merlin:

First the syntax should be:

<?xml version="1.0" encoding="ISO-8859-1" ?/> <-- note the close /

Second, to what do you want to output the text?

If you want to write it to a text file, try:

$filename = "text.txt";
$file = fopen( $filename, "w" );
fwrite( $file, '<?xml version="1.0" encoding="ISO-8859-1" ?/>');
fclose( $file );

If you want to print it to a web page, try:

<?php
$a=<<<EOD
&lt;?xml version="1.0" encoding="ISO-8859-1" ?/>
EOD;
echo($a);

HTH's

tedd

PS: I would also consider changing the encoding to utf-8
--
--------------------------------------------------------------------------------
http://sperling.com

attached mail follows:


On 29 March 2006 15:25, ngwarai zed wrote:

> phpinfo says
>
> Configuration File (php.ini) Path /etc/php.ini
>
> And the file I am editing is /etc/php.ini Is this not the
> one Iam supposed to edit?

On list please!

H'mmm -- file permissions? You've stopped and restarted Apache? Which operating system?

Starting to clutch at straws, now!

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.fordleedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm

attached mail follows:


 

-----Original Message-----
From: ngwarai zed [mailto:makotoregmail.com]
Sent: 30 March 2006 13:36

I am using Fedora core 4. yes I stopped and restarted apache

On 3/30/06, Ford, Mike wrote:

On 29 March 2006 15:25, ngwarai zed wrote:

> phpinfo says
>
> Configuration File (php.ini) Path /etc/php.ini
>
> And the file I am editing is /etc/php.ini Is this not the
> one Iam supposed to edit?

On list please!

H'mmm -- file permissions? You've stopped and restarted Apache? Which operating system?

Starting to clutch at straws, now!

Cheers!

Mike

---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS, LS6 3QS, United Kingdom
Email: m.fordleedsmet.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211

To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm

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

To view the terms under which this email is distributed, please go to http://disclaimer.leedsmet.ac.uk/email.htm

attached mail follows:


I use CakePHP
The folowing code do not execute:
<td align="center">
     <?=(!empty($info['Employee']['dob'])) ?
$datetime->time2str($info['Employee']['dob']) : ""?>
 </td>

attached mail follows:


> The folowing code do not execute:
> <td align="center">
> <?=(!empty($info['Employee']['dob'])) ?
> $datetime->time2str($info['Employee']['dob']) : ""?>
> </td>

What do you mean? It doesn't show anything? Then
$info['Employee']['dob'] is empty.

If not, explain what you see or what happens.

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

attached mail follows:


It doesn't show any thing while $info['Employee']['dob'] isn't empty.
This is my code
<?php
      $stt = 0;
      foreach($data as $info):
    $stt++;
     ?>
     <tr class="<?php echo ($stt%2 == 0) ? "td1" : "td2" ?>">
      <td class="order"><?php echo $stt; ?></td>
    <td>
     <a
href="?url=employees/edit/<?=$info['Employee']['id']?>"><?=$info['Employee']
['firstname'] . " " . $info['Employee']['lastname']?></a>
    </td>
    <td align="center">
     <?=(!empty($info['Employee']['dob'])) ?
$datetime->time2str($info['Employee']['dob']) : ""?>
    </td>
    <td align="center">
     <?php
      echo $html->link("Xóa", "?url=employees/del/" .
$info['Employee']['id'])
     ?>
    </td>
     </tr>
     <?php
      endforeach;
     ?>

----- Original Message -----
From: "chris smith" <dmagickgmail.com>
To: "Pham Huu Le Quoc Phuc" <phucphlqdsp.com.vn>
Cc: <php-generallists.php.net>
Sent: Thursday, March 30, 2006 5:20 PM
Subject: Re: [PHP] PHP and CakePHP

> > The folowing code do not execute:
> > <td align="center">
> > <?=(!empty($info['Employee']['dob'])) ?
> > $datetime->time2str($info['Employee']['dob']) : ""?>
> > </td>
>
> What do you mean? It doesn't show anything? Then
> $info['Employee']['dob'] is empty.
>
> If not, explain what you see or what happens.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
>

attached mail follows:


chris smith schrieb:
> On 3/28/06, Merlin <news.groupsweb.de> wrote:
>> Hi there,
>>
>> I am wondering if there are already tools out there which do
>> create RSS feeds on the fly with the help of PHP.
>>
>> My goal would be to create RSS dynamicly out of a LAMP App. to
>> syndicate the results.
>>
>> Are there any tools you know about?
>
> This might get you started:
>
> http://www.phpclasses.org/browse/package/2957.html
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/

Hi Chris,

thank you for that hint. That worked excellent. There is just one small thing I
can not figure out. Including images into that feed. Using your mentioned
classes I have following code:

$rss_channel = new rssGenerator_channel();
   $rss_channel->title = 'test';
   $rss_channel->link = 'test.com';
   $rss_channel->description = 'test';
   $rss_channel->language = 'en-us';
   $rss_channel->generator = 'RSS Feed Generator';
   $rss_channel->managingEditor = 'infobla.com';
   $rss_channel->webMaster = 'webmasterbla.com';

   for ($i=0;$i<=$results_num;$i++){
       $item = new rssGenerator_item();
       $item->title = $ad[title][$i];
       $item->description = $ad[text][$i];
       $item->link = $ad[link][$i];
       $item->pubDate = $ad[date][$i];
       $rss_channel->items[] = $item;

     $rss_image = new rssGenerator_image();
     $rss_image->url = '/g/p/logo.gif';
     $rss_image->title = 'image';
     $rss_image->link = 'no link';
     $rss_image->width = 88;
     $rss_image->height = 31;
     $rss_image->description = 'test image';
     $rss_channel->image = $rss_image;

   }
   $rss_feed = new rssGenerator_rss();
   $rss_feed->encoding = 'UTF-8';
   $rss_feed->version = '2.0';
   header('Content-Type: text/xml');
   echo $rss_feed->createFeed($rss_channel);

The image will not apear no matter how I try it. Any idea how to do that?

Best regards,

Merlin

attached mail follows:


On 3/30/06, Merlin <news.groupsweb.de> wrote:
> chris smith schrieb:
> > On 3/28/06, Merlin <news.groupsweb.de> wrote:
> >> Hi there,
> >>
> >> I am wondering if there are already tools out there which do
> >> create RSS feeds on the fly with the help of PHP.
> >>
> >> My goal would be to create RSS dynamicly out of a LAMP App. to
> >> syndicate the results.
> >>
> >> Are there any tools you know about?
> >
> > This might get you started:
> >
> > http://www.phpclasses.org/browse/package/2957.html
> >
> > --
> > Postgresql & php tutorials
> > http://www.designmagick.com/
>
> Hi Chris,
>
> thank you for that hint. That worked excellent. There is just one small thing I
> can not figure out. Including images into that feed. Using your mentioned
> classes I have following code:
>
> $rss_channel = new rssGenerator_channel();
> $rss_channel->title = 'test';
> $rss_channel->link = 'test.com';
> $rss_channel->description = 'test';
> $rss_channel->language = 'en-us';
> $rss_channel->generator = 'RSS Feed Generator';
> $rss_channel->managingEditor = 'infobla.com';
> $rss_channel->webMaster = 'webmasterbla.com';
>
> for ($i=0;$i<=$results_num;$i++){
> $item = new rssGenerator_item();
> $item->title = $ad[title][$i];
> $item->description = $ad[text][$i];
> $item->link = $ad[link][$i];
> $item->pubDate = $ad[date][$i];
> $rss_channel->items[] = $item;
>
> $rss_image = new rssGenerator_image();
> $rss_image->url = '/g/p/logo.gif';

Try it as a full url.

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

attached mail follows:


chris smith schrieb:
> On 3/30/06, Merlin <news.groupsweb.de> wrote:
>> chris smith schrieb:
>>> On 3/28/06, Merlin <news.groupsweb.de> wrote:
>>>> Hi there,
>>>>
>>>> I am wondering if there are already tools out there which do
>>>> create RSS feeds on the fly with the help of PHP.
>>>>
>>>> My goal would be to create RSS dynamicly out of a LAMP App. to
>>>> syndicate the results.
>>>>
>>>> Are there any tools you know about?
>>> This might get you started:
>>>
>>> http://www.phpclasses.org/browse/package/2957.html
>>>
>>> --
>>> Postgresql & php tutorials
>>> http://www.designmagick.com/
>> Hi Chris,
>>
>> thank you for that hint. That worked excellent. There is just one small thing I
>> can not figure out. Including images into that feed. Using your mentioned
>> classes I have following code:
>>
>> $rss_channel = new rssGenerator_channel();
>> $rss_channel->title = 'test';
>> $rss_channel->link = 'test.com';
>> $rss_channel->description = 'test';
>> $rss_channel->language = 'en-us';
>> $rss_channel->generator = 'RSS Feed Generator';
>> $rss_channel->managingEditor = 'infobla.com';
>> $rss_channel->webMaster = 'webmasterbla.com';
>>
>> for ($i=0;$i<=$results_num;$i++){
>> $item = new rssGenerator_item();
>> $item->title = $ad[title][$i];
>> $item->description = $ad[text][$i];
>> $item->link = $ad[link][$i];
>> $item->pubDate = $ad[date][$i];
>> $rss_channel->items[] = $item;
>>
>> $rss_image = new rssGenerator_image();
>> $rss_image->url = '/g/p/logo.gif';
>
> Try it as a full url.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/

sorry that was an XML problem. Stupid me :-)
Here is the solution for anybody having the same problem:

                <img><xsl:attribute name="src"><xsl:value-of select="rss/channel/image/url"
/></xsl:attribute><xsl:attribute name="rss/channel/image/width"><xsl:value-of
select="rss/channel/image/width" /></xsl:attribute><xsl:attribute
name="height"><xsl:value-of select="rss/channel/image/height"
/></xsl:attribute></img>

attached mail follows:


Hi there,

I have an object structure, whereby a location object contains a method
to return it's map object. The map object contains a method to return
it's URL.

I expected to have the ability to get the url of a location's map with
the floowing statement:

print $this->Location->GetMap()->GetUrl();

This works in PHP5, but in PHP4 it causes a parse error (the application
has to run on PHP4 for the moment).

I'm currently working around this limitation as so:

$locationMap = $this->Location->GetMap();
print $locationMap->GetUrl();

Unfortunatly this senario is occuring in dozens of palces in the
application, and is quite unsightly compared to the PHP5 syntax.

Is there any other syntax in PHP4 to allow me to concisely call a method
on a return object? eg. ($this->Location->GetMap())->GetUrl() .. which
doens't work.

Thanks for any help,

Karl Glennon

attached mail follows:


On Thursday 30 March 2006 14:05, Karl Glennon wrote:
> Hi there,
>
> I have an object structure, whereby a location object contains a method
> to return it's map object. The map object contains a method to return
> it's URL.
>
> I expected to have the ability to get the url of a location's map with
> the floowing statement:
>
> print $this->Location->GetMap()->GetUrl();
>
> This works in PHP5, but in PHP4 it causes a parse error (the application
> has to run on PHP4 for the moment).
>
> I'm currently working around this limitation as so:
>
> $locationMap = $this->Location->GetMap();
> print $locationMap->GetUrl();
>
> Unfortunatly this senario is occuring in dozens of palces in the
> application, and is quite unsightly compared to the PHP5 syntax.
>
> Is there any other syntax in PHP4 to allow me to concisely call a method
> on a return object? eg. ($this->Location->GetMap())->GetUrl() .. which
> doens't work.

Try curly brackets.

>
> Thanks for any help,
>
> Karl Glennon

--

Cyberly yours,
Petar Nedyalkov
Devoted Orbitel Fan :-)

PGP ID: 7AE45436
PGP Public Key: http://bu.orbitel.bg/pgp/bu.asc
PGP Fingerprint: 7923 8D52 B145 02E8 6F63 8BDA 2D3F 7C0B 7AE4 5436

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.7 (GNU/Linux)

iD8DBQBEK73ZLT98C3rkVDYRAtBpAJ9dQ/oVt4Y474ug/vj/NH1ehiuYbQCgpN7V
ySPpU6oz8zmdjc4+ugVV94M=
=hYyg
-----END PGP SIGNATURE-----

attached mail follows:


Karl Glennon wrote:
[snip]
> I expected to have the ability to get the url of a location's map with
> the floowing statement:
>
> print $this->Location->GetMap()->GetUrl();
[snip]
> Is there any other syntax in PHP4 to allow me to concisely call a method
> on a return object? eg. ($this->Location->GetMap())->GetUrl() .. which
> doens't work.

In short, no. That syntax was introduced in PHP5. For OO work, I would
strongly recommend upgrading to PHP5 as there are many other important
OO features that simply are not available in PHP4.

--
Jasper Bryant-Greene
General Manager
Album Limited

http://www.album.co.nz/ 0800 4 ALBUM
jasperalbum.co.nz 021 708 334

attached mail follows:


Hi,

I'm still trying to get PHP 5.1.2 to support XSLT, but so far, no good.
I read here
http://www.zend.com/php5/andi-book-excerpt.php
that in PHP5 is libxml2 that tak care of everything (XML, XSL, XSLT,
etc.), but i've compiled it and got no XSLT support.

Any help would be appreciated.

Warm Regards,
Mário Gamito

attached mail follows:


While playing with an unnamed framework, I think I discovered an
overloading limitation (PHP 5.1.2). Can someone please confirm this
limitation?

Example class:

class testClass
{
     public $vars = array();

     public function __get($key)
     {
         return array_key_exists($key, $this->vars) ? $this->vars
[$key] : null;
     }

     public function __set($key, $value)
     {
         $this->vars[$key] = $value;
     }

     public function __isset($key)
     {
         return array_key_exists($key, $this->vars);
     }

     public function __unset($key)
     {
         unset($this->vars[$key]);
     }
}

Given the above class, the following code will not work:

$tc = new testClass();

$tc->arr = array();

$tc->arr['a'] = 'A';
$tc->arr['b'] = 'B';

if (isset($tc->arr['b'])) {
     unset($tc->arr['b']);
}

//var_dump is only to see results of above
var_dump($tc);

Am I a moron or, in fact, does this not work and is a language
limitation?

Chris
chrisdented-planet.net

attached mail follows:


Chris wrote:
> class testClass
> {
> public $vars = array();
>
> public function __get($key)
> {
> return array_key_exists($key, $this->vars) ? $this->vars[$key] :
> null;
> }
>
> public function __set($key, $value)
> {
> $this->vars[$key] = $value;
> }
>
> public function __isset($key)
> {
> return array_key_exists($key, $this->vars);
> }
>
> public function __unset($key)
> {
> unset($this->vars[$key]);
> }
> }
>
>
> $tc = new testClass();
>
> $tc->arr = array();

here you store an empty array in the $vars member array, under the key
'arr' (due to your magic methods). is that what you intended?

> $tc->arr['a'] = 'A';
> $tc->arr['b'] = 'B';

now you are adding elements to this array under the 'arr' key in the
$vars member array.

> if (isset($tc->arr['b'])) {
> unset($tc->arr['b']);
> }

you just removed b from the array under 'arr' in the $vars member array.

> //var_dump is only to see results of above
> var_dump($tc);

this should show something equiv. to:

array(
        'arr' => array(
                'a' => 'A'
        )
)

what does it actually show?

--
Jasper Bryant-Greene
General Manager
Album Limited

http://www.album.co.nz/ 0800 4 ALBUM
jasperalbum.co.nz 021 708 334

attached mail follows:


Chris wrote:
> While playing with an unnamed framework, I think I discovered an
> overloading limitation (PHP 5.1.2). Can someone please confirm this
> limitation?
>
> Example class:
>
> class testClass
> {
> public $vars = array();
>
> public function __get($key)
> {
> return array_key_exists($key, $this->vars) ? $this->vars [$key]
> : null;
> }
>
> public function __set($key, $value)
> {
> $this->vars[$key] = $value;
> }
>
> public function __isset($key)
> {
> return array_key_exists($key, $this->vars);
> }
>
> public function __unset($key)
> {
> unset($this->vars[$key]);
> }
> }
>
>
> Given the above class, the following code will not work:
>
> $tc = new testClass();
>
> $tc->arr = array();
>
> $tc->arr['a'] = 'A';
> $tc->arr['b'] = 'B';
>
> if (isset($tc->arr['b'])) {
> unset($tc->arr['b']);
> }
>
> //var_dump is only to see results of above
> var_dump($tc);
>
> Am I a moron or, in fact, does this not work and is a language limitation?

I think its a misunderstanding on the one side and a limitation on the other,
you can't use overloading directly on items of an overloaded array e.g:

        echo $tc->arr['a']

this is triggers a call to __get() with the $key parameter set to something like
(I'm guessing) "arr['a']" ... what $key is set to it surely wont be a key in the
array testClass->vars (do some test otherwise to see eactly what $key
contains if you do "echo $tc->arr['c']" maybe it contains something useful after all)

try this:

<?php

$tc = new testClass();

$tc->a = 'A';
$tc->b = 'B';

if (isset($tc->b)) {
        unset($tc->b);
}

var_dump($tc);

>
> Chris
> chrisdented-planet.net
>

attached mail follows:


Jochem Maas wrote:
> I think its a misunderstanding on the one side and a limitation on the
> other,
> you can't use overloading directly on items of an overloaded array e.g:
>
> echo $tc->arr['a']
>
> this is triggers a call to __get() with the $key parameter set to
> something like
> (I'm guessing) "arr['a']"

No, I'm pretty sure (too lazy and tired right now to test...) that if
things work as they should, it will look up __get() with the key
parameter set to 'arr', and treat the return value of that as an array,
looking for the 'a' key inside that array. Or at least it should, dammit.

--
Jasper Bryant-Greene
General Manager
Album Limited

http://www.album.co.nz/ 0800 4 ALBUM
jasperalbum.co.nz 021 708 334

attached mail follows:


Jasper Bryant-Greene wrote:
> Jochem Maas wrote:
>
>> I think its a misunderstanding on the one side and a limitation on the
>> other,
>> you can't use overloading directly on items of an overloaded array e.g:
>>
>> echo $tc->arr['a']
>>
>> this is triggers a call to __get() with the $key parameter set to
>> something like
>> (I'm guessing) "arr['a']"
>
>
> No, I'm pretty sure (too lazy and tired right now to test...) that if

you guess wrong :-) .. I couldn't resist testing it:

php -r '
class T { private $var = array();
function __set($k, $v) { $this->var[$k] = $v; }
function __get($k) { var_dump($k); }
}
$t = new T;
$t->arr = array();
$t->arr["a"] = 1;
echo "OUTPUT: \n"; var_dump($t->arr); var_dump($t->arr["a"]); var_dump($t);
'

> things work as they should, it will look up __get() with the key
> parameter set to 'arr', and treat the return value of that as an array,
> looking for the 'a' key inside that array. Or at least it should, dammit.

really should it? if you had written this engine functionality yourself and it did
not work as you intended I could understand yuor remark - but I'm pretty sure
you didn't write it.

It's very simple to state something should work a certain way - you'll probably find
it rahter harder to actually make the core engine handle stuff like this in way
that ...

a: is robust
b: is intuitive to most people
c: actually works

>

attached mail follows:


Hello there,

I am at the beginning of creating a web service. As I am not very familar with
both SOAP and XML-RPC it would not make much difference in which one I learn.

Which one would you guys recommend for a web app that has to be transformed into
a white lable solution.

Thank you for any recommendations,

Merlin

attached mail follows:


Hi there,

I just tried to upgrade to the newest 4.x version from 4.3.11.

No trying to start apache I do get following error message:

Starting apache/usr/local/apache/bin/httpd: relocation error:
.//usr/local/lib/php/extensions/debug-non-zts-20020429/upload_progress_meter.so:
undefined symbol: upload_progress_register_callback
startproc: exit status of parent of /usr/local/apache/bin/httpd: 127

This does not tell me anything.

My config looks like this:
  './configure' '--with-gd' '--with-freetype-dir=/usr/lib'
'--enable-gd-native-ttf' '--enable-gd-imgstrttf' '--with-jpeg-dir=/usr'
'--with-png-dir=/usr/lib' '--with-zlib' '--with-apxs=/usr/local/apache/bin/apxs'
'--enable-ftp' '--with-mysql' '--with-pdflib' '--with-xml' '--with-gettext'
'--enable-sysvsem' '--enable-sysvshm' '--with-curl' '--enable-xslt'
'--with-xslt-sablot=/usr/local/' '--enable-debug' '--with-PEAR' --with-xmlrpc

Can somebody give me a hint what has happened?

Thank you in advance, Merlin

attached mail follows:


Merlin wrote:
> Hi there,
>
> I just tried to upgrade to the newest 4.x version from 4.3.11.
>
> No trying to start apache I do get following error message:
>
> Starting apache/usr/local/apache/bin/httpd: relocation error:
> .//usr/local/lib/php/extensions/debug-non-zts-20020429/upload_progress_meter.so:
> undefined symbol: upload_progress_register_callback
> startproc: exit status of parent of /usr/local/apache/bin/httpd: 127
>
> This does not tell me anything.
>
> My config looks like this:
> './configure' '--with-gd' '--with-freetype-dir=/usr/lib'
> '--enable-gd-native-ttf' '--enable-gd-imgstrttf' '--with-jpeg-dir=/usr'
> '--with-png-dir=/usr/lib' '--with-zlib'
> '--with-apxs=/usr/local/apache/bin/apxs' '--enable-ftp' '--with-mysql'
> '--with-pdflib' '--with-xml' '--with-gettext' '--enable-sysvsem'
> '--enable-sysvshm' '--with-curl' '--enable-xslt'
> '--with-xslt-sablot=/usr/local/' '--enable-debug' '--with-PEAR'
> --with-xmlrpc
>
>
> Can somebody give me a hint what has happened?
>
> Thank you in advance, Merlin
Your config looks funny why do you have 2 times --enable-sysvem?
if you remove --enable-debug it might work.

looks like that debug module has an CRC error or something like that.

btw. wasn't there an installation list around here?

Greets
        Barry

--
Smileys rule (cX.x)C --o(^_^o)
Dance for me! ^(^_^)o (o^_^)o o(^_^)^ o(^_^o)

attached mail follows:


Does anyone know why I am getting the result below?
<?php
require_once('webservice.php');
$PerlPackageDatabase = WebService::ServiceProxy(
    "http://test.xtravelsystem.com/public/v1_0rc1/commonsHandler?WSDL")
;
$res = $PerlPackageDatabase->readPackageAbstract("SOAP-Lite");
print_r($res);
?>
I GET THIS RESULT:
soap_fault Object ( [error_message_prefix] => [mode] => 1 [level] => 1024
[code] => WSDL [message] => no operation readpackageabstract in wsdl
[userinfo] =>
http://test.xtravelsystem.com/public/v1_0rc1/commonsHandler?WSDL [backtrace]
=> Array ( [0] => Array ( [file] =>
c:\inetpub\wwwroot\usr\local\global\php\online\SOAP\Fault.php [line] => 60
[function] => pear_error [class] => pear_error [type] => :: [args] => Array
( [0] => no operation readpackageabstract in wsdl [1] => WSDL [2] => 1 [3]
=> 1024 [4] =>
http://test.xtravelsystem.com/public/v1_0rc1/commonsHandler?WSDL ) ) [1] =>
Array ( [file] => C:\Inetpub\wwwroot\usr\local\lib\php\Pear.php [line] =>
538 [function] => soap_fault [class] => soap_fault [type] => -> [args] =>
Array ( [0] => no operation readpackageabstract in wsdl [1] => WSDL [2] => 1
[3] => 1024 [4] => Array ( [actor] => [detail] =>
http://test.xtravelsystem.com/public/v1_0rc1/commonsHandler?WSDL ) ) ) [2]
=> Array ( [file] =>
c:\inetpub\wwwroot\usr\local\global\php\online\SOAP\Base.php [line] => 118
[function] => raiseerror [class] => soap_wsdl [type] => -> [args] => Array
( [0] => no operation readpackageabstract in wsdl [1] => WSDL [2] => [3] =>
[4] => Array ( [actor] => [detail] =>
http://test.xtravelsystem.com/public/v1_0rc1/commonsHandler?WSDL ) [5] =>
SOAP_Fault [6] => ) ) [3] => Array ( [file] =>
c:\inetpub\wwwroot\usr\local\global\php\online\SOAP\WSDL.php [line] => 98
[function] => raisesoapfault [class] => soap_wsdl [type] => -> [args] =>
Array ( [0] => no operation readpackageabstract in wsdl [1] =>
http://test.xtravelsystem.com/public/v1_0rc1/commonsHandler?WSDL ) ) [4] =>
Array ( [file] =>
c:\inetpub\wwwroot\usr\local\global\php\online\SOAP\Client.php [line] => 153
[function] => getportname [class] => soap_wsdl [type] => -> [args] => Array
( [0] => readpackageabstract ) ) [5] => Array ( [file] =>
c:\inetpub\wwwroot\usr\local\global\php\online\SOAP\Client.php [line] => 311
[function] => call

--
Diana Castillo

attached mail follows:


[snip]
> soap_fault Object ( [error_message_prefix] => [mode] => 1 [level] => 1024
> [code] => WSDL [message] => no operation readpackageabstract in wsdl
[/snip]

It appears as though you're attempting to invoke a method that doesn't
exist. Are you sure readPackageAbstract() is defined & registered in
the WSDL you're pointing to?

John W

attached mail follows:


I have it working with :
--with-xsl
--enable-xslt
--with-xslt-sablot

Do you have the libxslt-devel package ?
I'm not sure if it compiles it as module...
If it is module make sure it is enabled in php.ini

On Wednesday March 29 2006 22:17, MARG wrote:
> Anthony Ettinger wrote:
> > obvious one, but did you restart apache?
>
> Sure :)
>
> -- AM
>
> > On 3/29/06, MARG <liststuxdoit.com> wrote:
> >>Hi,
> >>
> >>I'm trying to get XSLT support on PHP, but i'm not able :(
> >>
> >>I've compiled Sablotron 1.0.2 successfully and compiled PHP 5.1.2 with
> >>--enable-xslt \
> >>--with-xslt-sablot
> >>
> >>I get no errors and PHP works fine, but i get no XSLT support (confirmed
> >>via phpinfo()).
> >>
> >>Any ideas ?
> >>
> >>Any help would be apreciated.
> >>
> >>Warm Regards,
> >>MA
> >>
> >>--
> >>PHP General Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >
> > --
> > Anthony Ettinger
> > Signature: http://chovy.dyndns.org/hcard.html

attached mail follows:


I do not have access to the php.ini file and I need to have
output_buffering turned on. Can this be done within a script?

Thank you