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 23 May 2008 07:30:42 -0000 Issue 5474

php-general-digest-helplists.php.net
Date: Fri May 23 2008 - 02:30:42 CDT


php-general Digest 23 May 2008 07:30:42 -0000 Issue 5474

Topics (messages 274634 through 274646):

php notify
        274634 by: Marty

Re: A Little Something.
        274635 by: Michelle Konzack
        274636 by: Michelle Konzack
        274638 by: Stut

PHP + MySQL transactions
        274637 by: Philip Thompson
        274644 by: Chris

Please connect with me :)
        274639 by: Etienne Finet

who can tell me HI5.COM how to get contact list
        274640 by: LKSunny
        274641 by: Stut

page called from form "action=post" not appearing on screen
        274642 by: milt
        274643 by: Carlton Whitehead

Re: echo returnArray()['a']; // workaround
        274645 by: Nathan Nobbe

maximum lengths
        274646 by: Jay Rogozinsky

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:


I'm hopeful this is a solved problem, and I'm just not searching for the
right thing yet.

I'd like a way to send a 'notify' to php processes that want it, without
the use of a moderator or helper process. One way I tried is to use
Daniel Rozsnyo multicast patch and have each php process join a
multicast group and wait. Interestingly, this works when invoked on the
CLI, but not from a browser. Daniel suspects there may be some
interference from apache.

The basic problem is sort of akin to a chat program. Multiple clients
join and sit waiting for new messages. Using ajax, I open an http
connection to a php script on the server, which then waits for a certain
amount of time for a message. If none arrives, I respond as such and a
new connection is created. Otherwise, I send the message back to the
client. I need some way to notify the waiting processes that there's a
new message so they can spring into action.

Thanks!
Marty

attached mail follows:


Am 2008-05-21 19:17:09, schrieb Stut:
> Violation of privacy? Let's start with the fact that it's not
> collecting anything you don't put out there when you use your browser.
> Let's add that none of that info can personally identify you without
> consulting your ISP who are highly unlikely to disclose who you are
> without a court order.

Not realy right, because the Music-Industry try to enforce a
International Law which they permit to contact directly the
ISP's for informations about customers...

So, this law can be misused in any case...

And as I have already sayed, if they get ONE time infos about
me, I am tracable worldwide with my Laptop which let me run
into heavy trouble.

> Again, if you want to block it I have no problem with that. I think
> you're overly cautious but it's entirely your choice.

There are since years threads in many Forums arround the world about
Google and privacy violations.

> Google Analytics (which is where the Urchin code comes from) does
> gather a tiny bit more information than normal server logs but none of
> it is personally identifiable or in any way a security risk. But just

This is not right... Once they HAVE infos about your ISP, you are
tracable and Google hast the posibilities and resources to do it.

> Then don't use sites that use it from those countries. Or, better yet,
> turn your computer off and go play outside.

> Really don't know where you're getting that from, but if it's even
> remotely true nobody would be using Google Analytics. I'm betting
> you're confusing Analytics with something else Google do, but for the
> life of me I can't think what.

Sorry but it was already in the Press that the NSA is using Google and
they have confimed it officialy!!!

> Ooh, give 'em a peanut. I live and work in the UK and every site I
> work on that uses Google Analytics has nothing specific about Google
> Analytics in the privacy policy. They all talk about use of cookies,
> IP addresses and server logs and I've never had any complaints.

Because most users care about there priacy?

Thanks, Greetings and nice Day
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant

--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
+49/177/9351947 50, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com)

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

iD8DBQFINX7mC0FPBMSS+BIRAvPwAJ9Xe1Z9BbVJ2dh/kAs5YumIiNHEJwCgvydH
1jEjEV/qM1nzb+Xc5sUg0WM=
=jY/b
-----END PGP SIGNATURE-----

attached mail follows:


Am 2008-05-21 13:28:08, schrieb tedd:
> Well then, all web sites are a privacy violation by your definition.

Not realy, since IF YOU are collecting data of customers/visiort you are
responsable for this stuff and for ANY misuse you can be sued.

> Web sites come standard with server logs and other data gatherers
> like Webalizer, which none notify the user that their access is being
> recorded.

Yes but by "European Law" you have to destruct the data after 3 month.

