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 2 Jan 2007 08:40:58 -0000 Issue 4546

php-general-digest-helplists.php.net
Date: Tue Jan 02 2007 - 02:40:58 CST


php-general Digest 2 Jan 2007 08:40:58 -0000 Issue 4546

Topics (messages 246321 through 246331):

Javascript detection
        246321 by: tedd
        246322 by: Paul Waring
        246323 by: Peter Lauri
        246325 by: Jürgen Wind
        246326 by: Robert Cummings

Re: Writing Binary
        246324 by: Roman Neuhauser

Re: Basic question - Starting a background task without waiting for its end.
        246327 by: Martin Alterisio

Re: Javascript detection , working version
        246328 by: Jürgen Wind
        246329 by: tedd

Re: php-general Digest 1 Jan 2007 20:15:42 -0000 Issue 4545
        246330 by: Fahad Pervaiz

Help me about detect client screen resolution!!!
        246331 by: Le Phuoc Canh

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 gang:

I've asked this request on a couple of other list, but considering
that I've done this with a mixture of php and javascript, perhaps
some of you might check this out for me.

Try this:

http://sperling.com/js_detect

Does this technique work to detect your browser's javascript setting?

Also, if you change your browser's javascript setting, please restart
your browser before rechecking the link.

If this works well enough, I'll post the code.

Thanks.

tedd

PS: I wrote this simply because I couldn't find an acceptable PHP
"Javascript detection" solution. If anyone knows of something better,
please let me know.
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com

attached mail follows:


On Mon, 1 Jan 2007 16:14:06 -0500, tedd <teddsperling.com> wrote:
> Does this technique work to detect your browser's javascript setting?

Not for me, it says "Javascript has not been detected on the client." when in fact I've got JavaScript enabled (Firefox 1.5.0.8 on Ubuntu Linux).

Paul

attached mail follows:


I do have javascript enabled, but it does not detect it...

Best regards,
Peter Lauri

www.dwsasia.com - company web site
www.lauri.se - personal web site
www.carbonfree.org.uk - become Carbon Free

-----Original Message-----
From: tedd [mailto:teddsperling.com]
Sent: Monday, January 01, 2007 11:14 PM
To: php-generallists.php.net
Subject: [PHP] Javascript detection

Hi gang:

I've asked this request on a couple of other list, but considering
that I've done this with a mixture of php and javascript, perhaps
some of you might check this out for me.

Try this:

http://sperling.com/js_detect

Does this technique work to detect your browser's javascript setting?

Also, if you change your browser's javascript setting, please restart
your browser before rechecking the link.

If this works well enough, I'll post the code.

Thanks.

tedd

PS: I wrote this simply because I couldn't find an acceptable PHP
"Javascript detection" solution. If anyone knows of something better,
please let me know.
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com

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

attached mail follows:


does not work on SeaMonkey and Opera (IE not tested).
--
View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8117266
Sent from the PHP - General mailing list archive at Nabble.com.

attached mail follows:


On Mon, 2007-01-01 at 16:14 -0500, tedd wrote:
> Hi gang:
>
> I've asked this request on a couple of other list, but considering
> that I've done this with a mixture of php and javascript, perhaps
> some of you might check this out for me.
>
> Try this:
>
> http://sperling.com/js_detect
>
> Does this technique work to detect your browser's javascript setting?
>
> Also, if you change your browser's javascript setting, please restart
> your browser before rechecking the link.
>
> If this works well enough, I'll post the code.

It doesn't seem to be working for anyone (me neither btw)... why not use
a simpler approach? Here's an example that doesn't use a redirect. Due
to using the onload mechanism we can be certain that the order of the
updates to the session occurs in expected order (if javascript is
enabled) which is as we want.

Feel free to use as you please...

<html>
    <head>
        <script type="text/javascript" language="javascript">
        <!-- //

        function onLoadStuff()
        {
            if( !document.getElementById )
            {
                //
                // Screwit... yucky old browser!
                //

                return;
            }

            var ePhoneHome =
                document.getElementById( 'phoneHomeForJs' );

            if( ePhoneHome )
            {
                ePhoneHome.innerHTML =
                    '<img src="/phoneHome.php?javascript=1" />';
            }

            var eStatus = document.getElementById( 'javascriptStatus' );

            if( eStatus )
            {
                eStatus.innerHTML =
                    'Javascript detected... WOOOOHOOOOOO!';
            }
        }

        // -->
        </script>
    </head>

    <body onload="onLoadStuff();">
        <div id="javascriptStatus">
            Javascript NOT detected!
        </div>
        <div id="phoneHomeForJs" style="width: 1px; height: 1px;
overflow: hidden;">
            <img src="/phoneHome.php?javascript=0" />
        </div>
    </body>
</html>

