Re: [PHP] Re: Sending multipart/form-data request with PECL.

2009-03-04 Thread Manuel Lemos
Hello,

on 03/05/2009 02:31 AM Jason Cipriani said the following:
> Thanks. I actually had a look at the HttpRequest source code, and I
> can see the logic where it switches to multipart encoding if files are
> present but it actually appears that it's not possible to force it to
> do that. It's sort of annoying that it's right at my finger tips but
> there's no way to do it, and for sort of a silly reason (there's
> arbitrarily no way to pick which encoding to use, it decides for you
> even though it has the capability of doing anything). A custom PECL
> build is not an option, unfortunately.
> 
> I'll have to check out the httpclient class that Manuel Lemos mentioned.

Yes, the HTTP client class follows the same logic but has a variable
named force_multipart_form_post that you can set to make it send
multipart form posts as if you were submitting a form with an empty file
input.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Sending multipart/form-data request with PECL.

2009-03-04 Thread Manuel Lemos
Hello,

on 03/04/2009 03:33 PM Jason Cipriani said the following:
> I am trying to submit a request to an HTTP server with
> multipart/form-data encoded data. I'm using PECL's HttpRequest
> (although I'm open to alternatives). I am using PHP5.
> 
> I noticed that if you call addPostFile to add a file, PECL will send
> the file, and all other post parameters, with multipart/form-data
> encoding, so I know PECL has the capability to do it. If you simply
> call addPostFields but never call addPostFile, it uses standard post
> encoding.
> 
> Is there a way to force PECL to use multipart/form-data encoding for
> all post fields added with addPostFields, even when you are not
> calling addPostFile to add a file?
> 
> If not, is there another good way to encode multipart data with PHP?

I have no idea because I do not use PECL extensions.

I use this HTTP client class for emulating browser form submission. Take
a look at the test_http_post.php that has examples of how to upload
forms using POST requests:

http://www.phpclasses.org/httpclient


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] E-Mail Attachment Filename Encoding Problem

2009-02-17 Thread Manuel Lemos
on 02/17/2009 03:44 AM Edmund Hertle said the following:
> 2009/2/16 Richard Heyes 
> 
>>> I'm already using pear Mail_Mime.
>> [Ducks and runs off]
>>
>> --
>> Richard Heyes
>>
>> HTML5 Canvas graphing for Firefox, Chrome, Opera and Safari:
>> http://www.rgraph.org (Updated February 14th)
>>
> 
> Can someone explain to me why pear mail_mime is not a good idea to use? I
> noticed some comments like that a few times but no explanation

The PHP world is very pragmatic. If it works for you, it should be good
enough. Otherwise, you may need to look for something else.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: E-Mail Attachment Filename Encoding Problem

2009-02-16 Thread Manuel Lemos
Hello,

on 02/16/2009 06:19 AM Edmund Hertle said the following:
> my problem is that I send an e-mail with an attachment (pdf file). I get the
> filename out of a mysql table. While using echo or downloading the file, the
> filename is showed as expected but as an attachment it is not properly
> encoded:
> Should be: PC-Beschaffung 2008 (nur für Lehre)
> Will be: US-ASCII''PC-Beschaffung%202008%20(nur%20f%C3%BCr%20Lehre)
> 
> I think I have to encode the file name and already tried utf8encode but this
> didn't help.

You need to use q-encoding.

You may want to try this MIME message composing and sending class that
encodes file name attachments properly when necessary:

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Mail subject encoding problem

2009-01-31 Thread Manuel Lemos
Hello,

on 01/30/2009 11:43 AM Thodoris said the following:
> Yes I know that this is not reasonable but using UTF-8 fails. And this
> seems to work in some cases. I am thinking that this has to do with
> PHP's internal encoding or something with the OS. I am not sure why that
> works this way that's why I am asking for some enlightenment  :-)
> 
> Is there something that I need to set for PHP to change its behavior.

You cannot send 8 bit characters in e-mail. For headers you need to use
q-encoding to make your non-ASCIIC characters be represented with only
ASCII characters.

If you are not sure on how to encode message headers with q-encoding,
you may want to try this MIME message class. Take a look at the
test_email_message.php example to learn how to send messages with
non-ASCII characters on the headers or body.

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Curl fiel Upload

2009-01-20 Thread Manuel Lemos
Hello,

on 01/20/2009 09:10 PM Matthias Laug said the following:
> I've got a problem using curl to upload a file. I want to send it to a form
> written with the Django Framework.
> 
> Post Request are processed correctly, with one anomaly.
> This piece of code works fine
> 
> curl_setopt($process, CURLOPT_POSTFIELDS, http_build_query($data));
> 
> But if i provide only an array no data is send to the form
> 
> curl_setopt($process, CURLOPT_POSTFIELDS, $data);
> 
> I have read somewhere that curl sends formdata with enctype="form/mulitpart"
> only if I provide an array not a string.
> 
> If I add "@filename" to the $data variable (string or array) it does not
> send the file to the form.
> 
> Each example I have found in the internet so far did not work.

I do not use the Curl functions directly. When possible I use fsockopen
as alternative and use this HTTP client class to submit any kind of HTTP
requests. Take a look at the test_http_post.php to see how simple is to
submit form with one or more file uploads.

http://www.phpclasses.org/httpclient



-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] PHP telnet server

2008-12-30 Thread Manuel Lemos
Hello,

There are plenty of ready to use solutions to build TCP servers. Here
are some of them:

Simple TCP Daemon
http://www.phpclasses.org/daemon

Generic socket based networking servers
http://www.phpclasses.org/clssocket

Implement TCP socket server scripts
http://www.phpclasses.org/flosocket

Implement TCP/IP client and servers
http://www.phpclasses.org/net

Implement TCP socket servers
http://www.phpclasses.org/simpleserver

Handle multiple TCP socket connections
http://www.phpclasses.org/supersocket

Build TCP socket networking servers
http://www.phpclasses.org/qserv

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Architecture patterns in PHP

2008-12-30 Thread Manuel Lemos
Hello,

on 12/30/2008 04:27 PM Nathan Nobbe said the following:
>>>> I was following the blog tutorial on cake and here's what I got from
>>>> hitting the post/index page:
>>>>
>>>> 081230 12:51:55   316 Connect r...@localhost on
>>>>   316 Init DB cake
>>>>   316 Query   SHOW TABLES FROM `cake`
>>>>   316 Query   DESCRIBE `posts`
>>>>   316 Query   SELECT `Post`.`id`, `Post`.`title`,
>>>> `Post`.`body`, `Post`.`created`, `Post`.`modified` FROM `posts` AS
>>>> `Post`   WHERE 1 = 1
>>>>   316 Quit
>>> A good framework will allow you to replace the introspection step with a
>>> static definition of the database table, thus easily bypassing the extra
>>> queries. Although, I can't fathom why they've requested all the tables.
>>>
>>> Cheers,
>>> Rob.
>>> --
>>> http://www.interjinn.com
>>> Application and Templating Framework for PHP
>>>
>> To be fair cake did "cache" the show tables/describe magically for a
>> few seconds if I sat there refreshing the page. :)
>>
>> I always generate my Gateways & VO's from table definitions &
>> hand-code any non-crud statements.  I've never really dealt with this
>> stuff before but it is a little disheartening.  I would rather take
>> the 5 minutes re-generating a few files for an updated table versus
>> infinite amounts of computer power wasted trying to just make it work.
>>
> 
> which bodes really well for something like symphony, but im not sure how
> bulky the orm abstraction layer is.  that could end up ruining it in the
> end..

I think that part of the problem here is that those so called ORM
solutions are in reality ROM because they depart from the relational
data model to the object model. Since they do that dynamically, even
when they cache the results of reverse engineer the object model from
the database table structure, there is always some overhead reading
class structures from cache and rebuilding objects.

This article talks precisely about that problem.

http://www.phpclasses.org/blog/post/82-PHP-ObjectRelational-Mapping-ORM-or-ROM.html

Personally I use a code generation based solution named Metastorage. It
lets me defined my object models statically and then it generates
efficient code for the classes that store and retrieve the application
data objects.

http://www.metastorage.net/

This allows more flexibility and productivity than most ActiveRecord
based  approaches, as it supports complex object models with
relationships, validation rules, etc..

Then Metastorage generates smart code that only does what you need.
There are no fat base classes to extend, nor ORM runtime libraries to
include. The generated code is self-contained, i.e. it does all that is
necessary without runtime libraries to add overhead to the execution of
the applications.

In cases that it is not necessary to use persistent objects (because the
objects are not going to be changed), like for instance listing data or
sending newsletters, Metastorage provides the concept of report classes,
i.e. classes that just retrieve data for read-only purposes. It is much
more efficient than using whole persistent objects because it only
retrieves the object variables that you need into arrays.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Architecture patterns in PHP

2008-12-29 Thread Manuel Lemos
Hello,

on 12/30/2008 05:07 AM Nathan Nobbe said the following:
>>>> How do you structure your web applications? I am thinking in terms of
>>>> separating presentation  and logic. How is that done in PHP? And how
>>>> many architecture patterns are there?
>>>
>>> Well,
>>>
>>> I use, way of Rasmus (I give that name)
>>>
>>> and please read this why
>>>
>>> http://talks.php.net/show/drupal08/0
>> After you watch that presentation, the conclusion that you reach is if
>> you want to develop a site that only shows a page saying "Hello world!"
>> you should not use an MVC framework because it adds to much performance
>> overhead! ;-)
>>
> 
> it also acts as a nice control mechanism to compare so many frameworks,
> trivial php, and html.  really nice to see the numbers like that; so cake is
> horrifically slow, solar & zend are pretty fast and code igniter is like
> twice as fast as those.

I am not sure if that conclusion is correct. Were the benchmarks done
using a PHP cache extension? If not, the results may just show that Cake
 includes more code probably because it is more mature than others that
are younger.

What happens is that PHP code is compiled in zend opcode before
executing. The more code split in include files you load, more time it
spends loading the code before executing. When you use a PHP cache
extension, the compile phase is skipped and replaced by loading compiled
PHP code from cache. So most of the time is taken actually by executing
the code.

Therefore using the PHP cache extension may give more useful results to
compare framework execution overhead.


> i also like how rasmus shows several advanced optimization techniques, via
> strace and gdb.  ive not used the 'included' extension, ill probly check it
> out.  you know some of us yougin's never really got too much pratical
> exposure to tools like that =/  im still ramping up on these low level
> utilities myself.

Those may not be the best tools to tell you what PHP code is taking more
time to execute, as they only show system calls. There are PHP profiler
extension that give you a better vision of the actual PHP code that may
be slowing down things.

strace is more useful for PHP core developers as it tells which system
calls are more expensive and could be worth some optimization.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Architecture patterns in PHP

2008-12-29 Thread Manuel Lemos
Hello,

on 12/30/2008 01:13 AM Sancar Saran said the following:
>> How do you structure your web applications? I am thinking in terms of
>> separating presentation  and logic. How is that done in PHP? And how
>> many architecture patterns are there?
> 
> 
> Well,
> 
> I use, way of Rasmus (I give that name)
> 
> and please read this why
> 
> http://talks.php.net/show/drupal08/0

After you watch that presentation, the conclusion that you reach is if
you want to develop a site that only shows a page saying "Hello world!"
you should not use an MVC framework because it adds to much performance
overhead! ;-)

Seriously, real world projects are way much more complex than simple
"Hello world!" pages.

Personally I do no use MVC frameworks (nor I have developed one) because
they just add unnecessary complexity.

However, separating concerns (processing, presentation, model data
storage, distributed services, etc...) is a good thing to help keeping
the project organization (and your mental sanity) as you project grows.

You can separate concerns without using MVC, especial front controllers
that go through many hops to sort which code to execute.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Architecture patterns in PHP

2008-12-29 Thread Manuel Lemos
Hello,

on 12/27/2008 10:57 PM Murray said the following:
> I'm interested in this topic as well. I'm starting out on a reasonably large
> web application, and I'm wondering at the best approach in PHP, particularly
> since it's been some years since I worked with PHP on a daily basis (the
> last 5 years have been purely C#).
> 
> There's some dev community bias against using frameworks, isn't there? On
> one hand I'd love to take an approach that would make my end goal easier
> (thanks for pointing out Code Igniter, I'll look into it further), but on
> the other hand I'd rather avoid choices that 'tainted' (perhaps not the
> right word, but the best I could think of) the overall acceptance of the
> application once it's ready for release.

I would not say there is bias against frameworks, but rather that there
is no consensual around a specific framework. Some people prefer one
framework, other people prefer others. Some people prefer relying on
code written by themselves, others prefer using ready to code provided
by others.

One thing is certain, if you adopt a framework, you need to invest time
learning how to use it. Some frameworks are not easy to learn and you
end up spending more time than you wanted.

Here is a longer reflection about using frameworks in PHP:

http://www.phpclasses.org/blog/post/52-Recommended-PHP-frameworks.html


> So, currently I'm wondering about things like, 'Do I make an app that is a
> distinct page-per-function, or do I make an app that uses a monolithic
> index.php (similar to Wordpress?) and dynamically presents
> *everything*based on querystring values.'

Personally I prefer to separate in different pages. It helps making
things more organized.

To sort out things that are more organized, some people use frameworks
to help parsing URL parameters and route requests to different
application modules.

If you separate things, you do not need to build or learn any framework
to handle things separately.

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Architecture patterns in PHP

2008-12-28 Thread Manuel Lemos
Hello,

on 12/27/2008 09:40 PM Michael C. Yates said the following:
> How do you structure your web applications? I am thinking in terms of
> separating presentation  and logic. How is that done in PHP? And how
> many architecture patterns are there?

I use the Use Case Mapping as methodology to implement Web applications
in PHP since 1999 .

It does not mean that this is necessarily the best Web development
methodology, nor that you could not use another methodology that you may
prefer.

It is a methodology that I have been using for developing PHP Web
applications with very satisfactory productivity results. I have been
using it since 1999, when Object Oriented Programming support was added
to PHP 3. Over time, it has been refined to address better the real
world needs of sites of growing complexity.

This methodology has been used extensively to develop busy sites like
the PHPClasses repository. Therefore, it has proven to be suitable to
develop enterprise grade Web applications. It does not impose
excessively complex development procedures. So, it is also suitable for
developing small Web applications.

You may want to read this document that explains what are use cases in
the scope of a well structured project and the methodology that
describes how map use cases to PHP code for Web applications.

http://www.meta-language.net/metastorage-example.html


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: turn shared hosting server to external image storage hosting

2008-12-28 Thread Manuel Lemos
Hello,

on 12/28/2008 11:37 AM paragasu said the following:
> do you have any idea how to do this. i have a small vps about 10GB
> space. i live somewhere is south east asia where solutions like Amazon
> S3 is incredibly slow. (500ms ping time).
> 
> i have a simple php gallery. But dedicated server is quite expensive
> ($100/month). searching around, i found several local hosting
> companies provide a very cheap shared hosting. ($100 / year, 300GB).
> local server with 40ms ping time.
> 
> i am interested to use that shared hosting just as storage for images
> of my gallery and a cheap vps to store the database.
> 
> What is the best way for me to accomplish this? Amazon S3 using REST
> etc. Is it possible to write a simple storage (REST system) like
> amazon s3 in PHP? is there anyone wrote this before. I am interested
> in your solutions..

