php-general Digest 13 Apr 2010 15:27:01 -0000 Issue 6690

Topics (messages 304021 through 304030):

Re: Mail Function Problem
        304021 by: Karl DeSaulniers
        304022 by: kranthi
        304024 by: Ashley Sheridan
        304025 by: Alice Wei
        304026 by: Ashley Sheridan

Re: Solution
        304023 by: Nathan Rixham

Saving form data into session  before leaving a page
        304027 by: Merlin Morgenstern
        304028 by: Peter Lind
        304029 by: Ashley Sheridan
        304030 by: Paul M Foster

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hey Alice,
Try throwing the MIME in. Sometimes messages get thrown in an abyss if they don't know the MIME version or content type of an email. They think its spam and so you wouldn't get an error message on your end. Just no email.

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";

Karl


On Apr 12, 2010, at 10:24 PM, Alice Wei wrote:


From: kranthi...@gmail.com
Date: Tue, 13 Apr 2010 07:41:19 +0530
Subject: Re: [PHP] Mail Function Problem
To: aj...@alumni.iu.edu
CC: k...@daleco.biz; php-gene...@lists.php.net

thats weired...
Mail.php contains the class Mail. So getting a "class not found" error
is not possible... (require_once stops the script in case it can't
find Mail.php)
Do I need to move the Mail PEAR class to the same folder as my web folder
ensure that C:/xampp/php/PEAR folder is added to your include list

I thought so too, this is what I have in my php.ini:

; PHP's default setting for include_path is ".;/path/to/php/pear"
; http://php.net/include-path
include_path = ".;C:\xampp\php\PEAR"

This is the contents of my C:\xampp\php\PEAR\Mail:
mail.php
mime.php
mimeDecode.php
mimePart.php
null.php
RFC822.php
sendmail.php
smtp.php

Unless, I have to do require_once("mail.php")?
I am getting confused.

Alice

                                        
_________________________________________________________________
Hotmail is redefining busy with tools for the New Busy. Get more from your inbox. http://www.windowslive.com/campaign/thenewbusy? ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_2

Karl DeSaulniers
Design Drumm
http://designdrumm.com


--- End Message ---
--- Begin Message ---
when you install pear package Mail a file called Mail.php will be
installed into C:/xampp/php/PEAR
>> Mail.php contains the class Mail. So getting a "class not found" error is 
>> not possible..
are you sure you are doing require_once 'Mail.php' ?

--- End Message ---
--- Begin Message ---
On Mon, 2010-04-12 at 12:25 -0400, Alice Wei wrote:

> 
> 
> 
> 
> 
> > Date: Mon, 12 Apr 2010 11:09:42 -0500
> > From: k...@daleco.biz
> > To: aj...@alumni.iu.edu
> > CC: a.bovane...@gmail.com; php-gene...@lists.php.net
> > Subject: Re: [PHP] Mail Function Problem
> > 
> > Alice Wei wrote:
> > >> Hi!
> > >> You have the following php.ini params:SMTP = smtp.live.com
> > >> 
> > >> smtp_port = 587
> > >> live.com not support relay and it requires authentication.
> > > 
> > > Is there an email account that I could try? I thought 
> >  > most email accounts requires authentication anyway.
> > 
> > Well, "therein lies the rub," as the Bard said (maybe).
> > PHP's mail() was built on a general assumption that
> > there would be a local SMTP server.  It supports remote
> > SMTP, but I'm not aware of any ability to do SMTP auth,
> > even in the PEAR packages.
> > 
> > You might just wanna read up on mail in general.  The
> > php.net/mail page lists several relevant RFC's, and
> > has links to most of the PEAR mail classes, etc.
> > 
> > You should definitely read up on live.com's email
> > configuration.  If they use SMTP auth, I'm not sure
> > you can do this (per above).  If it uses, say, "POP
> > before SMTP" for authorization, you might be able to
> > hack something together with the PHP IMAP functions, or
> > even sockets, but you're getting into a big lotta work
> > for what seems a small thing.
> > 
> 
> This is what I am talking about. 
> Two years ago when I first set up my own server with Linux and not Windows, I 
> never had to deal with this. 
> Perhaps the authentication has since then got stricter, but it should not be 
> so much of a heck of a deal. 
> 
> I found this doc from ATT's website, 
> http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf, so obviously the 
> smtp server I provided earlier is probably not up to date. 
> 
> I think I will fiddle around with the php.ini file and see what else is 
> there. 
> Thanks.
> 
> Alice
>                                         
> _________________________________________________________________
> Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1


Linux installations come with sendmail which allows you to send email
directly. Windows doesn't have this as part of the base setup, but I
believe if you can install a local mail server then this should fix the
issue.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---

Subject: RE: [PHP] Mail Function Problem
From: a...@ashleysheridan.co.uk
To: aj...@alumni.iu.edu
CC: k...@daleco.biz; a.bovane...@gmail.com; php-gene...@lists.php.net
Date: Tue, 13 Apr 2010 13:19:15 +0100






  
  


On Mon, 2010-04-12 at 12:25 -0400, Alice Wei wrote:






> Date: Mon, 12 Apr 2010 11:09:42 -0500
> From: k...@daleco.biz
> To: aj...@alumni.iu.edu
> CC: a.bovane...@gmail.com; php-gene...@lists.php.net
> Subject: Re: [PHP] Mail Function Problem
> 
> Alice Wei wrote:
> >> Hi!
> >> You have the following php.ini params:SMTP = smtp.live.com
> >> 
> >> smtp_port = 587
> >> live.com not support relay and it requires authentication.
> > 
> > Is there an email account that I could try? I thought 
>  > most email accounts requires authentication anyway.
> 
> Well, "therein lies the rub," as the Bard said (maybe).
> PHP's mail() was built on a general assumption that
> there would be a local SMTP server.  It supports remote
> SMTP, but I'm not aware of any ability to do SMTP auth,
> even in the PEAR packages.
> 
> You might just wanna read up on mail in general.  The
> php.net/mail page lists several relevant RFC's, and
> has links to most of the PEAR mail classes, etc.
> 
> You should definitely read up on live.com's email
> configuration.  If they use SMTP auth, I'm not sure
> you can do this (per above).  If it uses, say, "POP
> before SMTP" for authorization, you might be able to
> hack something together with the PHP IMAP functions, or
> even sockets, but you're getting into a big lotta work
> for what seems a small thing.
> 

This is what I am talking about. 
Two years ago when I first set up my own server with Linux and not Windows, I 
never had to deal with this. 
Perhaps the authentication has since then got stricter, but it should not be so 
much of a heck of a deal. 

I found this doc from ATT's website, 
http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf, so obviously the 
smtp server I provided earlier is probably not up to date. 

I think I will fiddle around with the php.ini file and see what else is there. 
Thanks.

Alice
                                          
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1




Linux installations come with sendmail which allows you to send email directly. 
Windows doesn't have this as part of the base setup, but I believe if you can 
install a local mail server then this should fix the issue.

Something like http://www.hmailserver.com/? I use AT&T, why is it that I use 
their SMTP server and my From address in PHP.ini file didn't work?

Thanks. 

Alice






Thanks,sh

http://www.ashleysheridan.co.uk







                                          
_________________________________________________________________
Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1

--- End Message ---
--- Begin Message ---
On Tue, 2010-04-13 at 08:59 -0400, Alice Wei wrote:

> 
> Subject: RE: [PHP] Mail Function Problem
> From: a...@ashleysheridan.co.uk
> To: aj...@alumni.iu.edu
> CC: k...@daleco.biz; a.bovane...@gmail.com; php-gene...@lists.php.net
> Date: Tue, 13 Apr 2010 13:19:15 +0100
> 
> 
> 
> 
> 
> 
>   
>   
> 
> 
> On Mon, 2010-04-12 at 12:25 -0400, Alice Wei wrote:
> 
> 
> 
> 
> 
> 
> > Date: Mon, 12 Apr 2010 11:09:42 -0500
> > From: k...@daleco.biz
> > To: aj...@alumni.iu.edu
> > CC: a.bovane...@gmail.com; php-gene...@lists.php.net
> > Subject: Re: [PHP] Mail Function Problem
> > 
> > Alice Wei wrote:
> > >> Hi!
> > >> You have the following php.ini params:SMTP = smtp.live.com
> > >> 
> > >> smtp_port = 587
> > >> live.com not support relay and it requires authentication.
> > > 
> > > Is there an email account that I could try? I thought 
> >  > most email accounts requires authentication anyway.
> > 
> > Well, "therein lies the rub," as the Bard said (maybe).
> > PHP's mail() was built on a general assumption that
> > there would be a local SMTP server.  It supports remote
> > SMTP, but I'm not aware of any ability to do SMTP auth,
> > even in the PEAR packages.
> > 
> > You might just wanna read up on mail in general.  The
> > php.net/mail page lists several relevant RFC's, and
> > has links to most of the PEAR mail classes, etc.
> > 
> > You should definitely read up on live.com's email
> > configuration.  If they use SMTP auth, I'm not sure
> > you can do this (per above).  If it uses, say, "POP
> > before SMTP" for authorization, you might be able to
> > hack something together with the PHP IMAP functions, or
> > even sockets, but you're getting into a big lotta work
> > for what seems a small thing.
> > 
> 
> This is what I am talking about. 
> Two years ago when I first set up my own server with Linux and not Windows, I 
> never had to deal with this. 
> Perhaps the authentication has since then got stricter, but it should not be 
> so much of a heck of a deal. 
> 
> I found this doc from ATT's website, 
> http://helpme.att.net/pdf/uverse/uverse_hsi_qsg_english.pdf, so obviously the 
> smtp server I provided earlier is probably not up to date. 
> 
> I think I will fiddle around with the php.ini file and see what else is 
> there. 
> Thanks.
> 
> Alice
>                                         
> _________________________________________________________________
> Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1
> 
> 
> 
> 
> Linux installations come with sendmail which allows you to send email 
> directly. Windows doesn't have this as part of the base setup, but I believe 
> if you can install a local mail server then this should fix the issue.
> 
> Something like http://www.hmailserver.com/? I use AT&T, why is it that I use 
> their SMTP server and my From address in PHP.ini file didn't work?
> 
> Thanks. 
> 
> Alice
> 
> 
> 
> 
> 
> 
> Thanks,sh
> 
> http://www.ashleysheridan.co.uk
> 
> 
> 
> 
> 
> 
> 
>                                         
> _________________________________________________________________
> Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox.
> http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1


