php-general Digest 29 Sep 2005 21:45:41 -0000 Issue 3710

2005-09-29 Thread php-general-digest-help

php-general Digest 29 Sep 2005 21:45:41 - Issue 3710

Topics (messages 223392 through 223430):

Re: Array Select from database
223392 by: Robin Vickery

Functions Returning large strings
223393 by: zzapper
223397 by: Andy Pieters
223402 by: zzapper

imap_mail and outgoing mailserver configurations
223394 by: Lars Demel

Re: Error with DOMDocument->saveXML()
223395 by: Andy Pieters
223410 by: Stephen Leaf
223416 by: Scott Fletcher
223420 by: Stephen Leaf
223421 by: Stephen Leaf

Re: Strange behaviour overriding methods in 5.0.4
223396 by: Jochem Maas

Re: Object Function-call handling in PHP5
223398 by: DarkX

updating forms
223399 by: hope
223400 by: Norbert Wenzel
223401 by: Norbert Wenzel

Problems with new PHP install
223403 by: Chris Boget
223404 by: Jay Blanchard
223406 by: Chris Boget
223407 by: John Nichel
223408 by: John Nichel
223409 by: Chris Boget
223412 by: Jay Blanchard
223413 by: Chris Boget
223414 by: John Nichel
223415 by: Jay Blanchard

Re: Array - partical path to the array's path (part 2)
223405 by: Scott Fletcher

Array: how to find a parent key when using a child key?
223411 by: Scott Fletcher

decrypting query string back into $_GET['var']
223417 by: Graham Anderson
223418 by: Jochem Maas
223419 by: Graham Anderson

Mixing PHP & VBSCript
223422 by: Jay Blanchard
223423 by: Chris W. Parker
223428 by: Miles Thompson
223429 by: Jay Blanchard
223430 by: Satyam

php search engine
223424 by: Ross
223427 by: John Nichel

PHP and Active Directory
223425 by: Miretsky, Anya

Re: PDF Thumbnails
223426 by: Matt Darby

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:
php-general@lists.php.net


--
--- Begin Message ---
On 9/28/05, Silvio Porcellana <[EMAIL PROTECTED]> wrote:
>
> In addiction, I would (SQL)escape the values joined: supposing you are
> using MySQL, I'd do:
> $values = join("', '", array_map('mysql_real_escape_string', $array));

I agree entirely; I was just trying to keep things simple for the OP.

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

I have a series of nested functions which return a large string (as apposed to 
working on global
string) , is this inefficient? Or is PHP clever enough to just pass a pointer?

to simplify

