php-general Digest 18 Sep 2004 16:26:53 -0000 Issue 3003

Topics (messages 197082 through 197111):

Re: thumbnail of webpage
        197082 by: Curt Zirzow
        197083 by: Brad Pauly
        197089 by: Jason Wong
        197091 by: francesco[AT]automationsoft[DOT]biz
        197095 by: Brian V Bonini

How to re-code?
        197084 by: John Taylor-Johnston
        197087 by: Jason Wong

Re: create and read array
        197085 by: John Holmes

Re: DROP TABLE IF EXISTS
        197086 by: Jason Wong

Re: very interesting post problem
        197088 by: QT

How does work shorten url services?
        197090 by: Henri Marc
        197092 by: Ramil Sagum
        197098 by: Octavian Rasnita
        197102 by: Henri Marc
        197106 by: Jason Wong

Re: mysql_connect does not connect
        197093 by: Sam Hobbs
        197094 by: Sam Hobbs
        197096 by: Sam Hobbs
        197097 by: Sam Hobbs
        197099 by: raditha dissanayake
        197100 by: Sam Hobbs
        197101 by: Jason Wong
        197103 by: Sam Hobbs
        197104 by: Sam Hobbs
        197105 by: Daniel Schierbeck
        197107 by: Tom Rogers

Can't maintain session across domains
        197108 by: Brian Dunning
        197109 by: Marek Kilimajer

Re: Dissappearing instance variables; Bug or Feature?
        197110 by: Marek Kilimajer

no ciphers supported in phpinfo()
        197111 by: Jose Ramirez

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 ---
* Thus wrote Michael Mao:
> Is there a way to capture a snapshot of a html page and save it as a jpg  
> using php?

As you can see this isn't an easy task.  One possiblity is to ask
the mozilla/gecko developers if it would be possible to to create a
library that would render a page into a bitmap.

If that is the case then PHP would be able to do what you need very
easily.


Curt
-- 
The above comments may offend you. flame at will.

--- End Message ---
--- Begin Message ---
> Michael Mao wrote:
> 
> > Is there a way to capture a snapshot of a html page and save it as a
> > jpg  using php?

This is a bit of a hack, but kinda neat if you don't mind setting it
up. I'm sure you could use php to call a script anyway. Heh.

http://www.livejournal.com/users/brad/2015327.html

- Brad

--- End Message ---
--- Begin Message ---
On Saturday 18 September 2004 09:48, Vail, Warren wrote:
> I have been looking into this over the last week and have come up blank as
> well.

A semi-workable was posted in the archives some months ago. Twice.

-- 
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
------------------------------------------
/*
Ingrate, n.:
        A man who bites the hand that feeds him, and then complains of
        indigestion.
*/

--- End Message ---
--- Begin Message ---
Hi Michael,
read this (in italian)
http://forum.html.it/forum/showthread.php?s=&threadid=694523&highlight=pillo
la+upload


----- Original Message -----
From: "Michael Mao" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, September 18, 2004 1:54 AM
Subject: [PHP] thumbnail of webpage


> Is there a way to capture a snapshot of a html page and save it as a jpg
> using php?
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
On Fri, 2004-09-17 at 22:22, raditha dissanayake wrote:
> Michael Mao wrote:
> 
> > Is there a way to capture a snapshot of a html page and save it as a 
> > jpg  using php?
> >
> This is something that's very very hard to do with PHP but can be easily 
> done with Java.

Have not tried this but how about using 'import' which is part of the
ImageMagick package?

According to the man page:

NAME
       import  -  capture some or all of an X server screen and save the
image to a file.

SYNOPSIS
       import [ options ... ] file

DESCRIPTION
       Import reads an image from any visible window on an X server 
and  out-puts  it  as an image file. You can capture a single window,
the entire screen, or any rectangular portion of  the  screen.   Use 
display  for redisplay,  printing, editing, formatting, archiving, image
processing, etc. of the captured image.

       The target window can be specified by id, name, or may be 
selected  by clicking  the  mouse  in  the desired window. If you press
a button and then drag, a rectangle will form which expands  and 
contracts  as  the mouse  moves.  To save the portion of the screen
defined by the rectan- gle, just release the button. The keyboard bell
is  rung  once  at  the beginning of the screen capture and twice when
it completes.


-- 

s/:-[(/]/:-)/g


Brian        GnuPG -> KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
======================================================================
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

--- End Message ---
--- Begin Message ---
I had an $array, with a list of authors and an entry number. Below is the code I used. 
Now I have
compiled it all into a table. I don't know how to re-code these lines:

foreach (array_count_values ($authors) as $author=>$count)
foreach ($author_list[$author] as $ausid)

-----------new code-----------
$myconnection = mysql_connect($server,$user,$pass);
mysql_select_db($db,$myconnection);

$news = mysql_query("select ccl_id,AUS from $table ORDER by AUS");

while ($mydata = mysql_fetch_object($news))
{
??   foreach (array_count_values ($authors) as $author=>$count)
   {
??   foreach ($author_list[$author] as $ausid)
    {
    }
   }
}

------ My old code ---------
foreach (array_count_values ($authors) as $author=>$count)
{
      echo "<tr>";
      echo "<th>$author</th>";
      echo "<th>".$count." records found/trouvés)</th>";
      echo"</tr>\n";
      echo "<tr bgcolor=\"#F5F5F5\"><td>&nbsp;</td>";
      echo "<td align=\"left\">";
      $temp = "";
      foreach ($author_list[$author] as $ausid)
      {
      $temp .= "$ausid, ";
      }
      $temp = substr("$temp", 0, -2);#delete ", "
      echo "$temp</td>";

      echo "</tr>\n";
}


--
John Taylor-Johnston
-----------------------------------------------------------------------------
  °v°   Bibliography of Comparative Studies in Canadian, Québec and Foreign Literatures
 /(_)\  Université de Sherbrooke
  ^ ^   http://compcanlit.ca/

--- End Message ---
--- Begin Message ---
You have started a new thread by taking an existing posting and replying to
it while you changed the subject.

That is bad, because it breaks threading. Whenever you reply to a message,
your mail client generates a "References:" header that tells all recipients
which posting(s) your posting refers to. A mail client uses this information
to build a threaded view ("tree view") of the postings.

With your posting style you successfully torpedoed this useful feature; your
posting shows up within an existing thread it has nothing to do with.

Always do a fresh post when you want to start a new thread. To achieve this,
click on "New message" instead of "Reply" within your mail client, and enter
the list address as the recipient. You can save the list address in your
address book for convenience.

--- End Message ---
--- Begin Message --- John Taylor-Johnston wrote:
John,
$sql .= "INSERT INTO newtable VALUES ({$mydata->AUS},{$mydata->id});\r\n";

I thought mysql would not permit that, running more than one query (insert ...) at a 
time?
You can get away with it in phpmyadmin, although.

You can only run one query per mysql_query() call. PHPMyAdmin breaks queries up into separate mysql_query() calls. Other databases (like SQLite) allow more than one query at a time.


--

---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com
--- End Message ---
--- Begin Message ---
On Saturday 18 September 2004 10:56, John Taylor-Johnston wrote:
> MySQL question:

What's it doing here?

-- 
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
------------------------------------------
/*
Democracy is the name we give the people whenever we need them.
                -- Arman de Caillavet, 1913
*/

--- End Message ---
--- Begin Message ---
Thank you,

But I don't understand what you mean with body of the post message. Would
you explain more or to give an example.

Best Regards

"Raditha Dissanayake" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> QT wrote:
>
> >Dear Sirs,
> >
> >I need to post 3 string data to destination adres. But I see first time,
the
> >name of the variables are same such as DATA. I ask the destination ovner
is
> >there any error. Should be the form fields name such as DATA1, DATA2 and
> >DATA3.
> >
> >
> You appear to be posting to a servlet and according to my understanding
> the following will be collapsed.
>
> >
> >$str = "DATA=abc&DATA=123&DATA=xxx"
> >
> >
> Ie only DATA=xxx will be visible to the servlet
>
> >  $len = strlen($str);
> >
> >    $p = "POST /httpsmspp/servlet/sms HTTP/1.0\r\n";
> >
> >
> But you are using post. If you add the DATA items to the body of the
> post message they will be individually accessible by the servlet.
>
>
> --
> 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 128 KB | with progress bar.

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

I know that some web sites offer a service to shorten
long url. It is very useful when your site is hosted
by your Internet provider for example, and that you
have a long url. Or when you want to send it in an
e-mail.
tinyurl.com does that for example.
The principle is that you enter your long url in their
form and it gives you a shorten url like
tinyurl.com/h4599

I was wondering how it works. I think it must use PHP.

I see two possibilities.
First is that the site creates an html page with a
redirect header, like <META HTTP-EQUIV="REFRESH"
CONTENT="0;URL=...
But then it would mean that the site needs to host
thousands of web pages for all its users.
The second choice is to create a simple database with
two fields. The first is the long url and the second
is the shorten. So, when someone try tinyurl.com/h4599
it sends it to the real site.