Amazon released a CDN (Content Delivery Network) that expands S3 to
serve files closer to different world regions.

http://aws.amazon.com/cloudfront/

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Read Form values prior to submit?

2008-12-28 Thread Manuel Lemos
Hello,

on 12/28/2008 01:41 PM Tim Rude said the following:
> Using PHP, is there a way for me to read the values that a user has
> entered into the text fields of a  prior to the user clicking the
> submit button?
> 
> Essentially what I want to do is make sure the user has filled in all
> three text fields on my form before allowing it to be submitted [to a
> third party website].

You may want to try this forms generation and validation class. It can
perform both server side and browser side validations by generating the
necessary Javascript (so you do not have to learn it too much) using a
single definition of the validations you want.

http://www.phpclasses.org/formsgeneration

Here is a live demo form:

http://www.meta-language.net/forms-examples.html?example=test_form


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Re: imap_rfc822_parse_adrlist problem

2008-12-21 Thread Manuel Lemos
Hello,

on 12/21/2008 11:12 AM Ben Stuyts said the following:
>>> Since upgrading to php 5.2.8 I have a problem with
>>> imap_rfc822_parse_adrlist. When I run the example given on the manual
>>> page at http://nl3.php.net/imap_rfc822_parse_adrlist:
>>> ...
>>> So the host part isn't filled in correctly. I have verified this on two
>>> FreeBSD 7 machines. On an older FreeBSD 5 machine with php4 this works
>>> fine. Before the update, I was running php 5.2.6 and there was no
>>> problem either. Any ideas?
>>
>> Sometime ago I decided to not use IMAP library functions to parse e-mail
>> addresses because it was not handling all sorts of addresses as it
>> should.
> 
> Well, yeah, ok, I read about the problems imap_rfc822_parse_adrlist()
> has, but shouldn't it just work at least as advertized in the manual?
> Plus, this is breaking an existing application (Twiggi).

PHP always had backwards incompatibility breaking problems with new
releases. That is why PHP 5 took time to be adopted. Actuall, most ISP
were sort of forced to upgrade because the announcement of the end of
support to PHP 4 versions.

Anyway, if you found a bug, you only need to report it to bugs.php.net
to have it checked and hopefully fixed. Since it is related with an
external library, maybe it is not PHP fault.

PHP has a extensive test suite but I guess you either found a case that
is not well tested or it is not understood as a bug.


>> Nowadays I use an e-mail address parser class written in pure PHP that
>> comes with this MIME parser class:
>>
>> http://www.phpclasses.org/mimeparser
> 
> Thanks, I'll have a look at that.


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: imap_rfc822_parse_adrlist problem

2008-12-20 Thread Manuel Lemos
Hello,

on 12/20/2008 09:34 PM Ben Stuyts said the following:
> Hi,
> 
> Since upgrading to php 5.2.8 I have a problem with
> imap_rfc822_parse_adrlist. When I run the example given on the manual
> page at http://nl3.php.net/imap_rfc822_parse_adrlist:
> 
> $adds = 'ian eiloart ,
>sh...@example.ac.uk,
>blobby,
>"ian,eiloart",
><@example.com:f...@example.ac.uk>,
>f...@#,
>i...@-example.com,
>i...@one@two';
> $add_arr = imap_rfc822_parse_adrlist($adds, 'example.com');
> var_export ($add_arr);
> 
> I should get:
> ...
>  2 =>
>  class stdClass {
>var $mailbox = 'blobby';
>var $host = 'example.ac.uk';
>  },
> ...
> 
> but I get:
> ...
>  2 =>
>  stdClass::__set_state(array(
> 'mailbox' => 'blobby',
> 'host' => 'p?a(',
>  )),
> ...
> 
> So the host part isn't filled in correctly. I have verified this on two
> FreeBSD 7 machines. On an older FreeBSD 5 machine with php4 this works
> fine. Before the update, I was running php 5.2.6 and there was no
> problem either. Any ideas?

Sometime ago I decided to not use IMAP library functions to parse e-mail
addresses because it was not handling all sorts of addresses as it should.

Nowadays I use an e-mail address parser class written in pure PHP that
comes with this MIME parser class:

http://www.phpclasses.org/mimeparser


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: imap_rfc822_parse_adrlist problem

2008-12-20 Thread Manuel Lemos
Hello,

on 12/20/2008 09:34 PM Ben Stuyts said the following:
> Hi,
> 
> Since upgrading to php 5.2.8 I have a problem with
> imap_rfc822_parse_adrlist. When I run the example given on the manual
> page at http://nl3.php.net/imap_rfc822_parse_adrlist:
> 
> $adds = 'ian eiloart ,
>sh...@example.ac.uk,
>blobby,
>"ian,eiloart",
><@example.com:f...@example.ac.uk>,
>f...@#,
>i...@-example.com,
>i...@one@two';
> $add_arr = imap_rfc822_parse_adrlist($adds, 'example.com');
> var_export ($add_arr);
> 
> I should get:
> ...
>  2 =>
>  class stdClass {
>var $mailbox = 'blobby';
>var $host = 'example.ac.uk';
>  },
> ...
> 
> but I get:
> ...
>  2 =>
>  stdClass::__set_state(array(
> 'mailbox' => 'blobby',
> 'host' => 'p?a(',
>  )),
> ...
> 
> So the host part isn't filled in correctly. I have verified this on two
> FreeBSD 7 machines. On an older FreeBSD 5 machine with php4 this works
> fine. Before the update, I was running php 5.2.6 and there was no
> problem either. Any ideas?

Sometime ago I decided to not use IMAP library functions to parse e-mail
addresses because it was not handling all sorts of addresses as it should.

Nowadays I use an e-mail address parser class written in pure PHP that
comes with this MIME parser class:

http://www.phpclasses.org/mimeparser


-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



RE: [PHP] Downloading file from local network machine

2008-12-05 Thread Manuel Lemos
Hello Jonathan,

On Fri, 2008-12-05 at 17:32 +, Mayer, Jonathan wrote:
> Thanks Wolf :)
> 
> Yup, I had considered that, although there could be up to 8 different servers 
> so that's 8 seperately mapped drives. 
> 
> If that's the simplest/neatest way, I'll do that, although I did wonder 
> whether there was some other clever another way around it.

Actually there is a much better way to achieve that. I just presented it
at a Microsoft Web Development summit that was mostly about PHP. Here
follows the slide presentation. Check slide 5.

http://www.slideshare.net/manuellemos/what-could-microsoft-do-to-make-php-run-better-on-windows-presentation/

It consists add a PHP stream wrapper class that allows you to use fopen
and other PHP file access functions with a file name URL like this:

smb://user:[EMAIL PROTECTED]/path/to/share

The stream warpper class is here:

http://www.phpclasses.org/smb4php

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Trre/Drop Down quick app for testing database tbls

2008-11-30 Thread Manuel Lemos
Hello,

on 11/28/2008 02:19 PM bruce said the following:
> I've got a few tbls that I'm testing. I'd like to have a simple web app to
> be able to iterate through the tbls to test out what I have in them.
> 
> I'd like to be able to have each tbl as a drop-down/select box, so I select
> from selecta, which lists items from TBL-A, which then uses the id from
> TBL-A, to get the items from TBL-B that matches. Selecting from drop-down
> for TBL-B, then gets me the list on TBL-C...
> 
> I've got 3-4 tbls that are linked by their id.
> 
> Rather than reinvent the wheel, I'm asking if anyone has a quick app that
> they can point to that I can extract/modify the functionality for my
> needs...

This is a frequent problem. You may want to take a look at this forms
generation class that comes with plug-in named linked select that
achieves precisely what you want.

http://www.phpclasses.org/formsgeneration

It can link 2 or more select inputs, without chaining limits. It can
switch to alternative set of options for one select when the previous
input value changes.

The alternative option sets may be defined statically, but there
variants of this plug-in to fetch options from MySQL databases or any
other database supported by Metabase or PEAR::MDB2 database abstraction
layers.

The plug-in may use AJAX to retrieve the alternative option sets from
the server without reloading the pages.

Here is a live demo:

http://www.meta-language.net/forms-examples.html?example=test_linked_select

Here you can see a tutorial video about the forms class with a section
about this plug-in:

http://www.phpclasses.org/browse/video/1/package/1/section/plugin-linked-select.html

Here you can see the slide presentation. Jump to slide 26 to check the
slide about this plug-in.

http://www.phpclasses.org/browse/video/3/package/1.html



-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: PHP job available, Phoenix, AZ, USA

2008-10-04 Thread Manuel Lemos
Hello,

on 10/02/2008 11:31 PM Matt Graham said the following:
> I just saw this.  If someone is in the Phoenix, AZ, USA area and wants a job 
> writing/maintaining PHP code, this may be right for you.  Contact details 
> below:

You may want to post it here:

http://www.phpclasses.org/jobs/country/us/

-- 

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Shopping Carts/Checkout Software

2008-09-09 Thread Manuel Barros Reyes
On Mon, Sep 8, 2008 at 12:09 PM, Charlene <[EMAIL PROTECTED]> wrote:

> The company I work for is going to be creating the catalog to a small store
> (~100 items).  The customized catalog will include the front end that the
> shoppers will use as well as the back end data entry.
>
> We need shopping cart/checkout software, preferably PHP (since that is what
> we will be using for our site) and uses MySQL as the database.  We want to
> be able to hook our customized software into the software package (ie we're
> not using their data entry into the catalog).  We don't want to be limited
> to just one shopping cart/checkout software package and this may become a
> product we use for more sites.
>
> We have been forced to use a few products since the clients bought the
> package themselves but I'm not real happy with any of them.
>

I would like to recommend OpenCart (http://www.opencart.com/) it is nicely
designed, it is small and simple, it is modeled after MVC pattern. It lacks
documentation but the source code is very understandable and there are
forums on their site where one can ask for help if in trouble.

I gave it a try after giving up trying to customize Zencart which is very
complicated in my opinion, although it has the benefit of a larger user base
and documentation.

Here you can find an example of a site I did with opencart:

http://www.carolinalightgroup.com

M.


[PHP] Re: xss filter

2008-09-08 Thread Manuel Lemos

Hello,

on 09/08/2008 09:16 AM Emil Edeholt said the following:
> Hello,
>
> Do you know of any good ways to filter out javascript from html code?
> I've seen this code
> http://kallahar.com/smallprojects/php_xss_filter_function.php but I
> found some old discussions about it saying that it wasn't really secure.
>
> There most be some safe way to filter out xss without filtering out all
> html. Or...?

Here you may find some classes for that:

http://www.phpclasses.org/browse/class/78.html

--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: fsockopen in phpmailer and tls

2008-09-07 Thread Manuel Lemos

Hello,

on 09/05/2008 12:20 AM Larry Brown said the following:

I am having a ball of a time trying to figure this one out... If anyone
has dealt with this before I'd love to get some morsels of wisdom from
you...

I am trying to connect to a postfix server I have set up remotely using
smtp auth with tls.  The postfix appears to be configured correctly at
this point.  I can telnet to port 25 and it will list tls as an option
as the howto describes it should.  I try to connect from php and get:

PHP Warning:  fsockopen(): SSL operation failed with code 1. OpenSSL
Error messages:
error:1408F10B:SSL routines:func(143):reason(267)
in /opt/scriptsMain/include/class.smtp.php on line 122


I suspect that you are using the wrong port to send messages via SSL . 
The fact that port 25 SMTP connections list TLS as available mode, that 
is for starting TLS after the connection was started.


I use this class to send messages via SMTP using SSL to Gmail, but the 
port is not 25. You may want to try it to see if it works for your 
server. Take a look at the test_smtp_message.php example script.


http://www.phpclasses.org/mimemessage

You also need this for SMTP deliveries:

http://www.phpclasses.org/smtpclass

and this to initiate authentication:

http://www.phpclasses.org/sasl



--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Sending out mass emails

2008-09-07 Thread Manuel Lemos

Hello,

The right class address below is http://www.phpclasses.org/mimemessage .

on 09/04/2008 10:47 AM Angelo Zanetti said the following:
Hi all, 


We would like to send out mass emails for some of our clients, these are
HTML email and text alternative for the email clients that cant read those
HTML emails.

We have developed some scripts to send the emails using phpmailer.

Now we anticipate sending emails in batches but not sure how many at once.


This depends on what is your goal is sending it in batches. If it is to
avoid server overload, you need to watch your server load and suspend
delivery when it has too much load.

But if you have other concerns, you need to tell what are those concerns
so we can advise.



Also what is the best way about going around being black listed due to spam
issues. 


If you do not send messages to people that do not want them, that
reduces the chances of being blacklisted.



I know that the headers need to be set to avoid being detected as spam.


That is a problem mostly with malformed messages. As long as the
receipient address is in a visible header (To or Cc), at least Hotmail
will not junk your messages for that.

Therefore you should be sending separate messages to each recipient so
you can personalize at least the To header.

If your message is the same to all recipients, you should cache the MIME
message data for the message body.

I do that using this MIME message class when sending newsletters that
are the same for all recipients. Internally the class can cache the
message body even when the headers vary for instance the To: and
Return-Path: .

It saves a lot of server load that otherwise would be wasted rebuilding
the same message body.

http://www.phpclasses.org/mimmessage


--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Sending out mass emails

2008-09-07 Thread Manuel Lemos

Hello,

on 09/04/2008 10:47 AM Angelo Zanetti said the following:
Hi all, 


We would like to send out mass emails for some of our clients, these are
HTML email and text alternative for the email clients that cant read those
HTML emails.

We have developed some scripts to send the emails using phpmailer.

Now we anticipate sending emails in batches but not sure how many at once.


This depends on what is your goal is sending it in batches. If it is to 
avoid server overload, you need to watch your server load and suspend 
delivery when it has too much load.


But if you have other concerns, you need to tell what are those concerns 
so we can advise.




Also what is the best way about going around being black listed due to spam
issues. 


If you do not send messages to people that do not want them, that 
reduces the chances of being blacklisted.




I know that the headers need to be set to avoid being detected as spam.


That is a problem mostly with malformed messages. As long as the 
receipient address is in a visible header (To or Cc), at least Hotmail 
will not junk your messages for that.


Therefore you should be sending separate messages to each recipient so 
you can personalize at least the To header.


If your message is the same to all recipients, you should cache the MIME 
message data for the message body.


I do that using this MIME message class when sending newsletters that 
are the same for all recipients. Internally the class can cache the 
message body even when the headers vary for instance the To: and 
Return-Path: .


It saves a lot of server load that otherwise would be wasted rebuilding 
the same message body.


http://www.phpclasses.org/mimmessage


--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Geometrical library

2008-09-06 Thread Manuel Lemos

Hello,

on 09/03/2008 01:54 PM Yannick Warnier said the following:

Hi there,

I've been looking for a PHP library that would allow me to calculate
superpositions of geometrical surfaces defined by polygones (defined
themselves by points bound with lines) in 2D (surface of a polygone,
intersections between two vectors, surface of intersection - considering
the polygons could be complex and superpose themselves in more than one
point).

The closest to what I'm looking for, I guess, would be the PEAR
Math_Vector package, but it is mainly based on vectors as mathematical
arrays, whereas I would need calculations based on surfaces.

Does anyone know of something that could help me?


I think this PHP class does exactly what you need:

http://www.phpclasses.org/polygon

--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Job opening in Leiden, Netherlands: PHP/MySQL developer

2008-09-01 Thread Manuel Lemos

Hello,

on 09/01/2008 09:15 AM Ivo F.A.C. Fokkema said the following:

Dear all,

We have an immediate job opening available to work in our team of
bio-informaticians on extending the LOVD software (www.LOVD.nl). Even if
you're still a beginner with PHP you're welcome to respond. Affinity to
biology is a big plus.

LOVD (Leiden Open Variation Database) is webbased software used by
hospitals and clinics worldwide to store patient and DNA mutation
information.

For more information, see our website or these two PDF files:
http://www.lovd.nl/Vac08_G2P_LSDBs.pdf
http://www.lovd.nl/LUMC_E.08.GJ.16HG.pdf

If you're interested, please let me know as soon as possible since we've
already started selecting candidates.


You may want to try posting it here:

http://www.phpclasses.org/jobs/

Also here you will find many qualified PHP professionals from The 
Netherlands:


http://www.phpclasses.org/professionals/country/nl/

--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Re: Individual bulk e-mails - performance question

2008-08-30 Thread Manuel Lemos

Hello,

on 08/30/2008 10:40 PM Diogo Neves said the following:

Well, I agree that sending it by an external process more specialized
in sending emails can be faster and more eficient, but it's harder to
control... sometimes you need to know in your php if email was really
sent and do something, and while I'm not saying it's impossible, I'm
sure it's a little more complicated...


Knowing whether the message was successfully delivered or not, is 
something that you often will not know.


Nowadays many SMTP servers use grey listing. This means that first the 
server says it cannot accept the message temporarily, but it will accept 
after several minutes.


Even if the server accepts the message immediately, he may bounce or 
discard it later.


So it is utopic to expect any reliable answer about the deliverability 
of a message. It is better not rely your software on the accuracy of any 
response from the remote server.


In any case, for really urgent messages, the MIME message class can use 
the SMTP driver to deliver messages directly to the remote SMTP server 
bypasing the local mail server. If it fails the delivery, you should 
relay it to the local mail server to retry deliverying it later. Take a 
look at the test_urgent_mail.php script for an example:


http://www.phpclasses.org/mimemessage



Yet, if sending email don't need to be tracked, then external tool
world possible be better...

Anyway, don't ask me how to do that, I'm more confortable doing things in PHP :)