Otherwise your customers must aggree with you, e.g. signing a form on
your website.

> However, all data collected in such logs can not be tracked back to a
> specific user, and thus they are not really a "privacy" violation.

Ehm? I can anylyze logs and more by cookies... Google is settings
cookies in mass which then can be used by Google to identify the user.

> If I say that 43 percent of my web site's visitors come from Europe,
> and 30 percent use IE6 then it's not a privacy violation to collect
> this data because this data is not tied to a known specific user.

I was talking about your urchinTracker() which out of your control.

Google is advertising this service to INOCENT Website-Owner which then
put it into there webpages and then Google give you some infos about
your visitors back and you are happy...

But you do not know, WHAT Google does with the other infos collected...

You are helping Google to violate privacy.

> This is much like a traffic counter at on a roadway. Just because you
> drove over the counter does not constitute a violation of your
> privacy.

urchinTracker() does much more....

Thanks, Greetings and nice Day
    Michelle Konzack
    Systemadministrator
    24V Electronic Engineer
    Tamay Dogan Network
    Debian GNU/Linux Consultant

--
Linux-User #280138 with the Linux Counter, http://counter.li.org/
##################### Debian GNU/Linux Consultant #####################
Michelle Konzack Apt. 917 ICQ #328449886
+49/177/9351947 50, rue de Soultz MSN LinuxMichi
+33/6/61925193 67100 Strasbourg/France IRC #Debian (irc.icq.com)

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

iD8DBQFINXvcC0FPBMSS+BIRAmNIAKC+ET3Dg/4s7RI1q4qkFnmictv9QACfYQQL
RramhSV3oZdLFRWFiXjFmgI=
=R5km
-----END PGP SIGNATURE-----

attached mail follows:


You clearly think you're right, which is your right, but I'm not
sensing any openness to alternative points of view so this will be my
last comment on this pointless conversation. It's just not fun anymore.

On 22 May 2008, at 15:10, Michelle Konzack wrote:

> Am 2008-05-21 19:17:09, schrieb Stut:
>> Violation of privacy? Let's start with the fact that it's not
>> collecting anything you don't put out there when you use your
>> browser.
>> Let's add that none of that info can personally identify you without
>> consulting your ISP who are highly unlikely to disclose who you are
>> without a court order.
>
> Not realy right, because the Music-Industry try to enforce a
> International Law which they permit to contact directly the
> ISP's for informations about customers...

"try". Yup, that's right *you* said try. They need a court order to
get that information (which is what I said) and they always will. If
they can show that they have reasonable cause to believe someone has
broken the law then a court order will be forthcoming. I don't have a
problem with that, and if you have nothing to hide neither should you.
[IMHO]

> So, this law can be misused in any case...
>
> And as I have already sayed, if they get ONE time infos about
> me, I am tracable worldwide with my Laptop which let me run
> into heavy trouble.

I can't really reach any conclusion from that statement other than
that you're breaking the law. You might want to stop doing that - you
might be able to relax.

>> Again, if you want to block it I have no problem with that. I think
>> you're overly cautious but it's entirely your choice.
>
> There are since years threads in many Forums arround the world
> about
> Google and privacy violations.

Don't really see the relevance of that comment and my comment. Are you
actually reading what I'm typing? Block it if you want, I don't give a
rats behind, but (yes, back to the actual point I originally made)
don't block half of it and then complain that it's causing errors.

>> Google Analytics (which is where the Urchin code comes from) does
>> gather a tiny bit more information than normal server logs but none
>> of
>> it is personally identifiable or in any way a security risk. But just
>
> This is not right... Once they HAVE infos about your ISP, you
> are
> tracable and Google hast the posibilities and resources to do it.

You are *anonymously* traceable. They still need a court order to
connect that information to you personally, and they don't hand those
out without just cause. Again, I suggest you stop breaking the law so
you can relax a bit.

>> Then don't use sites that use it from those countries. Or, better
>> yet,
>> turn your computer off and go play outside.
>
>> Really don't know where you're getting that from, but if it's even
>> remotely true nobody would be using Google Analytics. I'm betting
>> you're confusing Analytics with something else Google do, but for the
>> life of me I can't think what.
>
> Sorry but it was already in the Press that the NSA is using Google
> and
> they have confimed it officialy!!!