But is it possible for a web site to capture all the
possible urls that it has created then compare it to
its database?
Because it has not created a webpage "h4599.html" for
example, then the site should show a 404 page.

Thanks for your help.


        

        
                
Vous manquez d’espace pour stocker vos mails ? 
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour 
dialoguer instantanément avec vos amis. A télécharger gratuitement sur 
http://fr.messenger.yahoo.com

--- End Message ---
--- Begin Message ---
On Sat, 18 Sep 2004 10:49:34 +0200 (CEST), Henri Marc
<[EMAIL PROTECTED]> wrote:
> Hello,
> 
> The principle is that you enter your long url in their
> form and it gives you a shorten url like
> tinyurl.com/h4599
> 
> I was wondering how it works. I think it must use PHP.
> 

It would use a feature of an HTTP server such as Apache -- URL rewriting

Basically, you can make rules such that urls like 

http://tinyurl.com/h4599


become


http://tinyurl.com/index.php?id=h4599


you would then handle it from there.

But this is off topic :)
----


ramil

http://ramil.sagum.net

--- End Message ---
--- Begin Message ---
I don't think those sites use mod_rewrite because an URl can be anything,
including:

http://www.oijoij.com/eorier/eoroeir/oier/eorij.pl?terer=wer4334&oijo=weroo&jjjjj=123#

(or much more complicated urls).

Those sites (because there are more) just put the urls in a database, and
assign an ID to each one.

Then, a program (that can be made in any language) queries the database for
the given ID, and get the long URL. Then it redirects to that URL and that's
all.

I have made such a program in perl but it is very very simple.

Teddy

----- Original Message ----- 
From: "Ramil Sagum" <[EMAIL PROTECTED]>
To: "Henri Marc" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, September 18, 2004 2:29 PM
Subject: Re: [PHP] How does work shorten url services?


On Sat, 18 Sep 2004 10:49:34 +0200 (CEST), Henri Marc
<[EMAIL PROTECTED]> wrote:
> Hello,
>
> The principle is that you enter your long url in their
> form and it gives you a shorten url like
> tinyurl.com/h4599
>
> I was wondering how it works. I think it must use PHP.
>

It would use a feature of an HTTP server such as Apache -- URL rewriting

Basically, you can make rules such that urls like

http://tinyurl.com/h4599


become


http://tinyurl.com/index.php?id=h4599


you would then handle it from there.

But this is off topic :)
----


ramil

http://ramil.sagum.net

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

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

> Those sites (because there are more) just put the
> urls in a database, and
> assign an ID to each one.
> 
> Then, a program (that can be made in any language)
> queries the database for
> the given ID, and get the long URL. Then it
> redirects to that URL and that's
> all.
Ok, it is like I thought, but if it is made in PHP is
there a way to catch all the ID sent to the main page
of tinyurl.com and then query the database?
Like I said before, when someone type in its browser
the url tinyurl.com/h4599 how tinyurl (or other
similar services), are able to get the ID, what is the
command?
I hope I'm clear :-/


        

        
                
Vous manquez d’espace pour stocker vos mails ? 
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour 
dialoguer instantanément avec vos amis. A télécharger gratuitement sur 
http://fr.messenger.yahoo.com

--- End Message ---
--- Begin Message ---
On Saturday 18 September 2004 21:23, Henri Marc wrote:

> Ok, it is like I thought, but if it is made in PHP is
> there a way to catch all the ID sent to the main page
> of tinyurl.com and then query the database?

If your webserver is apache you could use its rewrite engine to ensure that 
all requests to http://example.com/ gets processed by php (see apache docs). 

> Like I said before, when someone type in its browser
> the url tinyurl.com/h4599 how tinyurl (or other
> similar services), are able to get the ID, what is the
> command?

Then in php process the request (look in $_SERVER).

-- 
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
------------------------------------------
/*
panic("esp_handle: current_SC == penguin within interrupt!");
        2.2.16 /usr/src/linux/drivers/scsi/esp.c
*/

--- End Message ---
--- Begin Message ---
"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>* Thus wrote Sam Hobbs:
>> And the relevant portion of that says "external access", which is not
>> applicable here. I do not see anything else on that page that is 
>> relevant.
>
> what is relevant? only the last one?  :sigh:

I don't know. Ask them, not me. 