PHP is very efficient if you use it in a smart way. For instance, you 
can cache message bodies using the MIME message above to avoid message 
composition overhead.


As for the actual SMTP delivery, the network connection and TCP data 
exchanging is usually so slow that any overhead of PHP script execution 
is meaningless.


--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Individual bulk e-mails - performance question

2008-08-30 Thread Manuel Lemos

Hello,

on 08/30/2008 02:40 PM Merlin said the following:
I am running a travel community where users want to get informed on 
changes inside different groups they have subscribed to.


At the moment I am doing this with a for loop that generates an 
individual e-mail sent to them via phpmailer. That works, however the 
submit of the content upload form (that triggers the e-mail 
notification) now takes several seconds, as more and more users subscribe.


I am thinking about placing the info on the individual e-mail inside a 
ascii txt file that will be read by a cron job which will send the 
e-mail instead. Something like every 5 minutes reading it line by line 
and then after sending it removing the line.

e.g:
for:[EMAIL PROTECTED]; body:individual
for:[EMAIL PROTECTED]; body:other email

Does this sound like a plan? Or do you believe that there are better 
ways doing it? I could imagine that I would run into problems a few 
months from now if for example the cron job will be triggered a second 
time, while the first one has not finished.


Any ideas or suggestions? Thank you for any help.


While it is a good idea to off-load e-mail delivery to a script run from 
cron, it seems odd that each mail takes several seconds to deliver.


I suspect that you sending messages in a less efficient way. Maybe you 
are queueing messages using SMTP (which is the slowest way to queue 
messages) or you are using sendmail on your system and it is configured 
by default to attempt to deliver the messages immediately, making your 
PHP script hang while the message is not accepted by the remote server.


There are much better ways to do it by just telling the mail system to 
queue the messages without holding on the PHP script.


On the other hand, if the time it takes build your messages but the 
messages have the same contents for all the receipients, you can also 
use some good e-mail components with caching support.


In that case, I recommend that you use for instance this MIME message 
class that provides message body caching support, so you can send 
messages to different receipients and cache the building of message body 
parts and avoid overhead when sending to a new receipient.


It also provides different means to send messages and solve the overhead 
of message delivery by forcing the messages to queue by your local and 
be delivered later whenever possible, so your PHP script is freed to 
send messages to other recipients.



http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: newsletter code

2008-08-11 Thread Manuel Lemos

Hello,

on 08/11/2008 09:26 AM Angelo Zanetti said the following:
Hi All, 


I have a question related to newsletter subscriptions to websites as well as
sending out of the newsletters.

Here is the scenario: 


Client wants a "subscribe to newsletter" dialog on website, typically just
an email address.

Then in his admin section he wants to send out HTML newsletters/plain text
depending on the user's email client.

Now how would I go about creating the newsletter in the backend? Using a
WSIWIG editor? Or is there some code that you guys use as there are also
things to consider such as: 


-bulk mailing, instead of sending many mails at once. Rather send out some
scheduled emails

-Plain text vs HTML email

Etc...

What do you guys use if you are building a custom web app?


I just use this MIME message class. It solves the problem of sending 
HTML or plain text messages using multipart/alternative containers. You 
define a text and HTML version and the class sends both within the 
message in such way that if the mail client supports HTML the user will 
see that version, otherwise it will only see the text version. Take a 
look at the test_simple_html_mail_message.php script.


http://www.phpclasses.org/mimemessage


--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Using Ajax to populate a drop-down list

2008-08-08 Thread Manuel Lemos

Hello,

on 08/08/2008 12:58 AM Don said the following:

Hi,

I have a form with two lists. One is populated with many options while the 
second is populated with only a single item.  When the first drop-down list 
is changed, I call a PHP script sing AJAX to populate the second list.  I 
also need to perform another task when the second list is changed but it 
seems not to work.


I think this is because even though my AJAX script populates the second 
drop-down list using pure PHP code, the second drop-down isn't aware of it. 
I've tries adding JavaScript code in the AJAX route to add options to the 
list but it's not working.


Does anyone have an example of how to do this?


This is being asked overe and over again. No problem.

You may want to try this forms class. It comes with a plug-in that does 
exactly that. It can load options in a linked select input depending on 
the value of the first input. The options can be loaded statically from 
arrays or dynamically from the server using AJAX. There are variants of 
the plug-in to load options from many different types of databases.


http://www.phpclasses.org/formsgeneration

Here is a live example:

http://www.meta-language.net/forms-examples.html?example=test_linked_select

Here you can watch a tutorial video about this plug-in:

http://www.phpclasses.org/browse/video/1/package/1/section/plugin-linked-select.html

--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Freelance PHP development in India

2008-07-16 Thread Manuel Lemos

Hello,

on 07/14/2008 01:20 AM Denis L. Menezes said the following:

Dear friends.

I am looking for freelance web developers in India.

Can contact me?


As Thiago mentioned, there is a directory of PHP professionals available 
for taking PHP jobs that is sorted by country. Here you may find many 
developers from India:


http://www.phpclasses.org/professionals/country/in/

If you want to post a job of interest to these developers, you may do it 
here:


http://www.phpclasses.org/post_job.html

--

Regards,
Manuel Lemos

Find and post PHP jobs
http://www.phpclasses.org/jobs/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Byte range support

2008-07-16 Thread Manuel Vacelet
On Tue, Jul 15, 2008 at 3:53 PM, Manuel Vacelet
<[EMAIL PROTECTED]> wrote:
> Hello all,
>
> How can I make my php apps aware of byte range HTTP request ?
>
> I have a script that output data to user if she's granted to do so.
> But as of today, if download fails, she must restart the download from
> the beginning because my server (my php script) doesn't support "range
> byte requests" (actually, this is what curl and wget claims!)

FYI, I found what I was looking for in PEAR HTTP Download package:
http://pear.php.net/package/HTTP_Download

-- Manuel

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



[PHP] Byte range support

2008-07-15 Thread Manuel Vacelet
Hello all,

How can I make my php apps aware of byte range HTTP request ?

I have a script that output data to user if she's granted to do so.
But as of today, if download fails, she must restart the download from
the beginning because my server (my php script) doesn't support "range
byte requests" (actually, this is what curl and wget claims!)

-- Manuel

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



[PHP] Re: Capture homepage screenshot

2008-06-13 Thread Manuel Lemos
Hello,

on 06/13/2008 02:46 PM Shiplu said the following:
> Hello,
> How can i capture homepage screenshot of a webpage by php?
> 
> I know a way.
> I'll run a executable written in C/C++. when It will be called to process a
> screen shot It will just load the webpage in firefox and capture the image.
> It'll send the image path to php. The executable will be running.
> The problem with this solution is, I have to run X, Firefox in my web
> server, which doesn't look efficient for a server.
> 
> I wanna know, is there any other way to achieve this? without creating a
> screen shot server.

If you run PHP on Windows, you can use this PHP class that was just
released and does exactly what you need. I think it could be adapted to
work with Firefox too.

http://www.phpclasses.org/win-screenshot

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: UK PHP Host/Developer Required

2008-06-13 Thread Manuel Lemos
Hello,

on 06/12/2008 09:46 AM Colin Sidwell said the following:
> Hi,
> 
> We are looking for someone to develop & host a PHP site in the UK.
> 
> The site is a corporate rewards site that enables users to buy gifts
> with with points they have been given by their employer.
> 
> URL is here-
> 
> http://www.waystoamaze.co.uk/
> 
> There are databases of users, companies, products and categories.
> 
> An admin section allows for product and user updating etc.
> 
> Interested parties should contact the client directly on +44 7970 461
> 295 or email [EMAIL PROTECTED]

You may want to take a look at this directory of PHP professionals from
UK available for taking jobs. You even choose from developers near your
region and check if they have the skills you need:

http://www.phpclasses.org/professionals/country/uk/

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: How to structure code for forms

2008-06-08 Thread Manuel Lemos
Hello,

on 06/08/2008 08:01 AM Ethan Whitt said the following:
> I am new to PHP and have been researching ways to structure code for forms.
> I have found a
> few basic tutorials that present, validate & present errors, and then
> process form data.  I was
> wondering if anyone could share their approach on how they structure these
> actions?  Ideally,
> I would like to separate each action in separate functions.  Thanks in
> advance...

I recommend a couple of things as crucial points to do proper forms
processing without inconviniences:

1. Present and process the forms with the same script. If the user
submits the form with invalid fields, you just use the same code in the
script to present the form again marking invalid fields.

2. Never output anything before presenting, validating and processing
the forms. If you start outputting any page data or even issue response
headers, you may not change the course of your script action later in
case there were validation errors or unexpected form processing errors
(like for instance database access failures).

Personally I use this popular forms validation class.

http://www.phpclasses.org/formsgeneration

It separates the forms handling in several steps like you want:

1. Define the input field types, initial values and validation rules
2. Load and filter any form submitted field values
3. Validate the loaded field values
4. Retrieve filtered and validated field values for form processing by
the application
5. Output the form if it is being presented for the first time or if it
has validation errors. It can use either HTML mixed with PHP, or Smarty
templates, or automatic layout plug-ins also available for this forms class.

Here you may watch a tutorial video that explains this approach with a
step by step fluxogram that makes it very clear:

http://www.phpclasses.org/browse/video/1/package/1/section/usage.html

This class is very mature. It is being developed since 1999 and is very
popular. Actually you could call it a framework because it comes with
many plug-ins for implementing sophisticated features such as AJAX form
submission, paged layouts, interconnected inputs, form page animation, etc..

Here you may find some demonstrative examples that you may try live:

http://www.meta-language.net/forms-examples.html

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Sr. PHP Engineer job opportunity / Denver

2008-06-06 Thread Manuel Lemos
Hello,

> I have an immediate opportunity available for a Senior Software Engineer in
> Denver, CO (relocation assistance is available). This is a great opportunity
> to join a dynamic and growing Internet-based company.  The individual will
> be responsible for the development, implementation, and maintenance of our
> scalable, reusable, web/software based user interfaces. You must be familiar
> with design patterns and be able to write abstract classes that adhere to
> standard OOP methodologies. The qualified candidate will expand our
> web-based platform, building new features and products.  

You may want to take a look at this directory of PHP professionals
available for taking PHP jobs in the United States. You may even narrow
your search professionals that have the skills you need:

http://www.phpclasses.org/professionals/country/us/

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] looking a regular expresion

2008-05-27 Thread Manuel Pérez López
Hello:

I need to include a pair of negations with two complete word into a regular
expresion for preg_replace. How to do this?
I want to replace "I want to be a SUN and a SIR" with "FRIKI FRIKI FRIKI
FRIKI FRIKI SUN FRIKI FRIKI SIR"

ie. the words are: SUN and SIR. And the replacement word is: FRIKI

$st = preg_replace ("\b([^S][^U][^N])|([^S][^I][^R]\b)", "FRIKI",$st);

This does not  match

Anyone hep me?

Thanks


[PHP] recursive function

2008-05-24 Thread Manuel Pérez López
Hello everyone:

Is it possible to do recursive this function?

I can write it so linear. But only a  finite number of loops.
Thanks.
Manuel Perez

This is:


function ($field, $arr_secuence_reverse)
{


if (count($arr_secuence_reverse) == 1)
{
return 
getPrimaryKey4Field($field,$arr_secuence_reverse[0],NULL);
}

if (count($arr_secuence_reverse) == 2)
{
$sel2 = select($arr_secuence_reverse[0],"pk as
pk_current",NULL,$arr_secuence_reverse[1],"pk as pk_next",NULL);
foreach ($sel2 as $n2=>$v2)
{
$res[$v2['pk_current']] =
getPrimaryKey4Field($field,$arr_secuence_reverse[1],'fk_'.$arr_secuence_reverse[0]."='".$v2['pk_current']."'");
}
}

if (count($arr_secuence_reverse) == 3)
{
$sel3 = select($arr_secuence_reverse[0],"pk as
pk_current",NULL,$arr_secuence_reverse[1],"pk as pk_next",NULL);
foreach ($sel3 as $n3=>$v3)
{
$res[ $v3['pk_current'] ][ $v3['pk_next'] ] =
getPrimaryKey4Field($field,$arr_secuence_reverse[2],'fk_'.$arr_secuence_reverse[1]."='".$v3['pk_next']."'");
}
}

if (count($arr_secuence_reverse) == 4)
{
$sel4 = select($arr_secuence_reverse[0],"pk as
pk_current",NULL,$arr_secuence_reverse[1],"pk as pk_next",NULL);
foreach ($sel4 as $n4=>$v4)
{
$sel5 = select($arr_secuence_reverse[1],"pk as
pk_current",NULL,$arr_secuence_reverse[2],"pk as pk_next",NULL);
foreach ($sel5 as $n5=>$v5)
{
   $res[ $v4['pk_current'] ][ $v4['pk_next'] ][
$v5['pk_current'] ] =
getPrimaryKey4Field($field,$arr_secuence_reverse[3],'fk_'.$arr_secuence_reverse[2]."='".$v5['pk_current']."'");
}
}
}

if (count($arr_secuence_reverse) == 5)
{
$sel5 = select($arr_secuence_reverse[0],"pk as
pk_current",NULL,$arr_secuence_reverse[1],"pk as pk_next",NULL);
foreach ($sel5 as $n5=>$v5)
{
$sel6 = select($arr_secuence_reverse[1],"pk as
pk_current",NULL,$arr_secuence_reverse[2],"pk as pk_next",NULL);
foreach ($sel6 as $n6=>$v6)
{
   $res[ $v5['pk_current'] ][ $v5['pk_next'] ][
$v6['pk_current'] ][ $v6['pk_next'] ] =
getPrimaryKey4Field($field,$arr_secuence_reverse[4],'fk_'.$arr_secuence_reverse[3]."='".$v6['pk_next']."'");
}
}
}

}

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



[PHP] Re: PHP authenticating user over SSL

2008-05-23 Thread Manuel Lemos
Hello,

on 05/23/2008 05:06 PM Gunnar Vestergaard said the following:
> Where do I post feature requests for PHP?
>
> I need some functions in PHP to let a user log on to a server with his
> SSL client certificate. I mean, when a user has his own SSL client
> certificate, then a server should be able to log the user in without
> needing user name and password. Wouldn't that be a great improvement in
> PHP? Is it possible at all?

That is not quite the role of PHP. Apache does the necessary SSL client
verification when you use the directive SSLVerifyClient . Here you may
find more details on what variables to check when the user provides a
valid client certificate.

http://wiki.egee-see.org/index.php/Simple_Apache-SSL_integration_and_DN-based_authentication

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] pg_update and PGSQL_DML_STRING

2008-05-19 Thread J. Manuel Velasco - UBILIBET




Hello,

The option PGSQL_DML_STRING doesn't work with pg_update to me. I try
the same option with pg_insert and it worked as I expected, but with
pg_update I can't see the query and it is executed.

I have an error in the query and I need to debug, so watch it is
imperative.

Anybody can help me to know what I need to do to be able to debug the
query?

Thanks in advance.

CODE AND RESULT AT THE BROWSER:
function Update_internal($taula, $elements, $id, $dieonerror=true, $format_date=true) {
   $link = Conectar();
   pg_query($link, 'SET DateStyle TO ISO');
   foreach (array_keys($elements) as $k) {
 $elements[$k]=stripslashes($elements[$k]);
 if ($format_date && $elements[$k]) {
    if (preg_match('/^(\d{1,2})[-\/\.](\d{1,2})[-\/\.](\d{4})$/', $elements[$k], $match)) 
    $elements[$k]=$match[3].'/'.$match[2].'/'.$match[1];
 }
   }
 
   $aux = "Update Internal en $taula\n" . print_r($elements,true) . "\nfor ID=$id\n";
   file_put_contents('/tmp/pedidos.log',$aux,FILE_APPEND);		
  
   $res = pg_update($link, $taula, $elements, Array('id' => $id),PGSQL_DML_STRING);
   
   $aux = "QUERY: " . $res . "\n";
   file_put_contents('/tmp/pedidos.log',$aux,FILE_APPEND);   
 
   if ($res) return true;
   if ($dieonerror) dieEx("Error al actualizar los datos en $taula",'Mensaje devuelto por el servidor: '.pg_errormessage ($link));
   return false;
}
 
The only error I can see is at the browser, but any information is shown: 

ERROR
Se ha producido un error al ejecutar el script Número de error:	0
Descripción:	
Error al actualizar los datos en comandes
Mensaje devuelto por el servidor:

-- 





[PHP] Re: Job: Wanted, Dead or Alive: PHP/Drupal programmers in Chicago

2008-05-18 Thread Manuel Lemos
Hello,

You may want to look here at this PHP professionals directory. You can
even narrow your search for professionals that have the PHP specific
skills you need, like Drupal experience:

http://www.phpclasses.org/professionals/country/us/


on 05/18/2008 10:09 PM Larry Garfield said the following:
> (OK, alive would be preferable.)
> 
> Obligatory businessy description:
> 
> Palantir.net is looking for PHP programmers to join its growing team.  
> Palantir is one of the oldest web development shops in Chicago, dating back 
> to 1996.  We develop customized web sites and web applications for a variety 
> of organizations, especially non-profit and cultural institutions.  We 
> develop primarily using the Drupal open source Content Management Platform, 
> and are looking for skilled programmers to join our team in our Chicago 
> office.
> 
> The full rundown, and where to apply:
> 
> http://palantir.net/careers/programmer
> 
> Informal description:
> 
> So we've just moved into a brand new office in west Lincoln Park so that we 
> have room to expand, which is good because we have enough work to keep 
> everyone busy and then some.  Palantir is a family company, and a great place 
> to work.  (I've been here for 2.5 years now.)  The working environment 
> includes a chalkboard wall, company issue Nerf guns, and a puppy.  Oh yeah, 
> and all the stuff you need to get actual work done, too.
> 
> Palantir is primarily an open source company.  As a programmer, 90% or better 
> of your job would involve working with Drupal, the leading open source 
> content management platform on the web.  We strive to be good open source 
> citizens, too, contributing back to the community both in code and in other 
> ways, such as hosting design sprints for developers and sponsoring the recent 
> DrupalCon developers conference in Boston.  Palantir's team includes several 
> high-profile names in the Drupal world as well.  If you want to get paid to 
> work with and on a major open source project, this is the place to be.  We're 
> open to people already experienced with Drupal as well as those new to the 
> community.
> 
> 
> We are looking for full time on-site programmers, but are open to summer 
> interns as well.  If you have questions, contact me off-list.  To apply, see 
> the link above.


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] encoding to a file

2008-05-16 Thread J. Manuel Velasco - UBILIBET




Hello.

When I create a file I need to specify the encoding to ISO-8859-1, how
can i do this please ?

I have read about stream:default:encoding() but I am not sure how to
use it.

Thanks in advance.
-- 





[PHP] Re: Scottish Devs

2008-05-14 Thread Manuel Lemos
Hello,

on 05/14/2008 01:37 PM Nathan Rixham said the following:
> Just had word of a freelance project on for the next 4 weeks, start
> immediately, basically 1 static site (design already done) - an easy
> job, and 1 static site + a bit of PHP, breadcrumb, site search - it's
> £200 GBP a day (so about £4k for the next 4 weeks), ideally for somebody
> who can pop into edinburgh to meet the client/agency and maybe work on
> site?
> 
> I was offered but I'm committed at the minute, it's through a reputable
> recruitment agency for a top edinburgh design house - so worth going for
> if you have the time free.

You may want to take a look here to see if you find qualified PHP
developers in that region:

http://www.phpclasses.org/professionals/country/uk/

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: fsockopen on ssl://

2008-05-13 Thread Manuel Lemos
Hello,

on 05/13/2008 04:37 PM bob pilly said the following:
> Hi all
> 
> I have tried researching this issue but havent come up with any solution so 
> im hoping someone has seen it before and can help. I have the following test 
> script that uses fsockopen to connect to a https site, get the contents and 
> outputs it.
> 
>  $host = "www.microsoft.com";
> $path = "/";
> $fh = fsockopen("ssl://".$host, 443, $errno, $errstr, 5);//opens url for 
> reading with a timeout of 2 seconds
> 
> if (!$fh){
> echo "FAIL: $errno $errstr ";
> }
> else{
> $out = "GET $path HTTP/1.1\r\n";
> $out .= "Host: $host\r\n";
> $out .= "Connection: Close\r\n";
> $out .= "\r\n";
> fwrite($fh, $out);
> stream_set_timeout($fh,2);
> $info = stream_get_meta_data($fh);
> if($info['timed_out']){
> echo "TIMEOUT\n";
> }
> else{
> $haystack = "";
> while (!feof($fh)) {
> $haystack.= fgets($fh, 4096);
> }
> }
> print $haystack;
> fclose($fh);
> }
> ?>
> 
> if i run this script using php -f test.php it works fine. However if i try 
> and run this on my loca apache server i get the following error:
> 
> Warning:  fsockopen() [function.fsockopen]:unable to connect to 
> ssl://www.microsoft.com:443 (A connection attemptfailed because the connected 
> party did not properly respond after aperiod of time, or established 
> connection failed because connected hosthas failed to respond.) in C:\Program 
> Files\Apache Software Foundation\Apache2.2\htdocs\test.php on line 4
> FAIL: 10060 A connection attempt failed because the connected party didnot 
> properly respond after a period of time, or established connectionfailed 
> because connected host has failed to respond.
> 
> As you can see from that error i am using windows and apache 2.2. My php 
> version is 5.25. I have Registered Stream Socket Transports tcp, udp, ssl, 
> sslv3, sslv2, tlsin my config.

I suspect that you are giving a very short timeout but then you are not
handling the timeout error properly.

Anyway, before reinventing the wheel, you may to try this HTTP client
class that supports many options including establishing SSL corrections
and setting and handling timeouts correctly.

http://www.phpclasses.org/httpclient

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Handling Incoming Email Attachments

2008-05-06 Thread Manuel Lemos
Hello,

on 05/06/2008 06:36 AM Nirmal Jayasinghe said the following:
> hello all,
> 
> I'm trying to figure out a way to manipulate incoming email attachments with
> PHP. There'll be a special email address to which the emails with the
> attachments would be sent, with a number specified in the subject line. What
> I need to do is to grab the attachment (a photo), rename it with the number
> specified in the subject line, and move it onto a specific folder on the Web
> server [which will be running LAMP].
> 
> I couldn't find any online material describing how to manipulate incoming
> mail attachments. Can someone give an idea?

You may want to try this MIME parser class. It can parse the e-mail
messages of any size and optionally save the attachments to files in a
directory of your choice.

http://www.phpclasses.org/mimeparser

If want to parse messages retrieved from a POP3 mailbox, you may also
want to use in conjunction this POP3 class which comes with a stream
wrapper that lets you access messages in the POP3 mailbox as if they
were files. You can use file names like this: pop3://pop.server.com/1 .

http://www.phpclasses.org/pop3class

When used in conjunction, these two classes allow you to extract
attachements from messages of any size without exceeding your PHP memory
limits.

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] PHP debugger

2008-04-30 Thread J. Manuel Velasco - UBILIBET




NOTE: If you are interesting in PHP Debuggers, this is not the mail,
check the start of the thread since after I decided to try JasonPruim
Debug :p we are trying to solve one specific  problem.

Now, to who is following the thread ... don't hung me, but i think the
problem was there was because there was no permission to write in a
logfile.

---> BEGIN failed--compilation aborted at
/home/httpd/bin/esnic/whois.pl line 9.
line9 = use EPP::Client;
right at Client.pm there is the declaration og the log file.

My inexcusable big mistake, don't check the logs before, in fact i saw
it yesterday looking for other thing. But since running the sccript
from command line there was no error... I didn't realise to check them
:-/

Now it works :)

Thank you very much for following and assistance.



Edward Kay escribió:

  
-Original Message-
From: Jason Pruim [mailto:[EMAIL PROTECTED]]

  
  
  
  
Morning,

So looking at those scripts I realized that perl is nothing like php ;)

Is there other info that the different places need? or is it just a
different URL?

I'm wondering why you could do something like:

HTTP://www.myCool.es/?query="$nom.$ext";
	break;
case 'eu';
	$cmd = HTTP://www.myCool.eu/?query="$nom.ext";
	break;
default;
	$cmd = HTTP://www.whois.com/?query="$nom.ext";
break;
}
?>

instead of calling out to a different script?

Also, I noticed that in your script where you have "default:" in your
switch, you have a : instead of a ;


  
  
Actually, the colon is correct: http://uk.php.net/switch

You also need to enclose your string declarations correctly and add the $
before ext, e.g.
$cmd = "http://www.whois.com/?query=$nom.$ext";
or
$cmd = 'http://www.whois.com/?query='.$nom.'.'.$ext;

Edward


  


-- 





Re: [PHP] PHP debugger

2008-04-29 Thread J. Manuel Velasco - UBILIBET




Iep,

First of all, thank you verfy much to take a moment to check the
scripts, I really appreciate.

About your idea to have only one script that call to the appropiate
command using a switch, I agree, but since I am new here and I am the
only computing guy, I don't have time to restructure the code. I saw
also other code in the Intranet where I'd have done in a different way
easier to maintain, I think, but I have to make this to work and
apparently I don't think  reestructuring the code will solve the
problem, at least in a way that i can understand why the script doesn't
want to run now. Also, the process to build the query and connect to
the registar are different in each case, so maybe it is the reason why
who who implemented this whois webapp has done like this.

If you want to check the site I am trying to fix and have a whole idea
it is at http://whois.ubilibet.com, if you check the tool, the ES
domains has no result at the site. I write to the log the command
construction, copy and paste at the command line at it works.

By other hand your note about the default option I ddin't realise, I am
going to check, but I feel very confused why the command I pass in the
script to the passthru function, is executed from command line with no
error and giving the right result. That's why I focused the problem in
the PHP script.

Thank you very much human debugger :)


Jason Pruim escribió:
Morning,
  
  
So looking at those scripts I realized that perl is nothing like php ;)
  
  
Is there other info that the different places need? or is it just a
different URL?
  
  
I'm wondering why you could do something like:
  
  

  
switch(strtolower($ext)) {
  
case 'es';
  
case 'com.es';
  
case 'org.es';
  
case 'edu.es';
  
case 'gob.es';
  
$cmd = HTTP://www.myCool.es/?query="$nom.$ext";
  
break;
  
case 'eu';
  
$cmd = HTTP://www.myCool.eu/?query="$nom.ext";
  
break;
  
default;
  
$cmd = HTTP://www.whois.com/?query="$nom.ext";
  
break;
  
}
  
?>
  
  
instead of calling out to a different script?
  
  
Also, I noticed that in your script where you have "default:" in your
switch, you have a : instead of a ;
  
  
May be causing some grief :)
  
  
  
On Apr 29, 2008, at 4:54 AM, J. Manuel Velasco - UBILIBET wrote:
  
  
  Hi,


Thanks for the replay, at least the debugger runs and it's easy to
install :)


I am new here, this is a small company and I am the only computing man,
so the person who implemented theses scripts are far away to ask for
something.


Since I deduced there are different whoises scripts because the way to
make the petition is different depending on the domain (es) the query
is to an organization, ESNIC, (eu) query is to another organization,
EURID and for the rest it is executed just the *NIX whois command.


So since the connection, and the data exchange structure are different,
we need diferent scripts.


I attach now the files I metioned in my last email. If anybody can
check why the whois_es script doesn't run... you will be my idol !


Note: I hae change the name os the scripts since they are located in
specific place.


Thanks in advance.


Jason Pruim escribió:


  
On Apr 28, 2008, at 10:58 AM, J. Manuel Velasco - UBILIBET wrote:
  
  
  Ok, so I am going to try this one, Jason
Pruim, let's check how it works ... :p