That looks to do what you need. I don't really know of any specific
other examples as it's been a while since I've used Windows for anything
now. The link you gave did say it was free though, so you don't really
have anything to lose by installing it.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
Gary wrote:
> For those that were looking to see a solution

[snip]

If anybody really wants to know how to handle this, (it's not officially
supported by PHP, but is in MySQL 5.1+, and I'm not condoning it) here's
how you do it:

<?php

// enable C API support for multiple statement execution
// note the 65536 flag
$connection = mysql_connect( $host, $user , $password , true , 65536 );

// select the database
mysql_select_db( 'test' , $connection );

// line up multiple queries separated by a semicolon (;)
$query1 = "DROP TABLE IF EXISTS test_table;
           CREATE TABLE test_table(id INT);
           INSERT INTO test_table VALUES(10);
           UPDATE test_table SET id=20 WHERE id=10;";

// run the multi-query (should output bool(true) on success)
var_dump( mysql_query( $query1 , $connection ) );

// big caveat!, the connection will die so we need to reconnect..
$connection = mysql_connect( $host, $user , $password , true , 65536 );
mysql_select_db( 'test' , $connection );

// now a quick test to verify
$test_result = mysql_query( "SELECT * FROM test_table" , $connection );
$result_rows = mysql_num_rows( $test_result );
if ($result_rows == 0) {
  throw new Exception( 'we failed' );
}
for ($r=0;$r<$result_rows;$r++) {
   print_r( mysql_fetch_assoc( $test_result ) );
}
mysql_free_result( $test_result );

?>


Probably worth somebody investigating this further and seeing how it
works with mysqli etc (unsure if mysqli users mysql_connect or
mysql_real_connect at the C API level.)

Regards,

Nathan

http://dev.mysql.com/doc/refman/5.1/en/c-api-multiple-queries.html


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

I have form where users enter data to be saved in a db.

How can I make php save the form data into a session before the user leaves the page without pressing the submit button? Some members leave the page and return afterwards wondering where their already entered data is.

Any ideas how to save into php session data before someone leaves the page?

Thank you for any hint,

Merlin

--- End Message ---
--- Begin Message ---
On 13 April 2010 15:20, Merlin Morgenstern <merli...@fastmail.fm> wrote:
> Hello everybody,
>
> I have form where users enter data to be saved in a db.
>
> How can I make php save the form data into a session before the user leaves
> the page without pressing the submit button? Some members leave the page and
> return afterwards wondering where their already entered data is.
>
> Any ideas how to save into php session data before someone leaves the page?

Use ajax: send a query to the server a couple of seconds after the
user has last updated the form.

> Thank you for any hint,
>
> Merlin
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
<hype>
WWW: http://plphp.dk / http://plind.dk
LinkedIn: http://www.linkedin.com/in/plind
Flickr: http://www.flickr.com/photos/fake51
BeWelcome: Fake51
Couchsurfing: Fake51
</hype>

--- End Message ---
--- Begin Message ---
On Tue, 2010-04-13 at 15:20 +0200, Merlin Morgenstern wrote:

> Hello everybody,
> 
> I have form where users enter data to be saved in a db.
> 
> How can I make php save the form data into a session before the user 
> leaves the page without pressing the submit button? Some members leave 
> the page and return afterwards wondering where their already entered 
> data is.
> 
> Any ideas how to save into php session data before someone leaves the page?
> 
> Thank you for any hint,
> 
> Merlin
> 


Session data is all stored on the server, so it requires a submit in
order for the server to actually get the data.

You could use Ajax to grab the form data and send it to the server if
you need though.

However, I'm not really sure what your question is. Are people visiting
your site, filling in a form, then pressing the back button to go
somewhere else? If so, maybe they intended to not submit the form.

Thanks,
Ash
http://www.ashleysheridan.co.uk



--- End Message ---
--- Begin Message ---
On Tue, Apr 13, 2010 at 03:20:23PM +0200, Merlin Morgenstern wrote:

> Hello everybody,
>
> I have form where users enter data to be saved in a db.
>
> How can I make php save the form data into a session before the user
> leaves the page without pressing the submit button? Some members leave
> the page and return afterwards wondering where their already entered
> data is.

I hate to be a contrarian (not really), but there is a paradigm for
using web forms. If you want the internet to save your data, you have to
press the little button. If you don't, then it won't be saved. Not hard
to figure out, not hard to do. If you have to go do something else while
you're in the middle of a form, open a new tab/window and do it. When
you come back to your original form, the data will still be there (but
again, not *saved* until you hit the little button).

Sorry, I just get cranky with people who won't follow the rules.

Paul

-- 
Paul M. Foster

--- End Message ---

Reply via email to