Reference please? *How* are they using it? Are they using it like any
other individual or organisation would use it, or do they have an
illegal arrangement with Google to get access to personal information?
Just looking for more than your word, that's all.

>> Ooh, give 'em a peanut. I live and work in the UK and every site I
>> work on that uses Google Analytics has nothing specific about Google
>> Analytics in the privacy policy. They all talk about use of cookies,
>> IP addresses and server logs and I've never had any complaints.
>
> Because most users care about there priacy?

I assume you mean "most users don't care". If people cared about their
privacy they'd do everything with cash which they'd stash under their
mattress, wouldn't use loyalty cards and certainly wouldn't go near
the Internet. Total privacy is overrated and extremely inconvenient.

I'd end with "get over it" but I just don't see it happening so let's
go with "live with it".

-Stut

--
http://stut.net/

attached mail follows:


Hi all.

I'm currently working on a project that's in its beta stage. Due to
time restraints, we were unable to build in transactions from the
beginning. Well, we're getting to the point where we can now put in
transactions. Basically, I'm curious to find out your opinion on the
best way to accomplish this.

Currently, my thoughts for doing this are:

<?php
function someFunctionThatNeedsTransactions ()
{
     $this->db->begin(); // Start transaction
     $this->db->query("SELECT..."); // Run my queries here
     $this->db->query("UPDATE...");
     // Do some PHP logic here
     $this->db->query("SELECT..."); // Run more queries
     $this->db->query("INSERT...");
     $this->db->commit(); // Commit transaction
}
?>

If there was a failure in one of the queries, that would be caught in
the database class ('db' instance) and <?php $this->rollback(); ?>
would be called. Note that all the tables are InnoDB and the above
code/functionality works.

Ideally, I would have liked to use stored procedures, but that
decision was not mine. So are there any complications I'm potentially
missing? Any other thoughts on the direction to go at this point?

Thanks in advance,
~Philip

PS... No, I didn't have too much coffee this morning, Robin. ;)

"Personally, most of my web applications do not have to factor 13.7
billion years of space drift in to the calculations, so PHP's rand
function has been great for me..." ~S. Johnson

attached mail follows:


Philip Thompson wrote:
> Hi all.
>
> I'm currently working on a project that's in its beta stage. Due to time
> restraints, we were unable to build in transactions from the beginning.
> Well, we're getting to the point where we can now put in transactions.
> Basically, I'm curious to find out your opinion on the best way to
> accomplish this.
>
> Currently, my thoughts for doing this are:
>
> <?php
> function someFunctionThatNeedsTransactions ()
> {
> $this->db->begin(); // Start transaction
> $this->db->query("SELECT..."); // Run my queries here
> $this->db->query("UPDATE...");
> // Do some PHP logic here
> $this->db->query("SELECT..."); // Run more queries
> $this->db->query("INSERT...");
> $this->db->commit(); // Commit transaction
> }
> ?>
>
> If there was a failure in one of the queries, that would be caught in
> the database class ('db' instance) and <?php $this->rollback(); ?> would
> be called. Note that all the tables are InnoDB and the above
> code/functionality works.
>
> Ideally, I would have liked to use stored procedures, but that decision
> was not mine. So are there any complications I'm potentially missing?

I'd get your db class to handle nested transactions, so if you had
something like this:

$db->begin();
....
someFunctionThatNeedsTransactions();
...
.. oops, need to rollback.
$db->rollback();

the bits between "someFunction" and the "rollback" will be committed (by
the function) and can't be rolled back.

See http://dev.mysql.com/doc/refman/5.0/en/savepoints.html

The situation might not come up but it can't hurt to have it already
built in "just in case".

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

attached mail follows:


Hi,

I looked for you on Reunion.com, but you weren't there. Please connect with me so we can keep in touch.
-Etienne

Do You Know Etienne?
YES - Connect with Etienne, and see who's searching for you

Learn more:
http://www.reunion.com/efinet

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

Reunion.com - Life Changes. Keep in Touch.�
You have received this e-mail because a Reunion.com Member sent an invitation to
this e-mail address. For assistance, please refer to our FAQ or Contact Us. http://help.reunion.com/selfhelp&lid=2
Our Address: 2118 Wilshire Blvd., Box 1008, Santa Monica, CA 90403-5784