PROBLEM DESCRIPTION:

In my whois web-app, when a EU doamin is queried, whois.pl perl script
is lunched and I got the right result to my PHP script I the result is
shown at the web.

If I do the query to a ES domain, other whois.pl script is lunched, but
passthru doesn't execute it.

Both scripts are almost the same, they are in the same file structure,
same machine, same permissions...

  
  
Have you tried to use a program to compare the files? Make sure that
only the necessary lines are different?
  
  

The most strange is that I logged the command petition and If I copy
and paste exaclty the same that is passed to passthru, the command for
the whois to ESNIC is executed in the command line and shows the
result.


Collegues told me to check the ENV, permissions, and so on, I did with
no results, also, the other perl script that is almost the same is
executed, so I feel very very lost.


Three files attached:

whois_es.pl -> perl script to query whois in ESNIC

whois_eu.pl -> perl script to query whois in EURID

container.php  -> intermediate page where the commands are build
and passthru is executed.

  
  
Is there any particular reason you are using different perl scripts
instead of a simple whois script for all of them?

Re: [PHP] PHP debugger

2008-04-29 Thread J. Manuel Velasco - UBILIBET




Hi, 

Thanks for the replay, at least the debugger runs and it's easy to
install :)

I am new here, this is a small company and I am the only computing man,
so the person who implemented theses scripts are far away to ask for
something. 

Since I deduced there are different whoises scripts because the way to
make the petition is different depending on the domain (es) the query
is to an organization, ESNIC, (eu) query is to another organization,
EURID and for the rest it is executed just the *NIX whois command.

So since the connection, and the data exchange structure are different,
we need diferent scripts.

I attach now the files I metioned in my last email. If anybody can
check why the whois_es script doesn't run... you will be my idol !

Note: I hae change the name os the scripts since they are located in
specific place. 

Thanks in advance.

Jason Pruim escribió:

  
  On Apr 28, 2008, at 10:58 AM, J. Manuel Velasco - UBILIBET wrote:
  
  
 Ok, so I am going to try
this one, Jason Pruim, let's check how it works ... :p

PROBLEM DESCRIPTION:
In my whois web-app, when a EU doamin is queried, whois.pl perl script
is lunched and I got the right result to my PHP script I the result is
shown at the web.
If I do the query to a ES domain, other whois.pl script is lunched, but
passthru doesn't execute it.
Both scripts are almost the same, they are in the same file structure,
same machine, same permissions...
  
  
  
Have you tried to use a program to compare the files? Make sure that
only the necessary lines are different?
  


The most strange is that I logged the command petition and If I copy
and paste exaclty the same that is passed to passthru, the command for
the whois to ESNIC is executed in the command line and shows the result.

Collegues told me to check the ENV, permissions, and so on, I did with
no results, also, the other perl script that is almost the same is
executed, so I feel very very lost.

Three files attached: 
whois_es.pl         -> perl script to query whois in ESNIC
whois_eu.pl         -> perl script to query whois in EURID
container.php      -> intermediate page where the commands are build
and passthru is executed.
  
  
  
Is there any particular reason you are using different perl scripts
instead of a simple whois script for all of them?
  
  
Also... the only attachment was your logo :)
  
  
  
  


Thank you very much for any hint. I feel lost almost one week with this
BUG.

Jason Pruim escribió:

On Apr 28, 2008, at 10:32 AM, Thijs Lensselink wrote: 
  
  Quoting Daniel Brown <[EMAIL PROTECTED]>: 

On Mon, Apr 28, 2008 at 7:00 AM, J.
Manuel Velasco - UBILIBET 
  <[EMAIL PROTECTED]> wrote: 
  
Hello, 

Anybody knows a good debugger for PHP and basic usage? 
  
  
   There's a pretty good one known as Jason Pruim.  ;-P 


ROFL! 
  
  
  
Yall have too much time on your hands! :P 
  
  
  


-- 
 
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just 
$59.99/mo. with no contract! 
Dedicated servers, VPS, and hosting from $2.50/mo. 
  
-- 
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



  
  
-- 
  
Jason Pruim 
Raoset Inc. 
Technology Manager 
MQC Specialist 
3251 132nd ave 
Holland, MI, 49424-9337 
  www.raoset.com 
  [EMAIL PROTECTED] 
  
  
  
  


-- 


  
  
  
   
  
  
  --
  
  
  Jason Pruim
  Raoset Inc.
  Technology Manager
  MQC Specialist
  3251 132nd ave
  Holland, MI, 49424-9337
  www.raoset.com
  [EMAIL PROTECTED]
  
  
  
  
  
  


-- 





whois_es.pl
Description: Perl program


whois_eu.pl
Description: Perl program


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

Re: [PHP] PHP debugger

2008-04-28 Thread J. Manuel Velasco - UBILIBET




Ok, so I am going to try this one, Jason Pruim, let's check how it
works ... :p

PROBLEM DESCRIPTION:
In my whois web-app, when a EU doamin is queried, whois.pl perl script
is lunched and I got the right result to my PHP script I the result is
shown at the web.
If I do the query to a ES domain, other whois.pl script is lunched, but
passthru doesn't execute it.
Both scripts are almost the same, they are in the same file structure,
same machine, same permissions...

The most strange is that I logged the command petition and If I copy
and paste exaclty the same that is passed to passthru, the command for
the whois to ESNIC is executed in the command line and shows the result.

Collegues told me to check the ENV, permissions, and so on, I did with
no results, also, the other perl script that is almost the same is
executed, so I feel very very lost.

Three files attached: 
whois_es.pl         -> perl script to query whois in ESNIC
whois_eu.pl         -> perl script to query whois in EURID
container.php      -> intermediate page where the commands are build
and passthru is executed.

Thank you very much for any hint. I feel lost almost one week with this
BUG.

Jason Pruim escribió:

On Apr 28, 2008, at 10:32 AM, Thijs Lensselink wrote:
  
  
  Quoting Daniel Brown
<[EMAIL PROTECTED]>:


On Mon, Apr 28, 2008 at 7:00 AM, J. Manuel
Velasco - UBILIBET
  
<[EMAIL PROTECTED]> wrote:
  
  
Hello,


Anybody knows a good debugger for PHP and basic usage?

  
  
   There's a pretty good one known as Jason Pruim.  ;-P
  


ROFL!

  
  
  
Yall have too much time on your hands! :P
  
  
  
  


--
  

  
Dedicated Servers - Intel 2.4GHz w/2TB bandwidth/mo. starting at just
  
$59.99/mo. with no contract!
  
Dedicated servers, VPS, and hosting from $2.50/mo.
  
  
--
  
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



  
  
--
  
  
Jason Pruim
  
Raoset Inc.
  
Technology Manager
  
MQC Specialist
  
3251 132nd ave
  
Holland, MI, 49424-9337
  
www.raoset.com
  
[EMAIL PROTECTED]
  
  
  
  
  


-- 





[PHP] PHP debugger

2008-04-28 Thread J. Manuel Velasco - UBILIBET




Hello,

Anybody knows a good debugger for PHP and basic usage?

I've found: http://dd.cron.ru/dbg/, what do you think about it ?

Thanks.
-- 





[PHP] curiosidad

2008-04-28 Thread J. Manuel Velasco - UBILIBET

Hello,
Since I saw in avaaz site [http://www.avaaz.org/en/], I felt the 
curiosity to know how to develop a system like they use to spread the 
world. It is to connect to a address directory and get our contacts.


Anybody knows any library, references,... to know how to develop this 
service?


thanks in advance.

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



Re: [PHP] reading Qmail boxes

2008-04-26 Thread Manuel Lemos
Hello,

on 04/26/2008 03:43 AM Richard Kurth said the following:
>>> I what to read the email headers that are in a Qmail mailbox so that I
>>> can run it threw a filter and see what mail bounced for what reason.
>>> How do I do this being that the ownership on Qmail mailboxes are
>>> diferent from  the  owner that runs php and apache
>>> 
>>
>> You can use this class to parse the messages and extract the addresses
>> from bouncing messages.
>>
>> http://www.phpclasses.org/mimeparser
>>
>>   
> I have looked at this many times I just can't figure out how to use it.
> All I what to do is grab the mail out of the mailbox and see way it bounced
> then add that info to my program for the email user that sent it.

I think the safest way is to setup a POP3 mailbox to receive the
bouncing messages and then use POP3 client class like this to fetch and
process the bounced messages one by one.

http://www.phpclasses.org/pop3class

The MIME parser class can parse messages passed as strings or from
files. The POP3 class provides a stream wrapper that allows PHP to treat
messages in a POP3 mailbox as if they were real files. This way you can
connect the POP3 class directly to the MIME parser class.

Take a look at the parse_message.php script for an example of this.

The MIME parse class has a Decode function to parse the message, and the
Analyze function to tell which kind of message is what you have passed
and eventual parameters related to that type of message.

In the case of the bounces returned as message/delivery-status, the MIME
parse returns the boucing addresses and associated bouncing reasons.

Take a look at the test_message_decoder.php example script to see it in
action.


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] reading Qmail boxes

2008-04-25 Thread Manuel Lemos
Hello,

Richard Kurth wrote:
> I what to read the email headers that are in a Qmail mailbox so that I
> can run it threw a filter and see what mail bounced for what reason.
> How do I do this being that the ownership on Qmail mailboxes are
> diferent from  the  owner that runs php and apache

You can use this class to parse the messages and extract the addresses
from bouncing messages.

http://www.phpclasses.org/mimeparser

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Re: how to use passthru ()

2008-04-24 Thread J. Manuel Velasco - UBILIBET




No friend,

I said, the perl scripts work fine. The problem is to show the result
in the site.

One of them the result is shown and in the other one, not. 

What is strange to me is that both scripts are almost the same, only
changes the query, in one case is to Eurid and the other case is to
Eurid. But I repeat, execute the scripts from command line show the
right result in both cases.

So I was asking if I was doing something wrong that i couldn't see in
my passthru() function use.

Please, read, think and them if you can say something to help, do it.
In this case you just make grow your EGO.

M. Sokolewicz escribió:
J. Manuel
Velasco - UBILIBET wrote:
  
  Hello,


I have two perl scripts that runs fine in the shell. But when I build a
page with them, only in one case the results are shown in the other
case i see a blank page.


I have done different test and I don't understand this issue. I don't
know what i am doing wrong.


Follows the link to the code:

EURID script: http://pastebin.com/m3d6cbffe

ESNIC script: http://pastebin.com/m40755f40

PAGINA: http://pastebin.com/m5f8e1043


Thanks in advance to help me with this.

  
  
  
So you're basically asking for help with your perl scripts on a
PHP-only mailinglist?! Well... flame away...
  
  
- Tul
  
  


-- 





[PHP] how to use passthru ()

2008-04-24 Thread J. Manuel Velasco - UBILIBET

Hello,

I have two perl scripts that runs fine in the shell. But when I build a 
page with them, only in one case the results are shown in the other case 
i see a blank page.


I have done different test and I don't understand this issue. I don't 
know what i am doing wrong.


Follows the link to the code:
EURID script: http://pastebin.com/m3d6cbffe
ESNIC script: http://pastebin.com/m40755f40
PAGINA: http://pastebin.com/m5f8e1043

Thanks in advance to help me with this.

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



Re: [PHP] Denver PHP opportunity - Senior Software Engineers

2008-04-21 Thread Manuel Lemos
Hello,

You may want to take a look here and find qualified PHP developers near
your region. You may even search for developers that have relevant skills.

http://www.phpclasses.org/professionals/country/us/


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: HTTP Server Written entirely in PHP ?

2008-04-18 Thread Manuel Lemos
Hello,

on 04/19/2008 01:17 AM Kinch Zhang said the following:
> I was wondering if there was any HTTP server written entirely in PHP with
> the following features:
> 
> 1. HTTP/1.1 compliance
> 2. Apache mod_rewrite-like URL rewrite support
> 3. Native PHP support ( not through CGI/FastCGI )
> 4. Support PHP 4.2.0 or above
> 
> Nanoweb is an HTTP server written in PHP but It doesn't support all the
> above features.
> 
> So could anyone give me a clue if you know such a HTTP server ?

You may want to take a look at these HTTP server classes:

http://www.phpclasses.org/bib_server

http://www.phpclasses.org/astahttpd


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Google App Engine needs PHP support

2008-04-10 Thread Manuel Lemos
Hello,

Google App Engine was launched but it does not support PHP. This article
presents some ideas that can help Google adding PHP support sooner
rather than later.

http://www.phpclasses.org/blog/post/77-Google-App-Engine-needs-PHP-support.html

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] APC & FastCGI != upload progress ?

2008-04-10 Thread Manuel Lemos
Hello,

on 04/09/2008 03:07 PM steve said the following:
>>> FastCGI is *the* way to run PHP, but I think Apache is not the
>>> platform for it anymore.
>> If need more than one server, Apache pre-forked model may limited.
>> Otherwise it is just fine. Other than that, I think there are some
>> features that only work with Apache SAPI.
> 
> Apache SAPI is the easiest. But it falls apart when you have a higher
> load. FastCGI can stall those who are thinking of getting their second
> webserver. When you have a whole farm of them the differences are
> grossly obvious.

Sure, but it also adds overhead when replying to HTTP requests. There
are no miracles.