--- End Message ---
--- Begin Message ---
"Curt Zirzow" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> Um.. you do realize you have more problems than php not being able
> to connect to the database.

This is the type of unproductive comment that causes problems. The only 
reason you are saying this is because you are desperate to make me wrong. 
You have exhausted reasonable comments and must resort to unreasonable ones. 
That sure is a problem here. 

--- End Message ---
--- Begin Message ---
"Jason Wong" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> Being obstinate and contrarian does nothing to help resolve your problem.

This is more unnecessary and unproductive comments. Since you did not have 
something relevant and productive to say the best thing to do is say 
nothing. I hope the moderators agree.

> Would I be correct if I paraphrased the above as:
>
> The wrong way to get Sam Hobbs to try something that might help in solving 
> his
> problem:
>
> [JD] The firewall might be blocking your attempts to connect to mysql. Try
> disabling it.
> [SH] Yeah and what makes you think that? I KNOW the firewal has nothing to 
> do
> with it. Get real (and go away).
>
> The right way to get Sam Hobbs to try something that might help in solving 
> his
> problem:
>
> [JD] The firewall has nothing to do with your problem. But try disabling 
> it
> anyway.
> [SH] Yeah that sounds reasonable. Thanks, I'll try that.
>
>
>
> How silly is that?

You "paraphrased" version is not accurate.

--- End Message ---
--- Begin Message ---
"Steve Brown" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> Sam, if you wouldn't mind answering a question: are you still unable
> to connect to your mysql server?

I am able to connect now.

> I'm sorry that you feel its a time-consuming process.  I'm sorry that
> you are confused about the involvement of the firewall.  I'm sorry
> that you feel you know better than everyone on this list.  Just try
> this and prove us wrong.

The problem is that people's insistance. It was people's reaction when I 
said I thought it was not relevant. There was a lot of stuff said that was 
unnecessary. People could have simply said to try it, without the criticism. 
To the extent that I was wrong, the apporopriate thing to do is to state 
whatever facts are relevant and then give me a chance to use that 
information.

I have posted over 12,000 messages in the CodeGuru.com Visual C++ forum, and 
about 99% of the messages were efforts to help people. I know that there are 
people that will not listen. When a person will not listen, it is a big 
mistake to insult them. The attitude in this group would cause a serious 
flame war if someone were truly not listening. 

--- End Message ---
--- Begin Message ---
Sam Hobbs wrote:


I have posted over 12,000 messages in the CodeGuru.com Visual C++ forum,


Do you have a life ?





--
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 128 KB | with progress bar.

--- End Message ---
--- Begin Message ---
"Matthew Sims" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> You should check as XP SP2 firewall is turned on by default.
>
> http://support.microsoft.com/default.aspx?kbid=842242

Saying "You should check" assumes I did not check.

I did check. I said as far as I know it is off. I am sorry that that does 
not state explicitly that I checked, but if I had not checked it then I 
would have stated explicitly that I did not.

What I meant is that I don't see anything saying that the firewall is on. 
When I go to whereever it is that the firewall is configured, it is off. The 
only reason I am confused is because there are events in the security log 
complaining about use of some ports and I don't understand that. The 
messages seem to be produced in spite of the Windows firewall being off. I 
did explicitly turn off the Windows firewall soon after installing ZoneAlarm 
over two years ago and again after SP2 was installed. Note that XP has 
always had a firewall, it just has been improved and made reasonably useful 
in SP2. 

--- End Message ---
--- Begin Message ---
On Saturday 18 September 2004 21:04, Sam Hobbs wrote:
> "Steve Brown" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
>
> > Sam, if you wouldn't mind answering a question: are you still unable
> > to connect to your mysql server?
>
> I am able to connect now.

Would you mind spilling the beans? I'm sure everyone is dying to know what the 
resolution of this thread is.

-- 
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
------------------------------------------
/*
Of course there's no reason for it, it's just our policy.
*/


--- End Message ---
--- Begin Message ---
That is the type of comment that causes problems. Reasonable and 
knowledgable people know it is not true and saying it just causes problems. 
Of course, many people would advise to just ignore comments such as that and 
I will in the future. I just want to make it clear for the benefit of others 
that this is the type of comments that has caused problems.


"Jason Davidson" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Windows XP Firewall, or any other firewall for that matter must be off.

--- End Message ---
--- Begin Message ---
"Jason Wong" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
>
> Unfortunately (fortunately?) there are packages out there which install 
> all
> Apache/MySQL/PHP for you or whatever. So unless you state which package
> you're using then "typical" is still meaningless. It's just helpful when
> posting to provide as much _relevant_ info as possible.