attached mail follows:


HI5.COM, Enter hotmail address and password can get your contact list, who
can tell me how to ?

that skill is SDK ? API ? or Script ?

i know fsockopen can make it, but it like hacker, not propriety...
if Window Live Contacts API, this need end-user agree, but HI5.COM not like
it, no need agree, or HI5.COM really using hacker skill ?

who can give me idea ? i want make that like HI5, detail and sample please

Thank You Very Much !!

attached mail follows:


On 22 May 2008, at 20:43, LKSunny wrote:
> HI5.COM, Enter hotmail address and password can get your contact
> list, who
> can tell me how to ?
>
> that skill is SDK ? API ? or Script ?
>
> i know fsockopen can make it, but it like hacker, not propriety...
> if Window Live Contacts API, this need end-user agree, but HI5.COM
> not like
> it, no need agree, or HI5.COM really using hacker skill ?
>
> who can give me idea ? i want make that like HI5, detail and sample
> please

This has absolutely nothing to do with PHP!!

One quick Google later and I have the answer. Why couldn't you have
done that??

http://msdn.microsoft.com/en-us/library/bb463989.aspx

-Stut

--
http://stut.net/

attached mail follows:


I have a form statement with: <form name=memjoin"
action=http://www.caamuseum.org/mem_test_review.php method="post">
when I click the submit button, the web address appears in the firefox
address box, but no page appears on the screen. and when I try to view the
page source code from the firefox "view" drop-down menu there is no source
code. the page is in the correct directory and I can open the source in IE
or in dreamweaver. I don't receive any error message or missing input file
message. I'm at a lost as to what might be the matter. does anyone have an
approach to solving this problem or know what the cause might be?
thanks - Milton

attached mail follows:


milt wrote:
> I have a form statement with: <form name=memjoin"
> action=http://www.caamuseum.org/mem_test_review.php method="post">
> when I click the submit button, the web address appears in the firefox
> address box, but no page appears on the screen. and when I try to view the
> page source code from the firefox "view" drop-down menu there is no source
> code. the page is in the correct directory and I can open the source in IE
> or in dreamweaver. I don't receive any error message or missing input file
> message. I'm at a lost as to what might be the matter. does anyone have an
> approach to solving this problem or know what the cause might be?
> thanks - Milton
>
>
>
>
Check the php.ini on the server that hosts caamesuem.org (is it your
server?) and see if display_errors is enabled. You generally shouldn't
enable this on a production server,
but it could be very helpful right now. If it's disabled, it might be
suppressing a helpful error message. Remember to restart your web
server if you change the php.ini.

Regards,
Carlton Whitehead

attached mail follows:


On Fri, Feb 29, 2008 at 12:16 AM, Nathan Nobbe <quickshiftingmail.com>
wrote:

> wow, im going to have to stare at some of those and play around with them
> as soon as im half awake :)
>
> of course i still like my solution ;) but im excited about the
> experimentation and ideas that have been shared on this topic, very
> interesting really!

i added __set() to my original class, now i can do cool stuff, like this:

    $a = ArrayClass::simpleFactory(getArray())->{'a'} = 5;

which allows retrieval of the array, and modification (or access) to a given
member, in a single statement.

<?php
class ArrayClass {
    private $theArray = array();

    private function __construct($theArray) {
        $this->theArray = $theArray;
    }

    public static function simpleFactory($theArray) {
        return new self($theArray);
    }

    public function __get($member) {
        if(array_key_exists($this->theArray, $member)) {
            return $this->theArray[$member];
        }
        return null;
    }

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

function getArray() {
    return array(
        'a' => 1,
        'b' => 2
    );
}

$a = ArrayClass::simpleFactory(getArray())->{'a'} = 5;
var_dump($a);
?>

maybe boring to some (or many :D) but as the first time around, i just
thought it was cool and id share.

-nathan

attached mail follows:


Hello All,

I would like to know the maximum length I can expect certain variables to
be, as follows:

Session_Id
Session_Name
REQUEST_URI
HTTP_USER_AGENT
QUERY_STRING

Thanks Kindly,
KiJa