>>> Is the COMMET implementation on the client side long polling
>>> (reconnect) or does it stream using script tags? What goes on in the
>>> server? Does it push the buffer of blank data that WebKit requires? Is
>>> it a PHP daemon process running as a simple HTTP server?
>> Actually it is just an hidden iframe that loads an HTML page with small
>> Javascript chunks that flush each COMET AJAX server response. This is a
>> regular HTTP request performed to the same script that serves that form.
>> The form AJAX plug-in can detect the AJAX request and respond
>> adequately. So it works equally well in all browsers including Webkit.
> 
> So you keep a whole Apache/PHP process open for each user? That is
> nice for a small site, but doesn't work with tens of thousands of
> simultaneous connections. :(

No, I did not say that. "AJAX" requests using this approach are
triggered on demand. For PHP is like any other request. Executing an
AJAx request this way or a regular request submiting a form or following
a link consumes just one process.


> Webkit has a bug/feature that it would buffer the incoming data until
> it reached 1024 bytes. You can see how the django server deals with it
> in their comet implementation:
> http://code.google.com/p/django-evserver/source/browse/trunk/comet.py
>
> Orbited also uses 100 "" as padding.

Maybe you are talking about some other Comet approach. Last time I tried
the approach that I described with Safari, I did not see any delay due
to buffering. But if there is any delay imposed by any browsers, it
would not be hard to add any padding.


> So does meteor I believe. Here is what they say:
> "Safari and IE have a buffer which must fill up before any response is
> parsed. Data received before the buffer is full will not be rendered
> or interpreted and will not fire the Interactive state of an XHR until
> the buffer is full or the connection is closed. The obvious solution

The approche described above does not render anything nor uses
XMLHTTPRequests. It is just a regular page with some Javascript loaded
in an hidden iframe. That Javascript communicates and updates with the
iframe parent page.

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: How to create combo-boxes/list boxes connected with MS SQL Serverdatabase in PHP scripts

2008-04-10 Thread Manuel Lemos
Hello,

on 04/09/2008 02:27 AM [EMAIL PROTECTED] said the following:
> Sir
> I want to create combo-boxes/list-boxes from a table which is available in 
> MS-Sql server database. I have established connectivity with ms-sql server 
> database using odbc.
> how can i create combo-boxes in my php scripts?
> waiting for an early reply.

You may want to try this forms generation class that comes with a
plug-in to link 2 or more select inputs . There are variants of that
plug-in can retrieve new options from a database on the server. Most
popular databases are supported, including MS-SQL server, with the
variants that use the Metabase or PEAR::MDB2 database API.

http://www.phpclasses.org/formsgeneration

Here is a live example of the linked select plug-in:

http://www.meta-language.net/forms-examples.html?example=test_linked_select

Here you may watch a tutorial video also about this plug-in:

http://www.phpclasses.org/browse/video/1/package/1/section/plugin-linked-select.html

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: books for php

2008-04-10 Thread Manuel Lemos
Hello,

on 04/06/2008 12:28 PM news.php.net said the following:
> Which are the good books for learning php? 

Here you may find several PHP books that got good reviews:

http://www.phpclasses.org/reviews/latest/latest.html

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Dynamic dropdown lists (select)

2008-04-06 Thread Manuel Lemos
Hello,

on 04/04/2008 07:51 AM Angelo Zanetti said the following:
> I am looking at options for creating a dynamic dropdown list.
> 
> Ok here is the scenario: 
> 
> All values in the dropdown list (select/option field) are coming from the
> database.
> 
> So there will be 2 dropdown lists. First one say gets (for example) a list
> of cars, 
> 
> Then once the car is choosen the second list is populated with the list of
> models for the car choosen.
> 
> I would like to know if its possible to do this without posting as well as
> without the use of JS. I have seen js examples where the values are all
> stored in arrays.
> 
> This is not desireable as I will be getting the values from the the DB using
> PHP, unless I can write the JS values to the arrays using PHP? Also not sure
> of that.
> 
> Is there any other idea or thing I can do? Im thinking maybe AJAX but this
> is for a mobile site (WAP/xHTML) site and Im not sure if the functionality
> will work on these devices.

This forms generation class comes with a plug-in that does exactly that.

http://www.phpclasses.org/formsgeneration

It requires some Javascript to send AJAX request to the server, so the
plug-in itself queries the database and sends the select input options o
the browser. But you do not have to worry because the class generates
all the necessary Javascript for you.

Here is a live example of the plug-in:

http://www.meta-language.net/forms-examples.html?example=test_linked_select

You may also want to watch this tutorial video:

http://www.phpclasses.org/browse/video/1/package/1/section/plugin-linked-select.html


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] APC & FastCGI != upload progress ?

2008-04-05 Thread Manuel Lemos
Hello,

on 04/04/2008 03:16 AM steve said the following:
> FastCGI is *the* way to run PHP, but I think Apache is not the
> platform for it anymore.

If need more than one server, Apache pre-forked model may limited.
Otherwise it is just fine. Other than that, I think there are some
features that only work with Apache SAPI.


> Is the COMMET implementation on the client side long polling
> (reconnect) or does it stream using script tags? What goes on in the
> server? Does it push the buffer of blank data that WebKit requires? Is
> it a PHP daemon process running as a simple HTTP server?

Actually it is just an hidden iframe that loads an HTML page with small
Javascript chunks that flush each COMET AJAX server response. This is a
regular HTTP request performed to the same script that serves that form.
The form AJAX plug-in can detect the AJAX request and respond
adequately. So it works equally well in all browsers including Webkit.


> On Wed, Apr 2, 2008 at 12:09 AM, Manuel Lemos <[EMAIL PROTECTED]> wrote:
>> Hello,
>>
>>  on 03/30/2008 02:52 PM steve said the following:
>>
>>> Hmmm... I am working on a PHP daemon for comet style connections...
>>  > I'll keep that idea in mind. I guess that using Flash is best solution
>>  > at the moment.. at least the only one I have working...
>>
>>  I implement COMET connections with plain HTML with an hidden iframe.
>>  Actually I have been using that for a upload progress meter among other
>>  AJAX uses. Actually it is an AJAX plug-in of this forms class:
>>
>>  http://www.phpclasses.org/formsgeneration
>>
>>  Here is an example of a form upload progress done all in PHP and plain HTML:
>>
>>  
>> http://www.meta-language.net/forms-examples.html?example=test_upload_progress
>>
>>  Here you can watch a tutorial video that explains the COMET AJAX
>>  implementation:
>>
>>  http://www.phpclasses.org/browse/video/1/package/1/section/plugin-ajax.html


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Reporting mail as spam

2008-04-02 Thread Manuel Lemos
Hello,

On Mon, Mar 31, 2008 at 12:01 PM, Sándor Tamás wrote:
> Hi,
>
>  I wrote a little registration routine, which will send a confirmation letter 
> to the user with a random number in the message body (my site is on a host, 
> so I can't write in the subject, and ask the user to reply), which can be 
> clicked then, and my site will finish the registration. My big problem is, 
> that this host inserts an X header to the mail which identifies my PHP script 
> as the X-PHP. As I recognize, this header adds a huge number to the spam 
> score. Is there any possibility, to reduce the other scores? By the way, what 
> counts most in a spam?

I agree with Richard, sending the messages as plain text may reduce your
chances of having your messages confused with spam.

But even plain text messages can be confused of spam often for not being
well-formed according to e-mail standards.

It is hard to tell what you may be doing wrong without seeing your code.

Anyway, I recommend you this popular PHP MIME message class that I use
that knows how to send e-mail standards compliant messages:

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] APC & FastCGI != upload progress ?

2008-04-02 Thread Manuel Lemos
Hello,

on 03/30/2008 02:52 PM steve said the following:
> Hmmm... I am working on a PHP daemon for comet style connections...
> I'll keep that idea in mind. I guess that using Flash is best solution
> at the moment.. at least the only one I have working...

I implement COMET connections with plain HTML with an hidden iframe.
Actually I have been using that for a upload progress meter among other
AJAX uses. Actually it is an AJAX plug-in of this forms class:

http://www.phpclasses.org/formsgeneration

Here is an example of a form upload progress done all in PHP and plain HTML:

http://www.meta-language.net/forms-examples.html?example=test_upload_progress

Here you can watch a tutorial video that explains the COMET AJAX
implementation:

http://www.phpclasses.org/browse/video/1/package/1/section/plugin-ajax.html



> I'm guessing that FastCGI is buffering the upload until complete. PHP
> docs might want to document that.
> 
> FastCGI is also breaking Apache's deflate module, but that is another issue...

Couldn't it be deflate buffering FastCGI output?

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: character encoding

2008-03-29 Thread Manuel Lemos
Hello,

on 03/29/2008 12:43 PM Bill said the following:
>> You can build mailto: links with a default subject and text, but I am
>> not sure you can force Outlook to use specific HTML. It's wiser to not
>> rely on mailto: .
> 
> Hotmail will accept mail delivery from PHP ?

Sure. There is nothing specific of PHP that prevents Hotmail from
accepting messages sent by PHP scripts.

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: character encoding

2008-03-28 Thread Manuel Lemos
Hello,

on 03/28/2008 12:08 PM Bill said the following:
> Hi Manuel
>
>>> In the body that column shows " Brébeuf " in Windows Outlook.
>
>> You may want to try this MIME message composing and sending class that
>> http://www.phpclasses.org/mimemessage
>
> Looks great Manuel.but my server is under dyndns and the DN isn't
qualified
> so no mail functions available.

I am not sure what you mean. This class can compose messages which can
be delivered by different drivers, like the mail() function, SMTP
client, qmail, sendmail, etc. If you can't use the mail function, you
can still send message relaying them through an SMTP server, like for
instance Gmail's.


> I was asking how to have the right character set translation so the data
> stored in the table show no grimmerish in the outlook window.
>
> A simple mailto link in the page with some basic content defined does the
> trick but the data retrieved from the table can look awsome in the mail
> client before the user sends it back to the owner email address.
>
> I'm making a site for myself. I'm a paintbrush artist, among other
things,
> and I've set a buying level for the visitors. But one can ask to raise
his
> level so he can buy more things in one session.
> For that I use a mailto link sent to my hotmail with the request
giving the
> name and address of the sender. And that's where I can't control
anything.
> The guy may have written accented caracters in his record and when
that info
> is brought back, it messes the Outlook msg window of the sender.
>
> Can I force Outlook msg composer to use my Mysql table collation ?

You can build mailto: links with a default subject and text, but I am
not sure you can force Outlook to use specific HTML. It's wiser to not
rely on mailto: .

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: character encoding

2008-03-26 Thread Manuel Lemos
Hello,

on 03/26/2008 04:57 PM Bill said the following:
> A column in a table has" Brébeuf " in it. (3rd caracter is é)
> 
> I use that table to send emails.
> 
> In the body that column shows " Brébeuf " in Windows Outlook.
> 
> How could I translate to the correct encoding so that accents show correctly 
> in Outlook ?

You should not send 8 bit data in your messages without proper quoted
printable encoding. Also you need to specify the character set of text
you are sending.

You may want to try this MIME message composing and sending class that
supports quoted printable encoding with any character set either in the
text and in the message body.

Take a look test_email_message.php for single by character sets or even
the test_multibyte_message.php if you are not using multibyte character
sets.

http://www.phpclasses.org/mimemessage

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Quick email address check

2008-03-26 Thread Manuel Lemos
Hello,

on 03/26/2008 02:28 PM Al said the following:
> I'm scripting a simple registry where the user can input their name and
> email address.
> 
> I'd like to do a quick validity check on the email address they just
> inputted. I can check the syntax, etc. but want check if the address
> exists.  I realize that servers can take a long time to bounce etc. I'll
> just deal with this separately.
> 
> Is there a better way than simply sending a test email to see if it
> bounces?

You may want to try this E-mail validation PHP class that does just
that. It simulates an attempt to send a message to the SMTP server of
the e-mail domain. It does not finish to send the message. The message
could still bounce later, but at least you will still detect some
invalid addresses.

http://www.phpclasses.org/emailvalidation


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Problems with mime encoding of Japanese Characters in Subject and'From:', 'Reply-to:', ... fields.

2008-03-20 Thread Manuel Lemos
Hello,

on 03/20/2008 04:06 AM Dietrich Bollmann said the following:
> Hi, 
> 
> --- note ---
> I sent a similar message already to php-i18n - but this list seems
> not to be used very much (20 messages this year) so I am posting it
> here again...
> 
> 
> I try to send messages written in Japanese (Kana/Kanji) with php.
> 
> Everything works fine - only when the subject (or the name of the
> sender) becomes longer, there seems to be something wrong with the
> encoding: Neither my nor the mail reader of other (Japanese) friends 
> decodes the mime string. At the place of the Japanese Characters, 
> the mime string itself is displayed in the subject (to, reply to) 
> field.
> 
> As this doesn't happen for other Japanese emails with even longer
> subjects, I suppose I did something wrong ... but what?

You may want to try this MIME message composing and sending class that
can send messages with encoded headers correctly using any character
set. Take a look at the test_multibyte_message.php example script:

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Will the progress bar like Xupload add too much weight to the Apacheserver?

2008-03-20 Thread Manuel Lemos
Hello,

on 03/20/2008 03:32 AM Shelley said the following:
> My question is:
> Will the upload progress bar like that add too much weight to the Apache
> server, especially to a server with millions of visitors each day?

It is hard to tell. It seems to rely on a mod_perl script.

You may also want to try this forms generation and validation class that
 comes with an upload progress plug-in that relies only on PHP:

http://www.phpclasses.org/formsgeneration

Here you can test it live:

http://www.meta-language.net/forms-examples.html?example=test_upload_progress

Here you can watch it live:

http://www.phpclasses.org/browse/video/1/package/1/section/plugin-upload-meter.html

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Sendmail question

2008-03-15 Thread Manuel Lemos
Hello,

on 03/14/2008 12:35 PM nihilism machine said the following:
> So the email should be a link to:
> http://www.mysite.com/permalink.php?ID=120
> but instead links to: http://www.mysite.com/permalink.php?ID%120

The problem is that you have specified quoted-printable encoding and
have not properly encoded all characters in the HTML.

I recommend that you a class that knows how to properly message bodies
with quoted-printable. I use the MIME message class. Take a look at the
test_simple_html_mail.php example script.

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: PHP & Ajax progress bar

2008-03-12 Thread Manuel Lemos
Hello,