I am sorry I did not know anything about the other packages. I assumed it 
was clear that I meant the installation provided by MySQL from there web 
site. I had no way of knowing that I needed to state what package. The MySQL 
documentation mentions only two ways of installing MySQL; either manually or 
by using the installation program they provide.

--- End Message ---
--- Begin Message --- Sam Hobbs wrote:
"Steve Brown" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

Sam, if you wouldn't mind answering a question: are you still unable
to connect to your mysql server?


I am able to connect now.


I'm sorry that you feel its a time-consuming process.  I'm sorry that
you are confused about the involvement of the firewall.  I'm sorry
that you feel you know better than everyone on this list.  Just try
this and prove us wrong.


The problem is that people's insistance. It was people's reaction when I said I thought it was not relevant. There was a lot of stuff said that was unnecessary. People could have simply said to try it, without the criticism. To the extent that I was wrong, the apporopriate thing to do is to state whatever facts are relevant and then give me a chance to use that information.

I have posted over 12,000 messages in the CodeGuru.com Visual C++ forum, and about 99% of the messages were efforts to help people. I know that there are people that will not listen. When a person will not listen, it is a big mistake to insult them. The attitude in this group would cause a serious flame war if someone were truly not listening.

I'm SOOOOO not listening to you... ;)

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

I don't normally bother with these kind of meaningless threads as they
waste valuable electrons but I did find this interesting

http://www.urban75.com/Mag/troll.html


PS This is not a dig at you Jason, it's just your post is the only one
I didn't delete :)
-- 
regards,
Tom

--- End Message ---
--- Begin Message --- I'm hosting on PowWeb where you have a different domain for SSL pages. I'm trying to pass the user from the www.mydomain.com pages to the mydomain.secure.powweb.com pages to complete a credit card transaction, so I pass sid=xxxxxx as a GET param on the link that jumps them to the new domain. This works on my development server and on another domain, but it's not working here (just dumps them to the login page on the secure domain). Any suggestions?

- Brian
--- End Message ---
--- Begin Message --- Brian Dunning wrote:
I'm hosting on PowWeb where you have a different domain for SSL pages. I'm trying to pass the user from the www.mydomain.com pages to the mydomain.secure.powweb.com pages to complete a credit card transaction, so I pass sid=xxxxxx as a GET param on the link that jumps them to the new domain. This works on my development server and on another domain, but it's not working here (just dumps them to the login page on the secure domain). Any suggestions?

Check session.save_path setting on both domains.

--- End Message ---
--- Begin Message --- In PHP4 "$this->one = $one;" assigns a *copy* of $one to $this->one. You need to use "$this->one =& $one;"

The code will work as expected in PHP5 (and zend.ze1_compatibility_mode set to off).

Ryan Briones wrote:
This is a scaled down example of something I'm doing in some code. The
results are very funky. I guess I could understand this happening if
$two was out of scope when print_r($this) was called in
One()...actually no I couldn't.

<?php
Class One {
function One() {
$this->test = array();
$two = new Two( $this );
print_r( $this );
}
function set( $index, $value ) {
$this->test[$index] = $value;
}
}


Class Two {
    var $one = null;
    function Two( &$one ) {
        $this->one = $one;
        $this->one->set( 'foo', 1 );
        print_r($this);
    }
}

$obj = new One;
?>

OUTPUT:
two Object
(
    [one] => one Object
        (
            [test] => Array
                (
                    [foo] => 1
                )

        )

)
one Object
(
    [test] => Array
        (
        )

)

This only happens if you assign the reference passed to the second
class as an instance variable. If you call the reference directly, the
variable persists. ie:

<?php
Class One {
function One() {
$this->test = array();
$two = new Two( $this );
print_r( $this );
}
function set( $index, $value ) {
$this->test[$index] = $value;
}
}


Class Two {
    var $one = null;
    function Two( &$one ) {
        $one->set( 'foo', 1 );
    }
}

$obj = new One;
?>

OUTPUT:
one Object
(
    [test] => Array
        (
            [foo] => 1
        )

)

Any Ideas?

Ryan Briones


--- End Message ---
--- Begin Message ---
I compiled mcrypt and php without problem, but phpinfo() shows there
are no supported ciphers and modes; following a suggestion I try to
change mode to 755 on libdirs (/usr/local/libmcrypt,
/usr/local/libcrypt), but nothing happens.

Please help!


-- 

José M. Ramirez

--- End Message ---

Reply via email to