$large_string=fn_one(fn_two(fn_three(;


your advice pls


-- 
zzapper
Success for Techies and Vim,Zsh tips
http://SuccessTheory.com/
--- End Message ---
--- Begin Message ---
Hi
> I have a series of nested functions which return a large string (as apposed
> to working on global string) , is this inefficient? Or is PHP clever enough
> to just pass a pointer?

> $large_string=fn_one(fn_two(fn_three(;

PHP is by no means cleaver enough to read your mind as to what you want it to 
do.

If you want to pass pointers instead of strings then do as this

function one(&$buffer)
{
 #processing, return true/false based on success, put result in buffer
}

function two(&$buffer)
{
 #processing,...
}

Then do like this:

$variable='input value';
if(one($variable))
 if(two($variable))
 echo "Result: $variable";

HTH

Andy

-- 
Registered Linux User Number 379093
Now listening to [silence]

   amaroK::the Coolest Media Player in the known Universe!


   Cockroaches and socialites are the only things that can 
   stay up all night and eat anything.
Herb Caen
--
-- --BEGIN GEEK CODE BLOCK-
Version: 3.1
GAT/O/>E$ d-(---)>+ s:(+)>: a--(-)>? C$(+++) UL>$ P-(+)>++
L+++>$ E---(-)@ W+++>+++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e>$@ h++(*) r-->++ y--()>
-- ---END GEEK CODE BLOCK--
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/

--


pgpEbsC3TVEQs.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
On Thu, 29 Sep 2005 11:48:10 +0200,  wrote:

>Hi
>> I have a series of nested functions which recursively return a large string 
>> (as apposed
>> to working on global string) , is this inefficient? Or is PHP clever enough
>> to just pass a pointer?
>
>> $large_string=fn_one(fn_two(fn_three($some_long_string;
>
>PHP is by no means clever enough to read your mind as to what you want it to 
>do.
>
No slight meant to PHP,  just wanted to know whether I had to worry about it, 
according to your
reply seems like I must.





-- 
zzapper
Success for Techies and Vim,Zsh tips
http://Suc

php-general Digest 29 Sep 2005 08:44:59 -0000 Issue 3709

2005-09-29 Thread php-general-digest-help

php-general Digest 29 Sep 2005 08:44:59 - Issue 3709

Topics (messages 223384 through 223391):

Re: Strange behaviour overriding methods in 5.0.4
223384 by: mail
223388 by: Jochem Maas
223389 by: Rob Agar
223391 by: mail

Re: bad use of foreach() when building xml str from xml tree(source code 
provided here).
223385 by: Scott Fletcher

Re: ODBC and DB2 functions (PDO_ODBC)
223386 by: Oscar Gosdinski

Re: Array - partical path to the array's path (part 2)
223387 by: Jochem Maas

Re: mail function-new line-security
223390 by: Torgny Bjers

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:
php-general@lists.php.net


--
--- Begin Message ---
>Norbert Wenzel wrote:
>> Hi, i have a very strange example of code. Maybe you know where my
>> mistake could be.
>> 
>> I've got an index.php with a few div's and a short php code, like:
>> echo $_SESSION['view']->getContent();
>> 
>> The view is in every case one of my view objects. And there's the problem.
>> 
>> In my specific case $_SESSION['view'] is of class "NoLoggedUserView",
>> which of course extends "View". The "View" class containts a few public
>> methods, namely
>> 
>> getTitle()
>> getHeadline()
>> getSelection()
>> getSubselection()
>> getContentHeadline()
>> getContent()
>> getFunctions()
>> 
>> The child class "NoLoggedUserView" contains only the
>> getContent()-method, which provides a login window.
>> 
>> But of course I still call all the other methods like getTitle() in my
>> index.php.
>> 
>> Until yesterday I encountered no problems with that, but today, if i
>> call $noLoggedUserView->getTitle() in the index.php i get an empty
>> document. No error, no warning, no notice ... nothing. The page stays
>> the same and doesn't change. Even the timestamp I print out to check if
>> there has been a change, doesn't change.
>> 
>> I tested a few things:
>> The page loads fine and without any problems, if the public method
>> getTitle() is written in the NoLoggedUserView and the method returns a
>> stupid string. If getTitle() in NoLoggedUserView looks like this
>
>did you try letting the parent class method just return a string constant?

The method in parent class just returns a string constant. I'm at home right 
no, but as far as I remeber it looks pretty much like this:
public function getTitle() { //in parent class View
return 'My Company:';
}
>
>> public function getTitle() {
>> return parent::getTitle();
>> }
>> there is the same problem as before. I get an empty page, no changes are
>> made.
>> 
>> My current version of getTitle() looks like this:
>
>current version in NoLoggedUserView I presume, whats the definition
>in the parent class?
yes, in no logged user view.
See the parent class above. 
>
>> public function getTitle() {
>> //return 'NoLoggedTitle'; // works great
>> //return parent::getTitle(); // no changes are made
>
>what if there is no parent?
there is, because it's just a test to see if i get this working. until 
yesterday i just called $_SESSION['view']->getTitle() and since this was an 
instance of View the method should be at least available in View. 
>>
>> $classname = get_parent_class($this);
>> $v = new $classname();
>
>now just imagine if: $classname === false
see message above, it's just to make the page working. 
>> return $v->getTitle(); // works great
>> }
>> 
>> And again, this strange thing works.
>> 
>> So what could cause php to act like this? Any ideas or suggestions or at
>> least assumptions?
>> 
>> Please, I really don't know where to search the mistake..
>
>use a shed load of echo(), print_r() and/or var_dump() to see what stufff is
>and how far along the execution gets - I do it now and again when I have
>bumped into another segfault.
>
>i.e. do stuff like
>
>echo 1,"";
>// your code here
>echo 2,"";
>// your code here
>echo 3,"";

I would like to do so, but the page doesn't even load a blank page on error. 
the page stays the same as it was before, so if do reload nothing happens, just 
as if the page doesn't get compiled or so. 
but then again, if i change the page, so it doesn't need to call any parent:: 
stuff, it compiles and loads without any errors. 

so it looks like the page isn't even compiled when calling parent:: ...
 
 
--- End Message ---
--- Begin Message ---

mail wrote:

Norbert Wenzel wrote:


Hi, i have a very strange example of code. Maybe you know where my
mistake could be.

I've got an index.php with a few div's and a short php code, like:
echo $_SESSION['view']->getContent();

The view is in every case one of my view objects. And there's the problem.

In my specific case $_SESSION['view'] is of class "NoLog