on 03/12/2008 12:24 AM Shelley said the following:
> Hi all,
> 
> I'm searching some file upload progress bar code.
> But no good result was found. :(
> So is there anybody please be kind enough to show some code here?

You may want to take a look at this forms generation and validation
class that comes with a plug-in to do precisely that. Check the
test_upload_progress.php example script.

http://www.phpclasses.org/formsgeneration


Here is a live example page so you can see it in action:

http://www.meta-language.net/forms-examples.html?example=test_upload_progress


You can also watch this tutorial video to learn more about this plug-in:

http://www.phpclasses.org/browse/video/1/package/1/section/plugin-upload-meter.html


You may also want to read this blog article about the subject:

http://www.phpclasses.org/blog/post/61-File-upload-progress-meter-for-PHP-4-at-last.html

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Alternative to Quickforms - Not Use Tables

2008-03-05 Thread Manuel Lemos
Hello,

on 03/05/2008 08:22 PM Stephen said the following:
> Subject says it.
> 
> Is there an open source class for forms that provides for the use of CSS
>  for the layout of forms?

You may want to try this forms generation and validation class. It comes
with a vertical layout plug-in. By default it uses tables, so you do not
have to hardcode widths to make field rows and label columns align, but
you can override the default templates and set them to use tableless HTML.

http://www.phpclasses.org/formsgeneration

Take a look at the test_auto_layout_form.php example.

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Flexible Shopping Cart (was: Shopping Carts)

2008-02-27 Thread Manuel Barros Reyes
I've sent a message some hours ago and committed the mistake of
including it inside of an already started thread, don't know if
someone read it.

The details are in that thread but basically what I am looking for is
a shopping cart that has flexibility with respect to the graphical
layout of elements and their appearance  as well as the ability to
extend the framework with custom functionalities.

Don't have good experience with oscommerce because of the way the
layout is set with tables, it doesn't give much freedom and couln't
find good docs about it. Saw Zen Cart and it looks promising but have
no experience on it.

Listen to your suggestions.
Thanks again.

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



Re: [PHP] Shopping Carts

2008-02-27 Thread Manuel Barros Reyes
Hi, talking about Shopping Carts I am looking for one thats good but
that it is also flexible when you need custom designs and
extesibility.

I've had experience with osCommerce and their designs are very rigid.
It works out of the box but as soon as you need to customize design
it's PITA cause you have to fight with all those tables they use for
the layout.

I've seen that Zen Cart gives you more freedom with respect to designs
without loosing features which makes it a good choice, anyway before I
choose myself I would like to hear what you guys have to say about it
or any alternatives you know about, my primary goal is flexibility.

Thanks again.

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



Re: [PHP] How do you send stylized email?

2008-02-26 Thread Manuel Lemos
Hello,

on 02/26/2008 11:53 AM tedd said the following:
>>> $message = <<>> Title: This is a title of the Event.
>>> Time: This the time of the Event.
>>>
>>> Please show up on time.
>>> EOT
>>>
>>> mail('[EMAIL PROTECTED]' , 'An Event' , $message);
>>>
>>> If so, how do you style it?
>>>
>>> If not, how do you send stylized email?
>>
>> The easiest way is this:
>>
>> $message = <<> 
>> Title: This is a title of the Event.
>> Time: This the time of the Event.
>> 
>>
>> Please show up on time.
>> EOT
>>
>> mail('[EMAIL PROTECTED]' , 'An Event' , $message, 'Content-Type:
>> text/html');
> 
> Duh!
> 
> I should have thought of that.

Be careful. Do not send HTML only messages or else some mail systems
(notably Hotmail for instance) will discard your messages as if they
were spam.

The right solution to send HTML messages is to use multipart/alternative
messages so you can specify an alternative text to show in mail clients
that do not support HTML messages.

It is a bit more complex solution, but if you want all people to get
your message, it is necessary. To simplify the problem you may want to
use a ready to use PHP component that can compose multipart/alternative
messages. I use this popular MIME message composing class. Try the
test_simple_html_mail_message example script for instance.

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Re: PHP cuts download process prematurely

2008-02-26 Thread Manuel Barros Reyes
On Tue, Feb 26, 2008 at 3:07 AM, Andrés Robinet <[EMAIL PROTECTED]> wrote:
>
>  Though this is not likely to solve the problem, try adding the following two
>  lines at the beginning of the script (even before you query the database and 
> do
>  all your logic)
>
>  ignore_user_abort(true);
>  set_time_limit(0);
>
>  You need the log files to know exactly what the problem is. And, even if you 
> are
>  not solving this issue using compression as a workaround, you may also want 
> to
>  add at the beginning of the script:
>
>  ob_start("ob_gzhandler")


>From what I read I think ob_start("ob_gzhandler") would be needed if I
would like to compress output transparently and let the clients
browser do the reverse job in the same maner, but in this case I am
uploading the files as .gz and the person who downloads it takes care
of decompressing it by hand.

Maybe I should use a simple ob_start() in this case. I understand
ob_start()-ob_end_flush() collects data in a server buffer and outputs
it all together but in the case of my script the only output is the
file I am uploading and the output is only in th echo $contents.
Unless I am missing details of ob_start() wouldn't this be equivalent
in this case?

Thanks

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



Re: [PHP] Re: PHP cuts download process prematurely

2008-02-26 Thread Manuel Barros Reyes
On Tue, Feb 26, 2008 at 3:07 AM, Andrés Robinet <[EMAIL PROTECTED]> wrote:
>
>  You need the log files to know exactly what the problem is. And, even if you 
> are

I'll try to rescue those logs many thanks again.

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



[PHP] PHP cuts download process prematurely

2008-02-25 Thread Manuel Barros Reyes
I am building a report application that generates some text files for
download and when the download starts it stops prematurely.

The file sizes are currently in the order of the mega bytes and when I
try the script that generates and sends the file in a test server the
process goes smoothly no matter the size of the file but as soon as I
move the script to the production server dowloads cut at 300kb aprox.
My current workarround is to gzip the files and that is giving me some
extra time but the files are growing and sooner or later my
workarround will become useless.

I guess the download is stoped by some timeout and not because of the
amount of kb downloaded because the size varies slightly. If that
timeout exists it should be of apox. 5-10 seconds.

I use this function to perform the upload $contenido is the content of
the file and to that variable I assign the big chunk of output from
the report, $nombre_archivo is the optional name for the file. I can
paste more code but I think the problem is here.



Thanks in advance
Manuel

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



[PHP] Set PHP session expire to 2 months

2008-02-25 Thread Manuel Barros Reyes
Hi, I'm working on a site that needs that once the user chooses his
country the question should not be asked again (while the user doesn't
manually delete the cookies in his browser).

The question is asked only in the index.php and the answer is stored
in $_SESSION["pais"]. If the user tries to enter the site once again
and the session variable is still set the question is not asked again
as it is supposed to happen. The session data is configured to last
for aprox. 2 months and it works in the browsers I've tried it but
still I receive reports of users who are constantly being asked for
their countries they also told me they don't have cookies blocked.

Below I paste the code I am using inside index.php to test if the
session is set:



Can someone see something wrong with this? Inside home.php I do the
opposite if the session var. is not set the redirect to index.php.



Thanks in advance.
Manuel

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



[PHP] Re: Copy Network Share W/ Diff. Creds To Local Folder?

2008-02-21 Thread Manuel Lemos
Hello,

on 02/21/2008 07:48 PM Jason Paschal said the following:
> I'm building a web app on a windows server for a company.
> an aspect of that requires grabbing a sound file from a network share, which
> i attempted with a windows copy command via exec(), but PHP needs to be able
> to pass the authentication credentials.
> 
> runas requires password interactivity, and i've looked at runasspc but that
> costs for commercial use and was hoping to avoid it if possible.
> 
> is there a way to finesse runas with PHP?  some trick to get PHP to offer
> the password?
> 
> or is there some other clever way to make this happen?

Yes, you can use this stream handler class that lets you access files in
Windows shares as if they were local files:

http://www.phpclasses.org/smb4php

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: php+mail+TLS/SSL

2008-02-14 Thread Manuel Lemos
Hello,

on 02/14/2008 12:34 PM julian said the following:
> I am using phpmailer currently to send email from my applications. My
> ISP is restricting the usage of email without SSL/TLS and my SMTP
> connections have started to fail...
> 
> Any hints on the best approach to send email from php appplciations ?, I
> wish I could use my standard gmail/yahoo accounts like my desktop
> email program...

I am not sure if you can or cannot use SMTP with TLS.

In any case, you may use this popular MIME message composing and sending
class that comes with several alternative delivery methods. It supports
SMTP deliveries with TLS enabled as required by Gmail and also mail()
function/sendmail deliveries. Just use the appropriate sub-class that
fit in your restrictions.

http://www.phpclasses.org/mimemessage

If you need to deliver via SMTP/TLS to Gmail, you also need these two
classes in conjunction. mail() function/sendmail deliveries do not
require additional classes:

http://www.phpclasses.org/smtpclass

http://www.phpclasses.org/sasl




-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Copying 1000s files and showing the progress

2008-02-13 Thread Manuel Lemos
Hello,

on 02/13/2008 11:11 PM Ritesh Nadhani said the following:
> I though I could apply some funkiness to it by using some AJAX based
> progress bar for which the example showed some sort of hooking and all
> which I thought was too much for such a job. I will talk to my boss
> regarding this and do the necessary.
> 
> BTW, whats the issue with AJAX based approach? Any particular reason
> other then it seems to be a hack rather then an elegant solution
> (which is more then enough reason not to implement it...but I wonder
> if there is a technical reason to it too)?

If the user hits the browser stop button, it may abort the process in
the server if you have the PHP option ignore_user_abort option set to
off. Other than that I do not see any other problem.

AJAX can be a little complicated if you have to code all the Javascript
by hand.

You may want to try this forms class that comes with an AJAX form
submission plug-in.

http://www.phpclasses.org/formsgeneration

Even if you do not need to submit any forms, the AJAX plug-in can be
used to do what you need without having to learn Javascript to implement
a browser independent AJAX solution.

Take a look at this live example that shows how to give progress
feedback of a task running on the server:

http://www.meta-language.net/forms-examples.html?example=test_ajax_form


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Curl doesn't handle memory stream

2008-02-13 Thread Manuel Lemos
Hello

on 02/13/2008 08:11 PM Nathan Nobbe said the following:
> On Feb 13, 2008 5:07 PM, Jim Lucas <[EMAIL PROTECTED]> wrote:
> 
>> I see on the http://us.php.net/wrappers.php page that only php 5.1.0 and
>> newer
>> have this feature.  What version of PHP are you using?
> 
> 
> thanks for your time jim;
> im using 5.2.5.
> 
> manuel, thanks for your time as well.  of course i can just use a file,
> but im somewhat interested in this feature.  and im not sure if curl
> implements
> the file handling on its own, otherwise why would i have partial success
> with
> certain urls?  i think something goofy is going on here; id like to find out
> if
> at all possible.  i know that some extensions may not support the feature,
> but i could find no documentation that would say either way for the curl
> extension..

THat is a bit intriguing why it works in some cases and others it doesn't.

I do not use the Curl library functions except for things that you
cannot do with the current fsockopen based socket connections. In the
latest PHP versions there is not much that you cannot do with socket
connections that you can do with Curl.

In any case, I have encapsulated HTTP client fucntionality in the class
that I mentioned, so it uses fsockopen or curl functions depending on
what you need and what is available in the underlying PHP version. This
way I achive a PHP version independent solution.


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Curl doesn't handle memory stream

2008-02-13 Thread Manuel Lemos
Hello,

on 02/13/2008 05:17 PM Nathan Nobbe said the following:
>> If nobody has a solution I think I'll report it as a bug tomorrow.
> 
> 
> did you ever report a bug on this ?
> 
> i was messing around with it today, and i discovered that some urls,
> partially work.  for example the google translate 'api', and php.net
> 
> note, i set the user agent for the google site to work.  and i say,
> partially, because even when data does come back, its not the complete
> page, which you can easily realize by navigating to the page and comparing
> the source w/ the output from the test script.
> i dont know of any ini setting that would influence the amount of space
> available to the memory buffer, aside from memory_limit, which i have set
> to 128M.
> 
>  #$c = curl_init("
> http://google.com/translate_t?langpair=en%7Cfr&text=newspaper";);
> $c = curl_init("http://php.net";);
> $st = fopen('php://memory', 'r');
> 
> curl_setopt($c, CURLOPT_FILE, $st);
> curl_setopt($c, CURLOPT_USERAGENT, 'Mozilla/5.0 (X11; U; Linux i686; en-US;
> rv:1.8.1.11) Gecko/20080115 Firefox/2.0.0.11');
> 
> if(!curl_exec($c)) die ("error: ".curl_error($c));
> curl_close($c);
> 
> rewind($st);
> 
> echo stream_get_contents($st);
> fclose($st);
> ?>

It does not seem like it is a real bug but maybe file access is
implemented inside Curl and it has no knowledge about PHP stream support.

Alternatively, you may want to try this HTTP client class, which can use
any access files you need to use in your HTTP requests.

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Re: Recommended ORM for PHP

2008-02-12 Thread Manuel Lemos
at all provide the
>>>> same efficiency.
>>> yeah, sure. however there is a payoff between efficiency and portability
>>> and maintainability, and of course not all these orms have the same
>>> level of these. choose the one that fits your needs best.
>> Exactly. I choose to develop my own because nothing that existed in PHP
>> matched my needs and code quality code requirements. Of course doing it
>> yourself is an expensive measure because it takes time and skill to
>> reach a mature solution. I have been developing Metastorage for 6 years.
>> It is very mature and reliable, but there is always room for improvement.
> 
> I too had thought about implementing my own ORM, because none of them
> fits my needs exactly, however I don't have the time for that... so I
> use whatever I find the best at the moment.

Sure. Propel already existed when I started Metastorage. Although it was
better than other few existing PHP solutions, it did not satisfy me the
way it worked, as it seem still too tied to the relational world and I
did not feel that approach could bring me enough productivity, so I
could just concentrate my application models, rather than database tables.

Also the fact that it required a run-time with fat base classes to do
the basic ORM operations made me think that there should be a better way
to generate ORM code that is more compact and efficient as I would
create if I had to write the code manually.


>>>> If you are interested about more differences in the approaches, you may
>>>> check the Metastorage documentaion:
>>>>
>>>> http://www.metastorage.net/
>>>>
>>> sure, I'll check it out when I have some free time


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Ajax, an HTML form being saved in mySQL

2008-02-10 Thread Manuel Lemos
Hello,

on 02/11/2008 12:19 AM Ron Piggott said the following:
> I am trying to bring my programming skills together ... but I have hit a
> road block.
> 
> I am writing my own ledger (accounting) software.
> 
> I am needing help to pass 2 variables generated by Ajax through my form
> to be saved in a mySQL table.
> 
> A sample of what ledger_select_account.js outputs is as follows --- the
> PHP script it accesses queries a table and then echo's this to the
> screen.

This is a bit confusing, but it seems you want a typical linked select
input form. Take a look here and see if this is similar to what you want:

http://www.meta-language.net/forms-examples.html?example=test_linked_select

That was done with this forms generation and validation class. It comes
with plug-in that can link select inputs in order to switch the options
of one when another changes the selected value. It comes with a variant
of that plug-in that can perform an AJAX request and retrive the new
options from a MySQL database.

http://www.phpclasses.org/formsgeneration



-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Re: Recommended ORM for PHP

2008-02-08 Thread Manuel Lemos
Hello,

on 02/08/2008 06:15 AM Zoltán Németh said the following:
>> Another aspect is that Metastorage features what is called report
>> classes. These are classes that perform queries that you define and
>> generates SQL and PHP at compile time to retrieve data from the
>> persistent objects for read-only purposes.
> 
> and what if you want to switch sql server from mysql to oracle or
> whatever? in propel, you change 1 line in the config, you don't have to
> regenerate or rewrite anything.
>
> the base classes are useful too because if you change your schema, you
> simply regenerate them and all your extensions remain the same in the
> child classes.

Metastorage generates totaly database independent code . You don't need
to regenerate the code to support multiple databases nor have fat base
classes to access your database or do any other ORM operations.

Currently it generates code that uses Metabase database abstraction
layer, although it can support other database abstraction layers. It
supports many databases like MySQL, PostgreSQL, Oracle, Microsoft SQL
server, SQLite, etc..

Metabase also generates a separate class for installing or upgrading
your database schema. If you change the definition of you objects, you
just need to call that class to install, upgrade, downgrade your
database schemas, safely without loosing any data that was already in
the database.

This is something very secure, as it does not do any schema changes if
the underlying database does not support certain things you want to
change. If you ask for a change that is not possible, it simply fails
without changing anything. It is not that error prone migrations method
of Ruby on Rails, that you have to write "SQL" manually to do your
migrations, and if you made a mistake, your database data is lost.



>> For instance, if you want to send a newsletter to a million subscribers
>> and you just need the e-mail address and names of the subscribers, you
>> can tell Metastorage to generate a report class that queries the users
>> objects and retrives just the name and e-mail address. The report
>> classes return arrays just like plain SELECT queries.
>>
>> If you use the Propel approach you would need to retrieve 1 million
>> objects of the users class just to pick the name and e-mail address,
>> which is totally inefficient in terms of memory and very slow.
> 
> not at all. you can build the criteria for the select and then run a
> doSelectRS method which gives you only the result set in an array, no
> objects involved.

That is not exactly what I am talking about. Metastorage has an Object
Query Language (OQL) that lets you express whatever query conditions you
want. It generates PHP code with the necessary SQL queries you need. You
do not have to build any queries programatically at run-time.

The generated code can return full SQL statements if you want to execute
them separately by some other application code, but usually I just use
the generated report classes directly, as they take care of many things
like pagination, so I do not have to deal with SQL directly. That is one
of the great benefits of ORM.

With Metastorage I just do not have to deal with SQL manually nor I am
forced to retrieve all as objects, not even when I am retrieving just a
few variables of multiple classes. I do not have to SQL joins manually.
That would be walking backwards in productivity.


>> There are more differences between Metastorage and Propel (and probably
>> others approach). I just wanted to make the point that the fact that
>> approaches use generated code, it does not mean that all provide the
>> same efficiency.
> 
> yeah, sure. however there is a payoff between efficiency and portability
> and maintainability, and of course not all these orms have the same
> level of these. choose the one that fits your needs best.

Exactly. I choose to develop my own because nothing that existed in PHP
matched my needs and code quality code requirements. Of course doing it
yourself is an expensive measure because it takes time and skill to
reach a mature solution. I have been developing Metastorage for 6 years.
It is very mature and reliable, but there is always room for improvement.


>> If you are interested about more differences in the approaches, you may
>> check the Metastorage documentaion:
>>
>> http://www.metastorage.net/
>>
> 
> sure, I'll check it out when I have some free time



-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Re: Recommended ORM for PHP

2008-02-07 Thread Manuel Lemos
e and e-mail address. The report
>> classes return arrays just like plain SELECT queries.
> 
> 
> thats great, arrays are a little more lean than objects; but obviously they
> are not wrapped with any additional functionality; such as the ability to
> fetch
> the value of a record in a related table or alter the current value.

No, that is not the point. An object of a class may have tens of
variables (or properties if you prefer to call them that way). However,
to send a newsletter, you just need 2. Why are you going to retrieve all
class variables if you just need 2?

Another detail, if your newsletter needs values from multiple classes,
you need to query objects of the different classes envolved.

With Metastorage report classes, I just call a function and get Just
Exactly What I Need - JE WIN approach. Not more, not less. It just does
what would do if I were not using an ORM tool, a simple select call with
eventual joins, conditions, sorting, aggregation, pagination, etc...

It would be pointless to use persistent classes for these purposes
because you just need to retrieve data for read-only purposes. No
objects are updated when you need to generate reports or send
newsletters for instance.



>> If you use the Propel approach you would need to retrieve 1 million
>> objects of the users class just to pick the name and e-mail address,
>> which is totally inefficient in terms of memory and very slow.
> 
> 
> well lets just remember that even though arrays are just data and therefore
> less expensive in terms of memory and quicker to iterate; there would still
> be 1 million arrays of data.

Of course not, you can just retrieve one array at a time.

Still, even if you retrieve 1 million arrays to memory with just two
elements (name and e-mail), it takes much less memory than retrieving
millions of objects with all class variables including all those that
you do not need.


>> There are more differences between Metastorage and Propel (and probably
>> others approach). I just wanted to make the point that the fact that
>> approaches use generated code, it does not mean that all provide the
>> same efficiency.
> 
> 
> i would like to see some benchmarks of propel vs. metastorage.  i would do
> them myself except that i simply dont have time to do a proper experiment in
> the near future.  i will certainly consider an analysis of metastorage for a
> rainy
> day though.

Sorry, you may perform any benchmarks you want, but competition is not
my point here. I am just exchanging opinions and points of views.

There are ORM tools that are younger and eventually less mature. Their
developers may just learn from the benefits that other more mature ORM
tools provide.

I started Metastorage in 2002 and have analyzed several ORM approaches
before I figured what to do that to make an ORM tool that generates
satisfactory code as if I would write manually if I had too.

Of course, I am not assuming Metastorage provides the best solution in
all aspects. There is plenty of room for improvement in Metastorage, so
it is also beneficial to demonstrate if other approaches can provide
better results than Metastorage approach.

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Re: Recommended ORM for PHP

2008-02-07 Thread Manuel Lemos
Hello

on 02/07/2008 07:26 AM Zoltán Németh said the following:
>>> When creating a LAMP app, I always start by writing ORM myself.
>>> It's fun but it usually takes a  long time.
>>> Besides, that always results in a toy-system,
>>> I mean, that has not so many features, not so efficient non-bug-free.
>>>
>>> I started to think that now is the time  to throw away my rubbish
>>> and use more effective Open source ORM.
>>>
>>> So my  question is what ORM are you using?
>>> What ORM do you recommend?
>>> There're lots of Web app frameworks out there
>>> but I could't find simple ORM in PHP.
>> A similar question was asked here a couple of days ago.
>>
>> I will be repeating myself, but what I said was that I use Metatsorage
>> which is an ORM class generator tool. It is a different approach than
>> others you may find. It generates persistent object classes that are
>> smaller and more efficient.
> 
> that's exactly the same method all the ORMs we mentioned earlier
> (Doctrine, Propel, Qcodo) work. all these generate classes. ;P
> 
> aside from that, metastorage might be as good as any of the others of
> course

I don't know about Doctrine and QCodo, but once I looked at Propel and
the way it works was not exactly better than Metastorage generated
classes from my point of view.

What happens is that Propel relies on fat base classes that the
generated persistent object classes need to inherit to do the actual
Object-relational mapping.

Metastorage generates self-contained code. This means the generated
classes are root classes that do only what you need. The generated code
does the necessary database calls directly to store and retrieve objects.

It does not call base classes like Propel generated classes that waste
time composing SQL queries at run-time. Metastorage generated classes
already have the necessary SQL built-in to execute the queries without
further analysis at run-time.

Another aspect is that Metastorage features what is called report
classes. These are classes that perform queries that you define and
generates SQL and PHP at compile time to retrieve data from the
persistent objects for read-only purposes.

For instance, if you want to send a newsletter to a million subscribers
and you just need the e-mail address and names of the subscribers, you
can tell Metastorage to generate a report class that queries the users
objects and retrives just the name and e-mail address. The report
classes return arrays just like plain SELECT queries.

If you use the Propel approach you would need to retrieve 1 million
objects of the users class just to pick the name and e-mail address,
which is totally inefficient in terms of memory and very slow.

There are more differences between Metastorage and Propel (and probably
others approach). I just wanted to make the point that the fact that
approaches use generated code, it does not mean that all provide the
same efficiency.

If you are interested about more differences in the approaches, you may
check the Metastorage documentaion:

http://www.metastorage.net/

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] Recommended ORM for PHP

2008-02-06 Thread Manuel Lemos
Hello,

on 02/07/2008 02:18 AM Nathan Nobbe said the following:
> well i think its worth a mention that qcodo has an article that
> distinguishes
> 'ActiveRecord classes' from the 'ActiveRecord pattern'.
> http://www.qcodo.com/documentation/article.php/6
> what it mainly says is that code generation increases performance over
> runtime
> analysis of some model; eg. the database schema or perhaps some other
> representation, such as xml (or yaml [apparently ;)]).  the article also
> classifies
> ruby on rails as one of these obfusticators of fowlers original pattern;
> greg, thoughts ?