Cheers,
Rob.
--
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting |
| a powerful, scalable system for accessing system services |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for |
| creating re-usable components quickly and easily. |
`------------------------------------------------------------'

attached mail follows:


# likelinkjetsoftdev.com / 2007-01-01 15:15:07 -0500:
> Hello Everyone,
> I'm trying to write a PHP script that opens a binary file, reads the
> binary in chunks, checks those chunks for a certain binary string, and
> then if the string is found, it replaces the string with another binary
> string. The script should then a copy of the file, including the
> changed bits. But for some reason, the script is not replacing the
> binary string.
>
> Here's the source code:
>
> <?php
>
> $in = fopen("C:\NeighborhoodManager.package", "rb");
> $out = fopen("C:\NeighborhoodManager2.package", "w");
> $count = 0;
>
> while (!feof($in)) {
> $count++;
> $buffer = fread($in,50000);
> if
> (eregi("0101001101110100011100100110000101101110011001110110010101110100011011110111011101101110",$buffer))

Binary mode ("rb") doesn't mean PHP will translate each bit of the data
into a 7-bit (or longer) textual representation.

http://www.php.net/manual/en/function.pack.php
http://www.php.net/manual/en/function.unpack.php

--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991

attached mail follows:


2006/12/31, Michel <lanne_michelyahoo.fr>:
>
>
> I (very simply) try to open a "notepad" on a simple text file in a
> simplistic PHP script, and would like to go on and display the next page
> without waiting for this notepad to be shut.
>
> After various attempts, I have used an :
>
> exec ('bash -c cmd /C start /MAX notepad "my_file" > NUL');
>
> ... but it still wait for the shutting of the notepad ..!
>
> Could anybody help me ?
>
> For clarification :
> 1) I use this script on a machine which is in the same time "server" and
> "client", which gives "meaning" to this operation.
> 2) I use "bash -c" because I have the cygwin platform which can easily
> initiate tasks in background, but it could be suppressed, because it "de
> facto" changes nothing...
>
> Thank's for help.
>
> Michel.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Have you tried the following?

exec ('bash -c cmd /C start /MAX notepad "my_file" > NUL &');

attached mail follows:


well,
no cute css, but (hopefully) working - here is my quick & dirty version :

http://149.222.235.16/public/
--
View this message in context: http://www.nabble.com/Javascript-detection-tf2905451.html#a8118787
Sent from the PHP - General mailing list archive at Nabble.com.

attached mail follows:


At 4:54 PM -0800 1/1/07, =?UTF-8?Q?J=C3=BCrgen_Wind?= wrote:
>well,
>no cute css, but (hopefully) working - here is my quick & dirty version :
>
>http://149.222.235.16/public/
>--
>

Well, it's cute enough for me ! It works on every browser that
BrowserCam has -- hell, I can't even get my web site to do that.

Much thanks.

tedd

PS: Too bad my email doesn't translate your name right.

--
-------
http://sperling.com http://ancientstones.com http://earthstones.com

attached mail follows:


>
> ---------- Forwarded message ----------
> From: "Philip W." <likelinkjetsoftdev.com>
> To: php-generallists.php.net
> Date: Mon, 01 Jan 2007 15:15:07 -0500
> Subject: Writing Binary
> Hello Everyone,
> I'm trying to write a PHP script that opens a binary file, reads the
> binary in chunks, checks those chunks for a certain binary string, and
> then if the string is found, it replaces the string with another binary
> string. The script should then a copy of the file, including the
> changed bits. But for some reason, the script is not replacing the
> binary string.
>
> Here's the source code:
>
> <?php
>
> $in = fopen("C:\NeighborhoodManager.package", "rb");
> $out = fopen("C:\NeighborhoodManager2.package", "w");
> $count = 0;
>
> while (!feof($in)) {
> $count++;
> $buffer = fread($in,50000);
> if
>
> (eregi("0101001101110100011100100110000101101110011001110110010101110100011011110111011101101110",$buffer))
> {
>
> $buffer2=eregi_replace("0101001101110100011100100110000101101110011001110110010101110100011011110111011101101110","0101011001101001011000110111010001101111011100100110100101100001",$buffer);
> }
> else
> {
> $buffer2 = $buffer;
> }
> fwrite($out,$buffer2);
> }
> fclose($out);
> fclose($in);
> print("About ".($count*50000)." bytes read.\n");
>
> ?>
>
> The resulting file is not changed at all, the size, md5 sums, and
> contents are the same as the original file. The original file is only
> 40,960 bytes on the disk, so the script reads the file in one pass. I am
> sure the binary string is in the original file, and I have tried reading
> the file into chunks as small as 64 bytes. I am at a loss as to what is
> happening, so I would appreciate any help.
>
> Sincerely,
> Philip W.
>
>
>
This article might help you out
http://www.onlamp.com/pub/a/php/2002/12/12/php_foundations.html

--
Regards
Fahad Pervaiz
www.ecommerce-xperts.com

attached mail follows:


Can we use php to detect client screen resolution? Please help me ?
 
Best Regard.