|
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 13 Dec 2006 16:12:44 -0000 Issue 4512
php-general-digest-help
lists.php.net
Date: Wed Dec 13 2006 - 10:12:44 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
php-general Digest 13 Dec 2006 16:12:44 -0000 Issue 4512
Topics (messages 245778 through 245803):
Re: Cookies & page refresh
245778 by: Chris
245783 by: William Stokes
Re: Retransmiting post variables
245779 by: Chris
Re: Whitespace in Emails
245780 by: Chris
Re: Varying session behavior between 2 nearly identical Apache/PHP setups
245781 by: Chris
245795 by: Jochem Maas
Re: Segmentation fault using imap_open
245782 by: Chris
How php works?
245784 by: Kai Xiang
245789 by: Roman Neuhauser
245790 by: Jochem Maas
245793 by: Kai Xiang
245794 by: Kai Xiang
245796 by: Jochem Maas
245797 by: Roman Neuhauser
Re: Please hack my app
245785 by: Jordan Forssman
Paste variable from popup to previous page?
245786 by: William Stokes
245787 by: William Stokes
245791 by: tetet
Re: php redirection..
245788 by: Youri LACAN-BARTLEY
245792 by: Tim
PHP and connection to mail account
245798 by: Angelo Zanetti
245799 by: Aras
245800 by: Jochem Maas
245801 by: Stut
245802 by: Jochem Maas
problem with ob_start() and header() in osCommerce cart
245803 by: afan.afan.net
Administrivia:
To subscribe to the digest, e-mail:
php-general-digest-subscribe
lists.php.net
To unsubscribe from the digest, e-mail:
php-general-digest-unsubscribe
lists.php.net
To post to the list, e-mail:
php-general
lists.php.net
----------------------------------------------------------------------
attached mail follows:
William Stokes wrote:
> Hello,
>
> I have a page that uses session cookies for deciding what content to show to
> a visitor. User also has 2 form objecks to apply filters to the content SQL
> queries. So at the beginning of the script I set 2 cookies based on user
> selections(or defaults) and after that make DB query based on user
> selections. I wanted to use cookies because there also "back - up -
> forward" links for pagination.
>
> Problem is that in order to get the cookie based system to work the page
> needs a refresh to read the cookies and display content corretly. Is this
> because the page loads faster than the server set's the cookies to client
> browser? If so what's the "corrert" / best way to implement the filters and
> page navigation if there's 2 form select lists and 3 links to navigate the
> page.
Use a session variable instead. Otherwise I could modify the cookie and
change the query / queries being run really easily... causing sql
injection and a bunch of other issues.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Thanks.
It seems that I tested the right things but in a wrong order...
-Will
"Chris" <dmagick
gmail.com> kirjoitti
viestissä:457F832E.3020000
gmail.com...
> William Stokes wrote:
>> Hello,
>>
>> I have a page that uses session cookies for deciding what content to show
>> to a visitor. User also has 2 form objecks to apply filters to the
>> content SQL queries. So at the beginning of the script I set 2 cookies
>> based on user selections(or defaults) and after that make DB query based
>> on user selections. I wanted to use cookies because there also "back -
>> up - forward" links for pagination.
>>
>> Problem is that in order to get the cookie based system to work the page
>> needs a refresh to read the cookies and display content corretly. Is this
>> because the page loads faster than the server set's the cookies to client
>> browser? If so what's the "corrert" / best way to implement the filters
>> and page navigation if there's 2 form select lists and 3 links to
>> navigate the page.
>
> Use a session variable instead. Otherwise I could modify the cookie and
> change the query / queries being run really easily... causing sql
> injection and a bunch of other issues.
>
> --
> Postgresql & php tutorials
> http://www.designmagick.com/
attached mail follows:
Fernando M. M. wrote:
>
> Hello,
>
> I have a script called redir.php that is used only for redirecting
> using the following code:
>
> header('Location: ', $_GET['url']);
>
> But
> now i need to redirect post varibles too. Example:
>
> If someone access
> redir.php?url=my_page.php and post:
>
> &a=1&b=2
>
> I need to
> send this post string (as post) to my_page.php.
$post_string = '';
foreach ($_POST as $k => $v) {
$post_string .= $k . '=' . $v . '&';
}
$url .= $post_string;
however that's *really* insecure - you're not doing any sanity checks on
any of the posted data.
You need to implement some checks (ie make sure the field you want as a
number is a number and so on).
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
jennifer
hooksbooks.com wrote:
> I'm experiencing a strange problem and difficult to diagnose because
> it's random. I have built an application that sends out an email with a
> nice amount of text (don't have exact char count, but could get it).
>
> On the html email, a random whitespace appears in the content, but
> always toward the end pointing to a possible character count issue.
>
> See below for examples of how the space wanders and is random:
>
> 1- "Th ere are several things being discussed in this email."
> 2- "There are se veral things being discussed in this email."
> 3- "There are severa l things being discussed in this email."
>
> This whitepace issue happens after the email is sent.
>
> Anybody have any ideas?
The MTA is wrapping the text at 1,024 characters if you're not doing it.
Use http://php.net/wordwrap to wrap it at specific lengths.
If it's a text-only email, add 'format=flowed;' to your headers:
Content-Type: text/plain; format=flowed;
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Matthew North wrote:
> Hello All,
>
> I have an odd situation that I wonder if someone might have some
> insight on. The scenario is this:
>
> - Two FreeBSD systems running Apache+mod_php+others. We use one for
> development and the other for testing.
>
> - Each system is running PHP 5.2.0 with identical php.ini files.
>
> - On each system we have identical PHP code (confirmed to be identical
> by comparing cksum output) that looks essentially like this:
>
> === snip ===
> <?php
> .
> . [page setup code]
> .
> trigger_error('['.session_id().']');
> if (needSession && !session_id())
> session_start();
> trigger_error('['.session_id().']');
> .
> . [page output code]
> .
> ?>
> === snip ===
>
> Errors are logged to file rather than the page, so the trigger_error()
> calls above result in entries similar to:
>
> [08-Dec-2006 16:59:23] PHP Notice: [] in /path/to/file.php on line 178
>
> [08-Dec-2006 16:59:23] PHP Notice: [GmQidWwShpRpHCGDiQrBr-Lk4ib] in
> /path/to/file.php on line 181
>
> So it appears a session is started.
>
> However, on the test system a session cookie is never sent back to the
> browser so the session cannot be restored, while on the development
> system everything works as it should (session cookie is set and
> session is therefore restored on each page load).
>
> Using 'wget -S', here are the response headers sent by the development
> system:
>
> $ wget -S http://dev/ajax/shopping_list.php\?action=add\&SKU=ABC
> --15:48:41-- http://dev/ajax/shopping_list.php?action=add&SKU=ABC
> => `shopping_list.php?action=add&SKU=ABC.1'
> Resolving dev... 192.168.0.30
> Connecting to dev|192.168.0.30|:80... connected.
> HTTP/1.1 200 OK
> Date: Mon, 11 Dec 2006 23:48:41 GMT
> Server: Apache/2.2.3 (FreeBSD) mod_ssl/2.2.3 OpenSSL/0.9.7e-p1 DAV/2
> PHP/5.2.0 with Suhosin-Patch mod_ruby/1.2.5 Ruby/1.8.5(2006-08-25)
> SVN/1.4.2
> mod_jk/1.2.15
> X-Powered-By: PHP/5.2.0
> Set-Cookie: PHPSESSID=WJ33PpO,nphiPAVxrbrWrQEnO5a; path=/
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
> pre-check=0
> Pragma: no-cache
> Content-Length: 103
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Content-Type: application/xml
> Length: 103 [application/xml]
>
>
> And on the live server:
>
>
> $ wget -S http://test/ajax/shopping_list.php\?action=add\&SKU=ABC
> --15:48:26-- http://test/ajax/shopping_list.php?action=add&SKU=ABC
> => `shopping_list.php?action=add&SKU=ABC'
> Resolving test... 192.168.0.31
> Connecting to test|192.168.0.31|:80... connected.
> HTTP request sent, awaiting response...
> HTTP/1.1 200 OK
> Date: Mon, 11 Dec 2006 23:48:26 GMT
> Server: Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7e-p1 SVN/1.3.2
> PHP/5.2.0 DAV/2
> X-Powered-By: PHP/5.2.0
> Content-Length: 103
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Content-Type: application/xml
> Length: 103 [application/xml]
>
>
> No session cookie! Note that the bodies of these two responses are
> identical as determined using diff. Also note that we have other sets
> of code on the test system which call session_start(), and a session
> cookie _is_ set, as it should be, and everything works fine. So it's
> not simply that the session module is broken or mis-configured on the
> test machine. Under most circumstances sessions work fine on both
> systems. This implies that there is something specific about the code
> that is running in the [page setup code] and/or [page output code]
> (refer to snippet above) that is causing session_start() to behave
> unusually. But again, the PHP code is identical, so it must be the
> code *in combination with* some other external difference between the
> two systems.
>
> The only differences between the two systems that could conceivably
> make sense (to my mind) in terms of this differing behavior are:
> Apache 2.0.59 and no Suhosin patch on the test machine, vs Apache
> 2.2.3 _with_ Suhosin patch on the development system (and I mention
> Suhosin only because it makes some cookie-related changes). There are
> other differences, but none that would appear that they should have
> this effect. Here are the configure commands used for each system:
>
> test system:
> =======
> './configure' '--with-mysql=/usr/local/mysql'
> '--with-pgsql=/usr/local/pgsql'
> '--with-gettext' '--with-xml' '--with-imap' '--with-imap-ssl'
> '--with-pspell'
> '--with-zlib' '--with-zlib-dir=/usr' '--with-bz2' '--with-ndbm'
> '--enable-dba'
> '--with-gd' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/local'
> '--with-jpeg-dir=/usr/local' '--with-tiff-dir=/usr/local'
> '--with-png-dir=/usr/local' '--with-tidy' '--with-openssl'
> '--enable-sysvsem'
> '--enable-sysvshm' '--enable-dbase' '--enable-ftp' '--enable-memory-limit'
> '--enable-inline-optimization' '--disable-debug'
> '--with-apxs2=/usr/local/apache2/bin/apxs' '--prefix=/usr/local/php'
> '--with-config-file-path=/usr/local/php'
>
> development system:
> ============
> './configure' '--enable-versioning' '--enable-memory-limit'
> '--with-layout=GNU'
> '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
> '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection'
> '--enable-spl' '--program-prefix=' '--disable-path-info-check'
> '--with-apxs2=/usr/local/sbin/apxs' '--with-regex=php'
> '--with-zend-vm=CALL'
> '--prefix=/usr/local'
>
> I acknowledge that these aren't particularly similar, but they do not
> differ in any way that should cause this difference in behavior (do
> they?).
>
> The PHP modules loaded match between the two systems, with the
> exception of tidy which is enabled on the test machine and not enabled
> on the development system.
>
> And again, php.ini are identical between the systems.
>
> What could explain this difference in behavior?
Where is the session.session_path set to on the non-working version? If
you're setting it to a local area (eg /path/to/app/sessions) - is that
folder writable by the web-server?
Compare output from a phpinfo on each system regarding sessions - any
notable differences?
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Matthew North wrote:
> Hello All,
>
> I have an odd situation that I wonder if someone might have some
> insight on. The scenario is this:
>
> - Two FreeBSD systems running Apache+mod_php+others. We use one for
> development and the other for testing.
>
> - Each system is running PHP 5.2.0 with identical php.ini files.
>
> - On each system we have identical PHP code (confirmed to be identical
> by comparing cksum output) that looks essentially like this:
>
> === snip ===
> <?php
> .
> . [page setup code]
> .
> trigger_error('['.session_id().']');
> if (needSession && !session_id())
^ is this a typo? or is this a constant?
> session_start();
> trigger_error('['.session_id().']');
> .
> . [page output code]
> .
> ?>
> === snip ===
>
> Errors are logged to file rather than the page, so the trigger_error()
> calls above result in entries similar to:
>
> [08-Dec-2006 16:59:23] PHP Notice: [] in /path/to/file.php on line 178
>
> [08-Dec-2006 16:59:23] PHP Notice: [GmQidWwShpRpHCGDiQrBr-Lk4ib] in
> /path/to/file.php on line 181
>
> So it appears a session is started.
>
> However, on the test system a session cookie is never sent back to the
> browser so the session cannot be restored, while on the development
> system everything works as it should (session cookie is set and
> session is therefore restored on each page load).
>
> Using 'wget -S', here are the response headers sent by the development
> system:
>
> $ wget -S http://dev/ajax/shopping_list.php\?action=add\&SKU=ABC
> --15:48:41-- http://dev/ajax/shopping_list.php?action=add&SKU=ABC
> => `shopping_list.php?action=add&SKU=ABC.1'
> Resolving dev... 192.168.0.30
> Connecting to dev|192.168.0.30|:80... connected.
> HTTP/1.1 200 OK
> Date: Mon, 11 Dec 2006 23:48:41 GMT
> Server: Apache/2.2.3 (FreeBSD) mod_ssl/2.2.3 OpenSSL/0.9.7e-p1 DAV/2
> PHP/5.2.0 with Suhosin-Patch mod_ruby/1.2.5 Ruby/1.8.5(2006-08-25)
> SVN/1.4.2
> mod_jk/1.2.15
> X-Powered-By: PHP/5.2.0
> Set-Cookie: PHPSESSID=WJ33PpO,nphiPAVxrbrWrQEnO5a; path=/
> Expires: Thu, 19 Nov 1981 08:52:00 GMT
> Cache-Control: no-store, no-cache, must-revalidate, post-check=0,
> pre-check=0
> Pragma: no-cache
> Content-Length: 103
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Content-Type: application/xml
> Length: 103 [application/xml]
>
>
> And on the live server:
>
>
> $ wget -S http://test/ajax/shopping_list.php\?action=add\&SKU=ABC
> --15:48:26-- http://test/ajax/shopping_list.php?action=add&SKU=ABC
> => `shopping_list.php?action=add&SKU=ABC'
> Resolving test... 192.168.0.31
> Connecting to test|192.168.0.31|:80... connected.
> HTTP request sent, awaiting response...
> HTTP/1.1 200 OK
> Date: Mon, 11 Dec 2006 23:48:26 GMT
> Server: Apache/2.0.59 (Unix) mod_ssl/2.0.59 OpenSSL/0.9.7e-p1 SVN/1.3.2
> PHP/5.2.0 DAV/2
> X-Powered-By: PHP/5.2.0
> Content-Length: 103
> Keep-Alive: timeout=15, max=100
> Connection: Keep-Alive
> Content-Type: application/xml
> Length: 103 [application/xml]
>
your dev machine runs the with Suhosin-Patch, the live system does not -
that's a big difference.
> test system:
> =======
> './configure' '--with-mysql=/usr/local/mysql'
> '--with-pgsql=/usr/local/pgsql'
> '--with-gettext' '--with-xml' '--with-imap' '--with-imap-ssl'
> '--with-pspell'
> '--with-zlib' '--with-zlib-dir=/usr' '--with-bz2' '--with-ndbm'
> '--enable-dba'
> '--with-gd' '--enable-gd-native-ttf' '--with-freetype-dir=/usr/local'
> '--with-jpeg-dir=/usr/local' '--with-tiff-dir=/usr/local'
> '--with-png-dir=/usr/local' '--with-tidy' '--with-openssl'
> '--enable-sysvsem'
> '--enable-sysvshm' '--enable-dbase' '--enable-ftp' '--enable-memory-limit'
> '--enable-inline-optimization' '--disable-debug'
> '--with-apxs2=/usr/local/apache2/bin/apxs' '--prefix=/usr/local/php'
> '--with-config-file-path=/usr/local/php'
>
> development system:
> ============
> './configure' '--enable-versioning' '--enable-memory-limit'
> '--with-layout=GNU'
> '--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
> '--enable-libxml' '--with-libxml-dir=/usr/local' '--enable-reflection'
> '--enable-spl' '--program-prefix=' '--disable-path-info-check'
> '--with-apxs2=/usr/local/sbin/apxs' '--with-regex=php'
> '--with-zend-vm=CALL'
> '--prefix=/usr/local'
>
> I acknowledge that these aren't particularly similar, but they do not
> differ in any way that should cause this difference in behavior (do
> they?).
I can't pinpoint anything in particular but I would suggest it's worth
ruling out any possibility of the problem being due to the configure options
by rebuilding your dev php binary to be identical to the live version.
>
> The PHP modules loaded match between the two systems, with the
> exception of tidy which is enabled on the test machine and not enabled
> on the development system.
>
> And again, php.ini are identical between the systems.
if that is the case then first check to see if your webserver can actually write
session files to the designated directory on the live server.
>
> What could explain this difference in behavior?
>
>
> Thanks,
>
> Matthew H. North
>
attached mail follows:
Richard Morris wrote:
> Hello all,
>
> I was experimenting with the imap_* library functions trying to see if I
> could get a PHP script to access a folder on our IMAP server and I ran
> into a problem.
>
> I was trying to get a simple script to work which simply opened a
> connection to the mail server and then closed it but when I ran the
> script it caused a segmentation fault on the imap_open line. Here is
> the code I was trying to run:
>
> <?php
> $mailbox = '{mail.hddbroker.com:143}INBOX';
> $username = 'xxx';
> $password = 'yyy';
>
> $mbox = imap_open($mailbox, $username, $password);
> imap_close($mbox);
> ?>
>
> and on the CLI it produced the output: Segmentation fault (core dumped)
>
> I configured my PHP installation with --enable-debug and using the core
> dump, I got the following backtrace:
>
> #0 0x00144019 in SSL_SESSION_hash () from /lib/libssl.so.4
> #1 0x001ca484 in lh_free () from /lib/libcrypto.so.4
> #2 0x001ca5f3 in lh_delete () from /lib/libcrypto.so.4
> #3 0x00148141 in SSL_CTX_get_timeout () from /lib/libssl.so.4
> #4 0x001ca56e in lh_retrieve () from /lib/libcrypto.so.4
> #5 0x001481f7 in SSL_CTX_flush_sessions () from /lib/libssl.so.4
> #6 0x001441a3 in SSL_CTX_free () from /lib/libssl.so.4
> #7 0x005185ac in ssl_close () from /usr/lib/libc-client.so.0
> #8 0x0051851f in ssl_close () from /usr/lib/libc-client.so.0
> #9 0x005176c3 in ssl_aopen () from /usr/lib/libc-client.so.0
> #10 0x0054a697 in imap_open () from /usr/lib/libc-client.so.0
> #11 0x00523a90 in mail_open () from /usr/lib/libc-client.so.0
> #12 0x0814dcfc in zif_imap_open (ht=3, return_value=0xb7c8bc9c,
> return_value_ptr=0x0, this_ptr=0x0, return_value_used=1)
> at /usr/local/src/php-5.2.0/ext/imap/php_imap.c:780
> #13 0x08332c92 in zend_do_fcall_common_helper_SPEC
> (execute_data=0xbfe372e0) at
> /usr/local/src/php-5.2.0/Zend/zend_vm_execute.h:200
> #14 0x08332419 in execute (op_array=0xb7c8b68c) at
> /usr/local/src/php-5.2.0/Zend/zend_vm_execute.h:92
> #15 0x0831aa9b in zend_execute_scripts (type=8, retval=0x0,
> file_count=3) at /usr/local/src/php-5.2.0/Zend/zend.c:1097
> #16 0x082e4a51 in php_execute_script (primary_file=0xbfe397d0) at
> /usr/local/src/php-5.2.0/main/main.c:1758
> #17 0x08393462 in main (argc=2, argv=0xbfe398a4) at
> /usr/local/src/php-5.2.0/sapi/cli/php_cli.c:1108
>
>
> It doesn't mean too much to me but I thought someone might be able to
> understand it. Here is some additional details that might be needed:
>
> PHP Version: PHP 5.2.0 (cli) (built: Nov 3 2006 06:07:03)
> OS: CentOS 4.4 i386
> RPM packages installed:
> - openssl-0.9.7a-43.14
> - openssl-devel-0.9.7a-43.14
> - libc-client-2002e-14
> - libc-client-devel-2002e-14
>
> There was a bug opened that has the same segmentation problem but the
> scenario seems to be different including using a different version
> number. PHP Bug #39726 (http://bugs.php.net/bug.php?id=39726)
>
> If there are any other details I can provide or if someone could point
> my in another direction that would help, I would really appreciate it.
If you don't have any luck here, try the php-internals list. All of the
php c-developers reside on that list, they will have a better idea on
how to approach this.
--
Postgresql & php tutorials
http://www.designmagick.com/
attached mail follows:
Hello all:
I'm new here and looking PHP these days, howerver , I'm confused by how it
works, and here is some questions I have.
Is there any old bird wanna help me out?
1. I heard there is a zend engine inside PHP playing the role as a virtual
machine, and PHP excution have 2 step, first compile to opcode and then
excute the opcode,
so is that means the php are compiled only once per file? or still need to
recompile when another request issued to the server? also I heard about the
caching extention about php, is it talking about caching the opcode? is't
caching the opcode or excute results? how it shares between the requests?
2. Is there some alternative choise except zend engineen, why need a zend
engine? for performance advantage or just easy for porting to different
platform?
3. Take linux apache for example, if compiled as a apache module, and using
prefork threading model, for example, if I have 100 process, is that means I
have 100 copy of PHP library local data(I assume only one reentrant
excutable image) in each process? compare to a worker model, like 10 process
and 10 threads in each one process, should it make a difference that we only
have 10 copy of PHP library local data ?
I'm not sure if this is the right place to talk about this, anyway, if you
know a better place, help me out :)
Thanks in advantage
Regards
Kai
attached mail follows:
# maillist.kai
gmail.com / 2006-12-13 14:15:26 +0800:
> I'm new here and looking PHP these days, howerver , I'm confused by how it
> works, and here is some questions I have.
> Is there any old bird wanna help me out?
>
> 1. I heard there is a zend engine inside PHP playing the role as a virtual
> machine, and PHP excution have 2 step, first compile to opcode and then
> excute the opcode,
> so is that means the php are compiled only once per file? or still need to
> recompile when another request issued to the server? also I heard about the
> caching extention about php, is it talking about caching the opcode? is't
> caching the opcode or excute results? how it shares between the requests?
Both kinds of things exist, with different sharing strategies.
> 3. Take linux apache for example, if compiled as a apache module, and using
> prefork threading model, for example, if I have 100 process, is that means I
> have 100 copy of PHP library local data(I assume only one reentrant
> excutable image) in each process? compare to a worker model, like 10 process
> and 10 threads in each one process, should it make a difference that we only
> have 10 copy of PHP library local data ?
Practical concerns make your question moot: even if the basic
distribution was all threadsafe, you're bound to hit a library that uses
strtok(3) or strerror(3), or static variables. How much of the code you
rely on is labelled by its authors as threadsafe?
--
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:
Kai Xiang wrote:
> Hello all:
>
> I'm new here and looking PHP these days, howerver , I'm confused by how it
> works, and here is some questions I have.
> Is there any old bird wanna help me out?
>
> 1. I heard there is a zend engine inside PHP playing the role as a virtual
> machine, and PHP excution have 2 step, first compile to opcode and then
> excute the opcode,
> so is that means the php are compiled only once per file? or still need to
> recompile when another request issued to the server? also I heard about the
> caching extention about php, is it talking about caching the opcode? is't
> caching the opcode or excute results? how it shares between the requests?
there are opcode caching mechanisms available (e.g. php.net/apc - which needs to
be installed via 'pecl'**); however the standard php installation will not do any
opcode caching (i.e. compilation to opcode is done at each request).
** pecl.php.net / pear.php.net
>
> 2. Is there some alternative choise except zend engineen, why need a zend
> engine? for performance advantage or just easy for porting to different
> platform?
no, there is no plugin replacement for the zend engine and AFAIK the zend engine
is not used in any other products apart from php ... maybe zend.com has an
article on what exactly the zend engine is (I have never really bothered to
find out myself :-).
>
> 3. Take linux apache for example, if compiled as a apache module, and using
> prefork threading model, for example, if I have 100 process, is that
> means I
> have 100 copy of PHP library local data(I assume only one reentrant
> excutable image) in each process? compare to a worker model, like 10
> process
> and 10 threads in each one process, should it make a difference that we
> only
> have 10 copy of PHP library local data ?
php is not threadsafe (well actually some php extensions are not thread safe ...
it's an unknown quantity) the prefork worker module for apache2 is the only
recommended way to go (if running as an apache module)
you might want to look into the FastCGI SAPI if you need a speed boost ...
I can't tell you anything about it because I have no experience with it as such.
>
> I'm not sure if this is the right place to talk about this, anyway, if you
> know a better place, help me out :)
this is the place - always best to ask here first; if what your asking is
better aimed at the developers list someone here will point you in the right direction.
> Thanks in advantage
>
> Regards
> Kai
>
attached mail follows:
On 12/13/06, Roman Neuhauser <neuhauser
sigpipe.cz> wrote:
> # maillist.kai
gmail.com / 2006-12-13 14:15:26 +0800:
> > I'm new here and looking PHP these days, howerver , I'm confused by how
> it
> > works, and here is some questions I have.
> > Is there any old bird wanna help me out?
> >
> > 1. I heard there is a zend engine inside PHP playing the role as a
> virtual
> > machine, and PHP excution have 2 step, first compile to opcode and then
> > excute the opcode,
> > so is that means the php are compiled only once per file? or still need
> to
> > recompile when another request issued to the server? also I heard about
> the
> > caching extention about php, is it talking about caching the opcode?
> is't
> > caching the opcode or excute results? how it shares between the
> requests?
>
> Both kinds of things exist, with different sharing strategies.
Can you tell it more detail, opcode caching cache the compiled opcode, so
not any compile needed anymore if no source changed? what about results,
what kind of methdology it's taking?
> > 3. Take linux apache for example, if compiled as a apache module, and
> using
> > prefork threading model, for example, if I have 100 process, is that
> means I
> > have 100 copy of PHP library local data(I assume only one reentrant
> > excutable image) in each process? compare to a worker model, like 10
> process
> > and 10 threads in each one process, should it make a difference that we
> only
> > have 10 copy of PHP library local data ?
>
> Practical concerns make your question moot: even if the basic
> distribution was all threadsafe, you're bound to hit a library that uses
> strtok(3) or strerror(3), or static variables. How much of the code you
> rely on is labelled by its authors as threadsafe?
So it is not a good idea to use worker and php module at the same time, but
if no threadsafe problem , maybe my thinking is right?
Btw, I thought strerror in libc were thread-safe.
> --
> 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:
On 12/13/06, Jochem Maas <jochem
iamjochem.com> wrote:
>
> Kai Xiang wrote:
> > Hello all:
> >
> > I'm new here and looking PHP these days, howerver , I'm confused by how
> it
> > works, and here is some questions I have.
> > Is there any old bird wanna help me out?
> >
> > 1. I heard there is a zend engine inside PHP playing the role as a
> virtual
> > machine, and PHP excution have 2 step, first compile to opcode and then
> > excute the opcode,
> > so is that means the php are compiled only once per file? or still need
> to
> > recompile when another request issued to the server? also I heard about
> the
> > caching extention about php, is it talking about caching the opcode?
> is't
> > caching the opcode or excute results? how it shares between the
> requests?
>
> there are opcode caching mechanisms available (e.g. php.net/apc - which
> needs to
> be installed via 'pecl'**); however the standard php installation will not
> do any
> opcode caching (i.e. compilation to opcode is done at each request).
>
> ** pecl.php.net / pear.php.net
That sounds good, I can take a more look at it
> >
> > 2. Is there some alternative choise except zend engineen, why need a
> zend
> > engine? for performance advantage or just easy for porting to different
> > platform?
>
> no, there is no plugin replacement for the zend engine and AFAIK the zend
> engine
> is not used in any other products apart from php ... maybe zend.com has an
> article on what exactly the zend engine is (I have never really bothered
> to
> find out myself :-).
>
> > 3. Take linux apache for example, if compiled as a apache module, and
> using
> > prefork threading model, for example, if I have 100 process, is that
> > means I
> > have 100 copy of PHP library local data(I assume only one reentrant
> > excutable image) in each process? compare to a worker model, like 10
> > process
> > and 10 threads in each one process, should it make a difference that we
> > only
> > have 10 copy of PHP library local data ?
>
> php is not threadsafe (well actually some php extensions are not thread
> safe ...
> it's an unknown quantity) the prefork worker module for apache2 is the
> only
> recommended way to go (if running as an apache module)
>
> you might want to look into the FastCGI SAPI if you need a speed boost ...
> I can't tell you anything about it because I have no experience with it as
> such.
>
> >
> > I'm not sure if this is the right place to talk about this, anyway, if
> you
> > know a better place, help me out :)
>
> this is the place - always best to ask here first; if what your asking is
> better aimed at the developers list someone here will point you in the
> right direction.
That's fine, thanks
> Thanks in advantage
> >
> > Regards
> > Kai
> >
>
>
attached mail follows:
Kai Xiang wrote:
> On 12/13/06, Roman Neuhauser <neuhauser
sigpipe.cz> wrote:
>
>> # maillist.kai
gmail.com / 2006-12-13 14:15:26 +0800:
>> > I'm new here and looking PHP these days, howerver , I'm confused by how
>> it
>> > works, and here is some questions I have.
>> > Is there any old bird wanna help me out?
>> >
>> > 1. I heard there is a zend engine inside PHP playing the role as a
>> virtual
>> > machine, and PHP excution have 2 step, first compile to opcode and then
>> > excute the opcode,
>> > so is that means the php are compiled only once per file? or still need
>> to
>> > recompile when another request issued to the server? also I heard about
>> the
>> > caching extention about php, is it talking about caching the opcode?
>> is't
>> > caching the opcode or excute results? how it shares between the
>> requests?
>>
>> Both kinds of things exist, with different sharing strategies.
>
>
> Can you tell it more detail, opcode caching cache the compiled opcode, so
> not any compile needed anymore if no source changed? what about results,
> what kind of methdology it's taking?
you can get a good idea of APC from the changelog:
http://pecl.php.net/package-changelog.php?package=APC
Zend als offers opcode caching as part of their suite of products ... Im
not all to familiar with Zend's stuff but no doubt their website has plenty
of info.
>
>
>
>> > 3. Take linux apache for example, if compiled as a apache module, and
>> using
>> > prefork threading model, for example, if I have 100 process, is that
>> means I
>> > have 100 copy of PHP library local data(I assume only one reentrant
>> > excutable image) in each process? compare to a worker model, like 10
>> process
>> > and 10 threads in each one process, should it make a difference that we
>> only
>> > have 10 copy of PHP library local data ?
>>
>> Practical concerns make your question moot: even if the basic
>> distribution was all threadsafe, you're bound to hit a library that uses
>> strtok(3) or strerror(3), or static variables. How much of the code you
>> rely on is labelled by its authors as threadsafe?
>
>
> So it is not a good idea to use worker and php module at the same time, but
correct - stick with the prefork module with apache, I believe *think* it is possible
to safely use a threaded module if you decide to go the FastCGI route but I maybe
thinking this because I completely misunderstood what someone was saying about FastCGI
(I remember reading quite abit about FastCGI in posts made to internals
lists.php.net
by core-dev/Zend-Founder Andi Gutmans - although I can't say I understood everything I read!)
> if no threadsafe problem , maybe my thinking is right?
> Btw, I thought strerror in libc were thread-safe.
>
>
attached mail follows:
# maillist.kai
gmail.com / 2006-12-13 18:57:58 +0800:
> On 12/13/06, Roman Neuhauser <neuhauser
sigpipe.cz> wrote:
> ># maillist.kai
gmail.com / 2006-12-13 14:15:26 +0800:
> >> 3. Take linux apache for example, if compiled as a apache module,
> >> and using prefork threading model, for example, if I have 100
> >> process, is that means I have 100 copy of PHP library local data(I
> >> assume only one reentrant excutable image) in each process? compare
> >> to a worker model, like 10 process and 10 threads in each one
> >> process, should it make a difference that we only have 10 copy of
> >> PHP library local data ?
> >
> >Practical concerns make your question moot: even if the basic
> >distribution was all threadsafe, you're bound to hit a library that
> >uses strtok(3) or strerror(3), or static variables. How much of the
> >code you rely on is labelled by its authors as threadsafe?
>
>
> So it is not a good idea to use worker and php module at the same
> time, but if no threadsafe problem , maybe my thinking is right?
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
> Btw, I thought strerror in libc were thread-safe.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
In a touch of genius, you summed up the whole thread-safety problem
so succintly, it puts an end to the whole thread.
--
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:
Hi Ivo,
Sorry for the late reply, I have been traveling.
I am assigning someone to your case who will assist you in understanding
the cause of the inclusion of the vulnerability in your own functions.
To my understanding it is that it could be the result of a repetition of
an instance discovered in your function. If you are then to include the
function a number of times, the vulnerability will be identified in all
those instances.
However, I am assigning someone to this question who will give you a
better answer, his name is Chris.
As to your comments, I would greatly appreciate them.
Thanks and all the best,
Jordan Forssman
Sales Manager
Armorize Technologies
US:
Tel: +1-408-512-4052 ext. 201
Fax: +1-408-247-1570
TW:
Tel. +886-2-6616-0100 ext. 201
Cell. +886-938-100-214
Fax. +886-2-6616-1100
Skype: jordan4z
jordan4z
hotmail.com
-----Original Message-----
From: Ivo F.A.C. Fokkema [mailto:I.F.A.C. Fokkema
LUMC.nl]
Sent: Saturday, December 02, 2006 12:26 AM
To: php-general
lists.php.net
Subject: Re: FW: [PHP] Re: Please hack my app
Hi Jordan,
Thank you for your offer. As you know, I've signed up a couple of days
ago. I ran a scan yesterday and have gotten a big PDF file out of it.
I've quickly scanned through the results and it appears there are a lot
of
times when I use one of my own functions (sometimes even without an
argument) it finds a vulnerability. I will analyze the results more
detailed later on. Would you appreciate comments on the service?
Thanks again,
Ivo
On Tue, 28 Nov 2006 14:19:30 +0800, Jordan Forssman wrote:
> Hi,
>
> My name is Jordan Forssman, I am representing a company called
Armorize
> Technologies. We have developed a source code analysis platform for
PHP,
> called CodeSecure, which scans source code for SQL injection, cross
site
> scripting, command injection, etc, vulnerability. The tool will tell
you
> exactly which line the vulnerability is on, explain the propagation of
> the tainted variables, and assist you in fixing the bug. I believe
this
> tool will help you verify the security of your application and will be
> able to do so very quickly. At the moment we are scanning around 20
000
> lines in under 5 minutes, or 1M in about 2 minutes, depending on the
> application.
>
> Currently we are accepting applications for trial accounts, if you
would
> like to use our tool to scan your code please log on to
> http://www.armorize.com/events/trialapplication and submit the form.
> We are just starting our sales and marketing effort so I hope you can
> use our product and give us some feedback.
>
> If you want to know more about our company and product you can find us
> at: www.armorize.com , download our datasheets and whitepapers at
> www.armorize.com/resources/download .
>
> The trial is free and can be accessed over the Web, we are using the
> trials as a test case for offering the product as a service and also
to
> promote the product. Once I receive your application I will send you
an
> e-mail with a quickstart guide and login details.
>
> If you have any questions, please feel free to contact me anytime.
>
> Best Regards,
>
> Jordan Forssman
> Sales Manager
> Armorize Technologies
> Tel. +886-2-6616-0100 ext. 201
> Cell. +886-938-100-214
> Fax. +886-2-6616-1100
> Skype: jordan4z
> jordan
armorize.com
> jordan4z
hotmail.com
>
>
> -----Original Message-----
> From: Ivo F.A.C. Fokkema [mailto:I.F.A.C. Fokkema
LUMC.nl]
> Sent: Monday, November 27, 2006 6:01 PM
> To: php-general
lists.php.net
> Subject: [PHP] Re: Please hack my app
>
> On Wed, 22 Nov 2006 09:57:50 +0100, Ivo F.A.C. Fokkema wrote:
>
>> Hi List,
>>
>> As this subject may start you wondering what the hell I'm thinking,
> let me
>> clearify:
>>
>> I've been rewriting an GPL'ed PHP/MySQL app from scratch for the last
> 12
>> months or so. It facilitates storage of DNA mutations and the
>> corresponding patient data. Because patient data is involved, privacy
> is
>> very important.
>> Now of course I read lots of pages on SQL injection and whatnot, and
I
>> strongly believe my application is protected from this kind of abuse.
>> However, believing is not enough. I've had some comments in the past
> about
>> security (previous version of the software) and although I didn't
> agree to
>> the critic, I want to be able to say the new app went though various
> forms
>> of attacks. This month, I want to release 2.0-alpha-01...
>>
>> *** THIS IS NOT ABOUT HACKING THE SERVER ***
>> But about getting in the application when you're not allowed to!
>>
>> If you feel like helping me out, it's located at
>> http://chromium.liacs.nl/LOVDv.2.0-dev/
>>
>> 1) Please try to get in. There's one account in the system, a
database
>> administrator, capable of doing anything. If you get in, you can
> easily
>> create a new user using the setup tab. This will be the prove of you
>> breaking my security rules.
>>
>> 2) Can you manage to view unpublic data? Using the Variants tab, you
>> can see there is currently one entry in the database (with two
> mutations).
>> This entry has a hidden column, called 'Patient ID'. There is a
>> text-string in that column. If you can tell me what that string is,
> you
>> win :)
>>
>> 3) Feel free to register as a submitter to see if that gives you any
>> rights that you shouldn't have. A submitter is only capable of adding
> new
>> data to the database (Submit tab), but that data will not be
published
>> immediately.
>>
>> 4) After a while, I will release login details of a curator account.
> This
>> user is allowed to see non-public data and handle the specific gene,
> but
>> NOT create new users or the like.
>>
>>
>> If you have any questions, please ask. Thank you in advance for using
> your
>> expertise for the good cause :)
>
> In case anyone is interested; I've created a low-level user
> ('untrusted')
> in the system. Password is equal to username. Feel free to try and do
> stuff you're not supposed to, like creating a new user or creating a
> gene.
>
> Ivo
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Hello,
How can I pass a variable from popup window back to the page that originally
opened the popup? Or can I?
Thanks
-Will
attached mail follows:
Hello,
How can I pass a variable from popup window back to the page that originally
opened the popup? Or can I?
Thanks
-Will
attached mail follows:
You can pass values of inputs/variables from a popup window to
opener window through javascript like:
window.opener.document.form1.input1.value = js_value;
where js_value can be a javascript variable or a value of an input
in a form in the popup window.
Andy
William Stokes wrote:
> Hello,
>
> How can I pass a variable from popup window back to the page that originally
> opened the popup? Or can I?
>
> Thanks
> -Will
>
>
attached mail follows:
Tim wrote:
> Just a quick question regarding this issue.
>
> Considering bruce wants to be able to display the data and then change
> location after a given time, and as stut said you can't do this with a
> header() as it redirects before output, I would have imagined a dynamic meta
> tag in the header with a time variable and a location variable.
>
> But then I wonder what affect this has regards to html standards?
> Are dynamic meta tags depreciated?
What exactly do you have in mind when you mention "dynamic" meta tags?
Do you just mean using a meta refresh tag?
<meta http-equiv="refresh" content="2;url=http://www.example.com">
I believe that would be the best solution to Bruce's problem.
This meta tag can be used on the page with the information to be shown
and automatically redirected to the URL specified in the tag after n
seconds. In the above example, redirection to www.example.com will
happen after 2 seconds.
Good luck Bruce
>
> Regards,
> Tim
>
>> -----Message d'origine-----
>> De : Stut [mailto:stuttle
gmail.com]
>> Envoyé : mardi 12 décembre 2006 19:52
>> À : bedouglas
earthlink.net
>> Cc : php
>> Objet : Re: [PHP] php redirection..
>>
>> bruce wrote:
>>> hey stut...
>> Please don't reply to me directly, always include the mailing list.
>>
>>> thanks for the reply... i did get some output...
>>>
>>> i also have a question as to why i couldn't get it to work when i used
>>> 'header (foo.php)'
>> 1) The correct way to redirect using the header function is
>> header('Location: http://domain.com/foo.php'); Note the absolute URL.
>> 2) Using header will definitely not display any output from the page.
>>
>>> i did a 'ob_end_flush()' at the start, followed by a 'header()' at the
>> end,
>>> but the header didn't seem to function as i though it should.
>> I suggest you read about the header function in the manual
>> (http://php.net/header) - you clearly don't have any idea what it does.
>>
>>> given that the ultimate information that i'm going to want to display
>> will
>>> be dynamic. some times it might be 5 lines, others 100, others 50...
>>>
>>> i had hoped that i could somehow display the content, wait a few
>> seconds,
>>> and then do an auto redirect...
>> Like I said in my first reply, Google for the Javascript function
>> settimeout - that's what you need.
>>
>>> any thoughts/comments...
>> I have lots of comments. Thoughts are less common but they do
>> occasionally happen.
>>
>> -Stut
>>
>>> -----Original Message-----
>>> From: Stut [mailto:stuttle
gmail.com]
>>> Sent: Tuesday, December 12, 2006 9:21 AM
>>> To: bedouglas
earthlink.net
>>> Cc: php-general
lists.php.net
>>> Subject: Re: [PHP] php redirection..
>>>
>>>
>>> bruce wrote:
>>>> i want to be able to display some text/content and to then redirect the
>>> user
>>>> to another page.
>>>>
>>>> basically:
>>>>
>>>> cat.php
>>>> -echo " test content<br>"
>>>> -echo " more test content<br>"
>>>>
>>>> //redirect user
>>>> echo"
>>>> <script>
>>>> location.href='foo.php';
>>>> </script>
>>>> ";
>>>>
>>>> ---------------
>>>> foo.php
>>>> -echo "i'm here"
>>>>
>>>>
>>>> should be pretty simple...
>>>>
>>>> however, in my test, without the script/location.href i display the
>>> content
>>>> ok. when i add the script/location.href, i get redirected, but the
>> content
>>>> is never displayed...
>>>>
>>>> any thoughts/samples/pointers on what might be going on, and how this
>>> should
>>>> really be accomplished..
>>>>
>>>> to be honest, i'm embarrassed to even be raising this here!!
>>> And so you should be what with it being a Javascript question and this
>>> being a PHP list.
>>>
>>> Anyhoo, I don't get your confusion. The browser will run the script as
>>> it loads it from your site. Ergo, it redirects before it displays what
>>> you have output. I suggest you Google for examples of the settimeout
>>> Javscript function - that's what you need to delay the redirect.
>>>
>>> -Stut
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>
attached mail follows:
> -----Message d'origine-----
> De : Youri LACAN-BARTLEY [mailto:ylacan
teicam.com]
> Envoyé : mercredi 13 décembre 2006 09:09
> Cc : 'php'
> Objet : Re: [PHP] php redirection..
>
>
> Tim wrote:
> > Just a quick question regarding this issue.
> >
> > Considering bruce wants to be able to display the data and then change
> > location after a given time, and as stut said you can't do this with a
> > header() as it redirects before output, I would have imagined a dynamic
> meta
> > tag in the header with a time variable and a location variable.
> >
> > But then I wonder what affect this has regards to html standards?
> > Are dynamic meta tags depreciated?
>
> What exactly do you have in mind when you mention "dynamic" meta tags?
> Do you just mean using a meta refresh tag?
>
Yes I meant just using a meta refresh tag with php variables to make it more
flexible:
echo '<meta http-equiv="refresh" content="' . $time . ';url=' . $url . '">';
I modify meta title/content this way aswell.
> <meta http-equiv="refresh" content="2;url=http://www.example.com">
>
> I believe that would be the best solution to Bruce's problem.
> This meta tag can be used on the page with the information to be shown
> and automatically redirected to the URL specified in the tag after n
> seconds. In the above example, redirection to www.example.com will
> happen after 2 seconds.
>
> Good luck Bruce
>
> >
> > Regards,
> > Tim
> >
> >> -----Message d'origine-----
> >> De : Stut [mailto:stuttle
gmail.com]
> >> Envoyé : mardi 12 décembre 2006 19:52
> >> À : bedouglas
earthlink.net
> >> Cc : php
> >> Objet : Re: [PHP] php redirection..
> >>
> >> bruce wrote:
> >>> hey stut...
> >> Please don't reply to me directly, always include the mailing list.
> >>
> >>> thanks for the reply... i did get some output...
> >>>
> >>> i also have a question as to why i couldn't get it to work when i used
> >>> 'header (foo.php)'
> >> 1) The correct way to redirect using the header function is
> >> header('Location: http://domain.com/foo.php'); Note the absolute URL.
> >> 2) Using header will definitely not display any output from the page.
> >>
> >>> i did a 'ob_end_flush()' at the start, followed by a 'header()' at the
> >> end,
> >>> but the header didn't seem to function as i though it should.
> >> I suggest you read about the header function in the manual
> >> (http://php.net/header) - you clearly don't have any idea what it does.
> >>
> >>> given that the ultimate information that i'm going to want to display
> >> will
> >>> be dynamic. some times it might be 5 lines, others 100, others 50...
> >>>
> >>> i had hoped that i could somehow display the content, wait a few
> >> seconds,
> >>> and then do an auto redirect...
> >> Like I said in my first reply, Google for the Javascript function
> >> settimeout - that's what you need.
> >>
> >>> any thoughts/comments...
> >> I have lots of comments. Thoughts are less common but they do
> >> occasionally happen.
> >>
> >> -Stut
> >>
> >>> -----Original Message-----
> >>> From: Stut [mailto:stuttle
gmail.com]
> >>> Sent: Tuesday, December 12, 2006 9:21 AM
> >>> To: bedouglas
earthlink.net
> >>> Cc: php-general
lists.php.net
> >>> Subject: Re: [PHP] php redirection..
> >>>
> >>>
> >>> bruce wrote:
> >>>> i want to be able to display some text/content and to then redirect
> the
> >>> user
> >>>> to another page.
> >>>>
> >>>> basically:
> >>>>
> >>>> cat.php
> >>>> -echo " test content<br>"
> >>>> -echo " more test content<br>"
> >>>>
> >>>> //redirect user
> >>>> echo"
> >>>> <script>
> >>>> location.href='foo.php';
> >>>> </script>
> >>>> ";
> >>>>
> >>>> ---------------
> >>>> foo.php
> >>>> -echo "i'm here"
> >>>>
> >>>>
> >>>> should be pretty simple...
> >>>>
> >>>> however, in my test, without the script/location.href i display the
> >>> content
> >>>> ok. when i add the script/location.href, i get redirected, but the
> >> content
> >>>> is never displayed...
> >>>>
> >>>> any thoughts/samples/pointers on what might be going on, and how this
> >>> should
> >>>> really be accomplished..
> >>>>
> >>>> to be honest, i'm embarrassed to even be raising this here!!
> >>> And so you should be what with it being a Javascript question and this
> >>> being a PHP list.
> >>>
> >>> Anyhoo, I don't get your confusion. The browser will run the script as
> >>> it loads it from your site. Ergo, it redirects before it displays what
> >>> you have output. I suggest you Google for examples of the settimeout
> >>> Javscript function - that's what you need to delay the redirect.
> >>>
> >>> -Stut
> >>>
> >>> --
> >>> PHP General Mailing List (http://www.php.net/)
> >>> To unsubscribe, visit: http://www.php.net/unsub.php
> >>>
> >> --
> >> PHP General Mailing List (http://www.php.net/)
> >> To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Dear All.
Do u know if its possible with PHP to receive a mail or connect to a
mail box and do something with an incomming email ? I see there is that
imap_open() but also there are sockets.
Basically I need to connect to a mailbox and then when a mail is
received it must take that mail and do something with the attachment
which I know how to do and is not important to this question.
Please maybe advise as to what the best way is and also if you have
experienced difficulties with a certain way.
Thanks in advance.
--
------------------------------------------------------------------------
Angelo Zanetti
Systems developer
------------------------------------------------------------------------
*Telephone:* +27 (021) 469 1052
*Mobile:* +27 (0) 72 441 3355
*Fax:* +27 (0) 86 681 5885
*
Web:* http://www.zlogic.co.za
*E-Mail:* angelo
zlogic.co.za <mailto:angelo
zlogic.co.za>
attached mail follows:
Forward the e-mail address to a PHP file, through forwarders in your system
(depends on the mta, how and where)
Than design a php file to read from php://stdin
It will read the mails once they are received.
--Aras
-----Original Message-----
From: Angelo Zanetti [mailto:angelo
zlogic.co.za]
Sent: Wednesday, December 13, 2006 4:18 PM
To: PHP List
Subject: [PHP] PHP and connection to mail account
Dear All.
Do u know if its possible with PHP to receive a mail or connect to a
mail box and do something with an incomming email ? I see there is that
imap_open() but also there are sockets.
Basically I need to connect to a mailbox and then when a mail is
received it must take that mail and do something with the attachment
which I know how to do and is not important to this question.
Please maybe advise as to what the best way is and also if you have
experienced difficulties with a certain way.
Thanks in advance.
--
------------------------------------------------------------------------
Angelo Zanetti
Systems developer
------------------------------------------------------------------------
*Telephone:* +27 (021) 469 1052
*Mobile:* +27 (0) 72 441 3355
*Fax:* +27 (0) 86 681 5885
*
Web:* http://www.zlogic.co.za
*E-Mail:* angelo
zlogic.co.za <mailto:angelo
zlogic.co.za>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
attached mail follows:
Angelo Zanetti wrote:
> Dear All.
>
> Do u know if its possible with PHP to receive a mail or connect to a
> mail box and do something with an incomming email ? I see there is that
> imap_open() but also there are sockets.
indeed - basically use whatever you want! - I would suggest have a search online,
there are quite a lot of mailbox related classes/libs/etc as well as fully featured
php webmail packages that you might be able to scrounge some useful code out of.
an alternative could be to configure your mail server to pipe the incoming
email directly to your script (i.e. don't deliver it to a mailbox at all) -
this has the advantage that your script doesn't have to run as a daemon (or via cron)
in order to poll the given mailbox - it simply recieves the email on stdin
whenever an email arrives.
>
> Basically I need to connect to a mailbox and then when a mail is
> received it must take that mail and do something with the attachment
> which I know how to do and is not important to this question.
>
> Please maybe advise as to what the best way is and also if you have
> experienced difficulties with a certain way.
>
> Thanks in advance.
>
attached mail follows:
Jochem Maas wrote:
> Angelo Zanetti wrote:
>
>> Do u know if its possible with PHP to receive a mail or connect to a
>> mail box and do something with an incomming email ? I see there is that
>> imap_open() but also there are sockets.
>>
>
> indeed - basically use whatever you want! - I would suggest have a search online,
> there are quite a lot of mailbox related classes/libs/etc as well as fully featured
> php webmail packages that you might be able to scrounge some useful code out of.
>
> an alternative could be to configure your mail server to pipe the incoming
> email directly to your script (i.e. don't deliver it to a mailbox at all) -
> this has the advantage that your script doesn't have to run as a daemon (or via cron)
> in order to poll the given mailbox - it simply recieves the email on stdin
> whenever an email arrives.
Just to add something to consider... which way you do it can depend on
what your script will be doing and how many emails you expect to
receive. If the script is intensive and/or you are expecting a lot of
emails you're better off cron'ing a script to deal with them otherwise
your server could end up bogged down by those processes. I can't speak
for other MTAs but I do know that with Postfix you can apply a limit to
the number of simultaneous processes that are started if you implement
it in the transport map.
-Stut
attached mail follows:
Stut wrote:
> Jochem Maas wrote:
>> Angelo Zanetti wrote:
>>
>>> Do u know if its possible with PHP to receive a mail or connect to a
>>> mail box and do something with an incomming email ? I see there is that
>>> imap_open() but also there are sockets.
>>>
>>
>> indeed - basically use whatever you want! - I would suggest have a
>> search online,
>> there are quite a lot of mailbox related classes/libs/etc as well as
>> fully featured
>> php webmail packages that you might be able to scrounge some useful
>> code out of.
>>
>> an alternative could be to configure your mail server to pipe the
>> incoming
>> email directly to your script (i.e. don't deliver it to a mailbox at
>> all) -
>> this has the advantage that your script doesn't have to run as a
>> daemon (or via cron)
>> in order to poll the given mailbox - it simply recieves the email on
>> stdin
>> whenever an email arrives.
>
> Just to add something to consider... which way you do it can depend on
> what your script will be doing and how many emails you expect to
> receive. If the script is intensive and/or you are expecting a lot of
> emails you're better off cron'ing a script to deal with them otherwise
> your server could end up bogged down by those processes. I can't speak
> for other MTAs but I do know that with Postfix you can apply a limit to
> the number of simultaneous processes that are started if you implement
> it in the transport map.
good point!
>
> -Stut
>
attached mail follows:
Hi,
even it's problem with osCommerce cart I think it's still php question:
there is a code in application_top.php file (this file is includeed in
login.php page, all the way on the top of the login.php file wich means is
"the first one")
// Check if the browser supports gzip encoding, HTTP_ACCEPT_ENCODING
if (strstr($HTTP_SERVER_VARS['HTTP_ACCEPT_ENCODING'], 'gzip'))
{
// Start output buffering, and register compress_output() (see
// below)
ob_start("compress_output");
// Tell the browser the content is compressed with gzip
header("Content-Encoding: gzip");
}
and I'm getting login.php as blank page.
But, when I hide ob_start() and header() lines I will get login page but
with Warning says "The Encryption key file is missing."?!?!?
Any idea?
-afan
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]