Yes, 6 years ago I analyzed the approaches of many these solutions that
analyze database schemas at run-time and cache the results . I concluded
that is not by far as efficient as a full code generation based solution.

A code generation based solution will generate code that does what is
necessary without any additional run-time libraries.

Those caching solutions still need to read cached information and
interpret what is cached. Not only they spend more time but also more
memory, especially if you need to load a pile of classes to load your
caching engine and run-time interpreter.

Another problem I found in those solutions is that often you need to
inherit from a fat base class that implements all sorts of functionality
that you may need at run-time to perform object-relational mapping
operations, even if your application objects do not need all that
functionality.

I concluded that it would be more efficient to generate root classes
that just include the functionality you have. For instance, if you do
not need to delete objects from you application, there is no sense in
having that functionality in your objects. The results is persistent
classes that do not inherit from fat base classes and are much thiner
and faster to load and execute.

Yet another problem of the solutions that defer mapping to runtime
libraries is the composition of queries with conditions that need to be
composed at run time.

I concluded that is much more efficient to have an object query language
 (OQL) that lets you define the conditions of your queries. These
queries are processed at compile time and the compiler generates
efficient SQL code that does not need to be composed at run time.

Your applications just call a single function to execute object queries
that satisfy the conditions that you defined. This results again is much
thiner and faster code that does *Just Exactly What You Need* (_JEWYN_).

All these details that I mentioned have been implemented by Metastorage,
which is an ORM code generation tool.

http://www.metastorage.net/

The generated code is very satisfying because it looks exactly like what
I would write if I had to do it manually, except that I did not have to
spend a lot time writing it. I just defined my business objects a simple
model file that describes the classes, relationships, validation rules,
and functions I need to manipulate those objects.

The compile time is measured in a few seconds. The time this tool took
to develop is paying more and more on every application feature I need
to implement but I do not need to waste hours or days coding the
persistent object classes.

There are more details about the Metastorage approaches to each problem
on the FAQ if you are interested:

http://www.meta-language.net/metastorage-faq.html


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Recommended ORM for PHP

2008-02-06 Thread Manuel Lemos
on 02/06/2008 11:10 AM js said the following:
> Hi list,
> 
> When creating a LAMP app, I always start by writing ORM myself.
> It's fun but it usually takes a  long time.
> Besides, that always results in a toy-system,
> I mean, that has not so many features, not so efficient non-bug-free.
> 
> I started to think that now is the time  to throw away my rubbish
> and use more effective Open source ORM.
> 
> So my  question is what ORM are you using?
> What ORM do you recommend?
> There're lots of Web app frameworks out there
> but I could't find simple ORM in PHP.

A similar question was asked here a couple of days ago.

I will be repeating myself, but what I said was that I use Metatsorage
which is an ORM class generator tool. It is a different approach than
others you may find. It generates persistent object classes that are
smaller and more efficient.

You may find more about Metastorage here:

http://www.meta-language.net/metastorage.html

Here you may find a small example application:

http://www.meta-language.net/metanews.html

Here you may see some screenshots of the Web user interface of the
generator tool and screenshots of the applications:

http://www.meta-language.net/screenshots.html

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: How could i do this on CURL?

2008-02-05 Thread Manuel Lemos
Hello,

on 02/05/2008 10:34 PM Louie Miranda said the following:
> I was able to create a working CURL connection and it was great.
> 
> Although, i have another problem.
> 
> 
>1. file: connect - I connect via a CURL to a URL and sends two
>parameters (application, just wait and hangs) -- this is intentional
>2. file: connect - Receives a reply of the two parameters that i had
>just sent
>3. file: connect - sends a XML post to the remote url (remote url,
>closes the connection and application)
> 
> Could i send two CURL request in one instance? while waiting?

I am not sure how to do that in a simple way with Curl. The few times I
have used Curl directly, I used custom HTTP requests instead of other
options.

Nowadays I use this HTTP client class that wraps the complexity of the
HTTP protocol and uses preferrably fsockopen to send HTTP requests. Take
a look the test_http_soap.php example which seems to do something
similar to what you want:

http://www.phpclasses.org/httpclient


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Doctrine vs. Propel

2008-02-04 Thread Manuel Lemos
Hello,

on 02/04/2008 04:44 PM AmirBehzad Eslami said the following:
> Dear List,
> 
> I've just heard of ORM (Object Relational Mapping) frameworks written for
> PHP.
> It seems that there are two major frameworks here: Doctrine and Propel:
> 
> http://www.phpdoctrine.org/
> http://propel.phpdb.org/trac/
> 
> I wonder which one is better? What is the difference between these?
> I'm talking about the learning curve, peroformance.
> What are the advantages/disadvantages of each one?

I cannot answer to your question because I have not tried any of those.
I use Metatsorage which is an ORM class generator tool. It is a
different approach which for me results in persistent object classes
that are smaller and more efficient.

You may find more about Metastorage here:

http://www.meta-language.net/metastorage.html

Here you may find a small example application:

http://www.meta-language.net/metanews.html

Here you may see some screenshots of the Web user interface of the
generator tool and screenshots of the applications:

http://www.meta-language.net/screenshots.html

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Effecient mass mailings

2008-02-04 Thread Manuel Lemos
Hello,

on 02/04/2008 02:22 PM Robert Fitzpatrick said the following:
> I a currently re-writing a web app from ASP to PHP and have come to the
> part where the app sends mass mailings to their customer base. This has
> always been problematic for them with the existing setup and I am
> looking for the best approach. While I've setup mailings with PHP, never
> such mass mailings. They will be using a web form to send sometimes
> 2-5MB attachments to thousands of customers to advertise new products
> with PDF's, etc. Using their Windows IIS SMTP virtual server smarthost
> function, I send their mail off-site to our postfix mail gateway, but it
> still bogs down and I'm sure a remote server is not the answer, but
> still better than the errors they receive trying to use localhost and
> IIS. Once the re-write, the app will be on to a Linux box where I can do
> some tweaking to these and hope localhost will work better for these
> mailings.
> 
> Can someone give some pointers at how I may want to approach such mass
> mailings? Thanks in advance!

Relaying messages to an SMTP server is a very slow solution, despite a
common belief otherwise.

If you are under Windows, there is a much better solutions if you have
Microsoft Exchange installed. You can just drop messages in the pickup
folder if you have the right permissions. Sending messages is just like
writing to a file.

You may want to take a look at this MIME message composing and sending
class. It comes with several delivery sub-classes, including one which
knows how to drop messages in the Exchange pickup folder.

Also, if your message bodies do not change for different recipients,
this class provides smart body caching support, so it does not waste
time regenerating the message body for every recipient.

If you can use these features, I am sure you can benefit of great mass
mailing performance boost:

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



Re: [PHP] We need PHP/LAMP Developers and Programmers in FL, MD, VA,NY, DC, CA, MA!!!!

2008-01-30 Thread Manuel Lemos
Hello,

on 01/30/2008 01:52 PM PHP Employer said the following:
> We need PHP/LAMP Developers and Programmers in FL, MD, VA, NY, DC, CA, MA
> 
> World NetMedia is a world class leader in the development of multimedia
> internet sites. We are seeking highly motivated individuals who eat, breath,
> and love the work they do. If you like working in a fun, laid-back, yet
> exciting environment; then we want to hear from you!

Have you looked at the PHP Professionals directory?

http://www.phpclasses.org/professionals/country/us/

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



[PHP] Re: Looking for easier way to build email message

2008-01-24 Thread Manuel Lemos
Hello,

on 01/24/2008 09:20 PM Rene Brehmer said the following:
> Drew a blank off the archive, so here goes...
> 
> I'm working on some forms for our company website, all of which simply have
> to be mailed to us by email.
> 
> After verifying that the content of all the fields is valid and the proper
> type, it builds the email message as following. This all works great, but I
> want a simpler/easier way to reuse the code (we have 3 forms, with
> distinctively different content, but the mail process remains the same), so
> something that will do the below, but can be reduced to something like
> grabbing a text file and fill in the blanks would be nice, instead of this:

As already been suggested by others, you may want to try the MIME
message class.

http://www.phpclasses.org/mimemessage

It seems that you want to send personalized messages to multiple
recipients. Usually you use a template and have it processed for each
recipient. The class above comes with two alternative examples for doing
that:

Using simple template string concatenation:
test_personalized_bulk_mail.php

or using Smarty templates:
test_smarty_personalized_mailing.php

-- 

Regards,
Manuel Lemos

PHP professionals looking for PHP jobs
http://www.phpclasses.org/professionals/

PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/

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



<    1   2   3   4   5   6   7   8   9   10   >