[PHP] can PHP talk to mail server?

2004-09-04 Thread See Kok Boon
Hi experts,

I would like to write a script to read mails directly from the mail server
and extracting the information, create custom auto-responders
automatically. Is this possible?

Can someone explain how the script can communicate with the mail server?

Thanks in advance!

Yours truly,
See Kok Boon
-
Web hosting plan offers continuous commission streams in a system possible
with zero advertising on your own. Sign up FREE now -
http://www.cashculture.com/CompensationPlan.asp?ref=kokboon

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



[PHP] wrapping PHP around a chinese web page

2003-12-03 Thread See Kok Boon
Hellox experts..

I am making a quiz for a Chinese website. the PHP I going to use is to be
wrapped together with the chinese character outputs all in a single file.
For an example...

In quiz.php

If(YOUR_ANSWER_IS_CORRECT)
{
print in chinese: you scored full marks //output
}
else
{
print in chinese: please try again //ouput
}

the outputs are Chinese characters.


The problem I have now is that either I can't output Chinese, or the code
doesn't work.

- I am developing this quiz on windows XP then uploading to Linux server.
- The code editor I use dun support any other formats than ANSI.
- MS WORD generates whole lot of rubbish for html documents and dun handle
PHPs
- Dreamweaver doesn't give me a clue on how to do it...
- so far notepad is the best. I can save the file as .php .html or .txt in
ANSI or UNICODE formats.

In notepad, I can input Chinese characters together with the PHP code
wrapped around. If I save in ANSI, the result online is that the code works,
but the output doesn't. if I save in Unicode, which notepad advices me to,
then the code cannot work and all the output regardless of the IF branches,
are output-ted. What else can I do?

The strange thing is that when in Unicode format, the PHP code doesn't show,
only the outputs are displayed.

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



[PHP] wrapping PHP around chinese characters

2003-12-03 Thread See Kok Boon
Hellox experts..

 

I am making a quiz for a Chinese website. the PHP I going to use is to be
wrapped together with the chinese character outputs all in a single file.
For an example...

 

In quiz.php

 

If(YOUR_ANSWER_IS_CORRECT)

{

  print in chinese: you scored full marks //output

}

else

{

  print in chinese: please try again //ouput

}

 

the outputs are Chinese characters.

 

 

The problem I have now is that either I can't output Chinese, or the code
doesn't work.

 

- I am developing this quiz on windows XP then uploading to Linux server.

- The code editor I use dun support any other formats than ANSI.

- MS WORD generates whole lot of rubbish for html documents and dun handle
PHPs

- Dreamweaver doesn't give me a clue on how to do it...

- so far notepad is the best. I can save the file as .php .html or .txt in
ANSI or UNICODE formats.

 

In notepad, I can input Chinese characters together with the PHP code
wrapped around. If I save in ANSI, the result online is that the code works,
but the output doesn't. if I save in Unicode, which notepad advices me to,
then the code cannot work and all the output regardless of the IF branches,
are output-ted. What else can I do?

 

The strange thing is that when in Unicode format, the PHP code doesn't show,
only the outputs are displayed.

 

 



[PHP] wrapping PHP around Chinese characters

2003-12-03 Thread See Kok Boon
Hellox experts..

 

I am making a quiz for a Chinese website. the PHP I going to use is to be
wrapped together with the chinese character outputs all in a single file.
For an example...

 

In quiz.php

 

If(YOUR_ANSWER_IS_CORRECT)

{

  print in chinese: you scored full marks //output

}

else

{

  print in chinese: please try again //ouput

}

 

the outputs are Chinese characters.

 

 

The problem I have now is that either I can't output Chinese, or the code
doesn't work.

 

- I am developing this quiz on windows XP then uploading to Linux server.

- The code editor I use dun support any other formats than ANSI.

- MS WORD generates whole lot of rubbish for html documents and dun handle
PHPs

- Dreamweaver doesn't give me a clue on how to do it...

- so far notepad is the best. I can save the file as .php .html or .txt in
ANSI or UNICODE formats.

 

In notepad, I can input Chinese characters together with the PHP code
wrapped around. If I save in ANSI, the result online is that the code works,
but the output doesn't. if I save in Unicode, which notepad advices me to,
then the code cannot work and all the output regardless of the IF branches,
are output-ted. What else can I do?

 

The strange thing is that when in Unicode format, the PHP code doesn't show,
only the outputs are displayed.

 



RE: [PHP] wrapping PHP around Chinese characters

2003-12-03 Thread See Kok Boon
I dun understand what you mean by line feeds.

When the file is in Unicode format, the web displays the Chinese characters
and when I view source, I can see all the PHP code. If quiz.php is treated
like a PHP file, then the PHP parser would not have allowed the PHP code to
show in source.

If quiz.php is treated like a txt file, the PHP code should show on screen.
Same goes if quiz.php is treated like HTML file (I suppose).

So.. what could be wrong? And how to fix it? Please help urgent... thanks in
advance! =`(

When file is in ANSI format, everything is fine except that the chinese
doesnÂ’t show... bad.

-Original Message-
From: Sophie Mattoug [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 03, 2003 10:35 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] wrapping PHP around Chinese characters

Would it be possible you have a problem with line-feeds while uploading 
from win ti linux ?

-- 
Cordialement,
---
Sophie Mattoug
DĂ©veloppement web dynamique
[EMAIL PROTECTED]
---

See Kok Boon wrote:

Hellox experts..

 

I am making a quiz for a Chinese website. the PHP I going to use is to be
wrapped together with the chinese character outputs all in a single file.
For an example...

 

In quiz.php

 

If(YOUR_ANSWER_IS_CORRECT)

{

  print in chinese: you scored full marks //output

}

else

{

  print in chinese: please try again //ouput

}

 

the outputs are Chinese characters.

 

 

The problem I have now is that either I can't output Chinese, or the code
doesn't work.

 

- I am developing this quiz on windows XP then uploading to Linux server.

- The code editor I use dun support any other formats than ANSI.

- MS WORD generates whole lot of rubbish for html documents and dun handle
PHPs

- Dreamweaver doesn't give me a clue on how to do it...

- so far notepad is the best. I can save the file as .php .html or .txt in
ANSI or UNICODE formats.

 

In notepad, I can input Chinese characters together with the PHP code
wrapped around. If I save in ANSI, the result online is that the code
works,
but the output doesn't. if I save in Unicode, which notepad advices me to,
then the code cannot work and all the output regardless of the IF branches,
are output-ted. What else can I do?

 

The strange thing is that when in Unicode format, the PHP code doesn't
show,
only the outputs are displayed.

 


  


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



RE: [PHP] wrapping PHP around Chinese characters

2003-12-03 Thread See Kok Boon
Thanks jason. Problems solved. Thanks. =)

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 04, 2003 12:19 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] wrapping PHP around Chinese characters

On Thursday 04 December 2003 00:09, See Kok Boon wrote:
 I dun understand what you mean by line feeds.

That should not have anything to do with your problem.

[snip]

 When file is in ANSI format, everything is fine except that the chinese
 doesn't show... bad.

Have you specified the correct encoding? -- either by using the HTTP header 
Content-Type: text/html; charset=BIG5 or an equivalent HTML meta-tag.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Appendix:
A portion of a book, for which nobody yet has discovered any use.
*/

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

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



[PHP] can mail() function send emails to any email account?

2003-12-03 Thread See Kok Boon
Hello.. it's me again.

Trying to use mail() function to send emails to hotmail accounts. It seems
that it's not working.

Tried the same function on my own email account, it worked.

Tried on some other, it doesn't.

What determines if the mail() function works?

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



[PHP] what is the OOP structure for PHP

2003-06-09 Thread See Kok Boon
Dear Experts,

 

 

Is there an OOP (object oriented programming) structure for PHP? If so,
could someone show me the basic structure of such an object? An exmple with
definition and implementation would be great. Thanks!

 

Yours sincerely,
Mr See Kok Boon

 



RE: [PHP] how to make server response to emails

2003-01-10 Thread See kok Boon
Thanks Michael!!

This process is something really new to me and sounds like there is much to
learn abt. Thanks for the guide.

Can I also request that you send the perl equivalent script that you have
written to me to [EMAIL PROTECTED] please? Thank you very, very
much =)


kokboon

-Original Message-
From: Michael Sims [mailto:[EMAIL PROTECTED]] 
Sent: 09 January 2003 11:49
To: [EMAIL PROTECTED]
Cc: See kok Boon
Subject: Re: [PHP] how to make server response to emails

On Thu, 9 Jan 2003 17:33:02 +0800, you wrote:

I believe
that there is a way to make the mail server, or which ever it is, to
response specifically to text within the mail.
[...]
However, I have no idea how this is accomplished and what this system is
called, so I need some precious help here. Anyone please?

99% of the time scripts such as this operate in the following manner.
Lets say the script responds to emails sent to [EMAIL PROTECTED]  The
server which handles mail for example.com has an alias for the address
foo which actually points to an external script.  Most MTA's will
allow you to do this (yes, even some for Windows, believe it or not).
For example, in sendmail you could place a line in /etc/aliases or
/etc/mail/aliases (depending on your installation) like the following:

foo:  |/usr/local/bin/myscript.php -s

This would cause sendmail to send the text of any email sent to foo
to myscript.php's stdin via a pipe.  (Be aware that some sites with
sendmail use the sendmail restricted shell, so there are some extra
steps involved in getting an alias like the above to work, which I
won't go into here).

myscript.php would need to be a PHP CLI script, meaning that it's
chmod'ed executable and has:

#!/usr/local/bin/php

at the top or something similar.  Then this script would have to read
from stdin and parse the text it receives via regexes or some other
method to determine how to handle it.  The script would receive the
full message, including all headers.

In PHP you can read from stdin by opening a filehandle to it:

$stdin = fopen('php://stdin', 'r');

Although in PHP 4.3.0 there are CLI specific constants defined which
obseletes the above.  For more info:

http://www.php.net/manual/en/features.commandline.php

I've implementing a script like this before, but unfortunately it's
written in Perl.  Many of the concepts are similar, though, so if you
know any Perl at all and think it may help you I can send it to you
off-list.

HTH...



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




RE: [PHP] how to make server response to emails

2003-01-10 Thread See kok Boon
Thanks! But your .txt are not carriage-returned, it just runs continuosly,
very hard to read. Is that you odd programming style or can you send me
another that has enter and newline?

Sorry for the trouble... sorry..

-Original Message-
From: Michael Sims [mailto:[EMAIL PROTECTED]] 
Sent: 10 January 2003 09:30
To: See kok Boon
Subject: Re: [PHP] how to make server response to emails

On Fri, 10 Jan 2003 18:51:07 +0800, you wrote:

Thanks Michael!!

Not a problem...

Can I also request that you send the perl equivalent script that you have
written to me to [EMAIL PROTECTED] please? 

I've attached the scripts.  The main one is vagent-admin.pl, and it
includes code from common.pl.  There's tons of stuff in there that
probably won't be of any interest, but take a look at the subroutine
parsemail that inside vagent-admin.pl.  Also, my coding standards
were fairly odd when I wrote this (lots of tabs) so apologizes if it's
hard to read.  If anything doesn't make sense let me know.


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




RE: [PHP] how to make server response to emails

2003-01-10 Thread See kok Boon

-Original Message-
From: Michael Sims [mailto:[EMAIL PROTECTED]] 
Sent: 10 January 2003 09:30
To: See kok Boon
Subject: Re: [PHP] how to make server response to emails

On Fri, 10 Jan 2003 18:51:07 +0800, you wrote:

Thanks Michael!!

Not a problem...

Can I also request that you send the perl equivalent script that you have
written to me to [EMAIL PROTECTED] please? 

I've attached the scripts.  The main one is vagent-admin.pl, and it
includes code from common.pl.  There's tons of stuff in there that
probably won't be of any interest, but take a look at the subroutine
parsemail that inside vagent-admin.pl.  Also, my coding standards
were fairly odd when I wrote this (lots of tabs) so apologizes if it's
hard to read.  If anything doesn't make sense let me know.


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




[PHP] how to make server response to emails

2003-01-09 Thread See kok Boon
Hi experts,

 

Seen this in many mailing list, but I do not know the logic behind it, hope
someone can spare some time to enlighten me.

 

Recall that many mailing list systems all users to send an email with the
word unsubscribe (or help or subscribe for that matter.) in the
subject line to allow the subscriber to unsubscribe, therefore I believe
that there is a way to make the mail server, or which ever it is, to
response specifically to text within the mail.

 

Besides using this for mailing list, I think the logic can also be used I
other areas such as specific response to QA etc.

 

However, I have no idea how this is accomplished and what this system is
called, so I need some precious help here. Anyone please?

 

Thanks in advance.. =)

 

Yours faithfully,

See Kok Boon

Realize Creations

http://www.RealizeCreations.com

---

looking for jobs? career? chat?

look in realPortal

 




RE: [PHP] how to make server response to emails

2003-01-09 Thread See kok Boon
To: Jason Wong 

Hi,

Sorry, I am abit dumb. Where is the archive that you refer to in your email?

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]] 
Sent: 09 January 2003 06:10
To: [EMAIL PROTECTED]
Subject: Re: [PHP] how to make server response to emails

On Thursday 09 January 2003 17:33, See kok Boon wrote:

 Seen this in many mailing list, but I do not know the logic behind it,
hope
 someone can spare some time to enlighten me.



 Recall that many mailing list systems all users to send an email with the
 word unsubscribe (or help or subscribe for that matter.) in the
 subject line to allow the subscriber to unsubscribe, therefore I believe
 that there is a way to make the mail server, or which ever it is, to
 response specifically to text within the mail.



 Besides using this for mailing list, I think the logic can also be used I
 other areas such as specific response to QA etc.



 However, I have no idea how this is accomplished and what this system is
 called, so I need some precious help here. Anyone please?

Most MTA systems can process mail through an arbitary program. Thus you can 
use a CLI version of PHP to process your mail. Search the archives for 
process email.

-- 
Jason Wong - Gremlins Associates - www.gremlins.biz
Open Source Software Systems Integrators
* Web Design  Hosting * Internet  Intranet Applications Development *

/*
Do not underestimate the power of the Force.
*/


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




RE: [PHP] how to make server response to emails

2003-01-09 Thread See kok Boon
To: [EMAIL PROTECTED]

Hi,

Erm.. actually I am not looking for a mailing list program, instead I am
looking for a program (preferably written in PHP) that would allow me to
capture emails containing specific text in its content and return specific
results according to the email content...

Any more clues for me?

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] 
Sent: 09 January 2003 06:02
To: See kok Boon
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] how to make server response to emails

Hello,

See kok Boon [EMAIL PROTECTED] wrote: 
 Hi experts,

Well, I'm no expert ;) so let me just tell you where you can find more info.

I think you're looking for something like what PHP's mailing list is using.
It's called ezmlm. Pls. check their site:

  http://www.ezmlm.org/

- E

...[snip]...

__
Do You Yahoo!?
Yahoo! BB is Broadband by Yahoo!  http://bb.yahoo.co.jp/


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




RE: [PHP] Re: how to make server response to emails

2003-01-09 Thread See kok Boon

To: Jean -Christian Imbeault

Thanks for helping out... I actually do not want a mailing list right now, I
already have one. What I need is to use the same concept for some other
email driven tasks.

After some searching using process email I realize I can use PHP to get
the emails and parse its contents much like a webmail system.

I am not sure, but I think I need and imap extension installed. From another
script, the programmer attempt to include the php_imap file, which I am not
sure what is it too...

Does anyone by any chance know whether imap is a must for retrieval of
emails or is it just like you say, extract files from the mail/username
folder?

Thanks in advance.


-Original Message-
From: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] 
Sent: 09 January 2003 06:01
To: [EMAIL PROTECTED]
Subject: [PHP] Re: how to make server response to emails

I'm not sure how it's done exactly but I think the basic concept is to 
have a daemon running, or have your program run by cron, and have the 
program collect it's mail.

On Linux I think you can get your mail simply by fetching and parsing 
the file /var/spool/mail/username, where username is the name of the 
account unsubscribe requests are mailed to.

But you want a mailing list, use major domo or some other ML spftware 
instead of writing your own.

Jc


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




RE: [PHP] PHP vs. ASP

2003-01-07 Thread See kok Boon
There is one minor difference that caused a major change in structure of the
two scripting language.

PHP offers the isset() function but ASP don't. in a way there are the pros
and cons.

For PHP, you can create the whole site in one page, even though that would
not be advisable. Because of isset(), you can get input and display output
using the same page. However, this would result in security loop holes.

Whereas for ASP, without the isset() keyword, ASP structures are usually
made up of at least 2 pages. One for receiving input and the other for
display the result, output. This of cos patches the security holes.

In a way, PHP provides a simpler way for programmer. Also, one can chose not
to use isset() !!

But ASP only supported on win platforms... =(



-Original Message-
From: Anthony Rodriguez [mailto:[EMAIL PROTECTED]] 
Sent: 04 January 2003 10:50
To: [EMAIL PROTECTED]
Subject: [PHP] PHP vs. ASP

Hi!
How does PHP differs from ASP?

Are there any advantages in using PHP over ASP? Or the other way around?

Thanks!



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




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




[PHP] FW: checking bounce email

2002-12-18 Thread See kok Boon
 

Hi,

 

Can someone kindly teach me how to check for bounced emails when I use
mail() to send emails?

 

OR

 

Tell me whether there are other mail functions which can accomplish
that.

 

Thanks in advance

 

kokboon




RE: [PHP] how to send an MSWORD email?

2002-12-15 Thread See kok Boon
Hi jonathan,

Just to let you know, there is no image in
an html email with an image - img src=cid:abc123; 

in you last email replying to this same subject. Maybe you should check
again?

But thanks for you reply anyway. I got my answer at pear.php.net. also,
thanks to Jason wards

Cheers.

-Original Message-
From: Jonathan Sharp [mailto:[EMAIL PROTECTED]] 
Sent: Monday, December 16, 2002 10:04 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] how to send an MSWORD email?

search google for RFC HTML email, or look at phpmailer.sourceforge.net. 

It's roughly along the lines of: 

Headers...
Subject: My html email
Content-type: multipart/mime
Content-boundry(): BOUNDRY-ABC

---BOUNDRY-ABC---
Content-type: text/html
...more headers...

Hello! This is an html email with an image - img src=cid:abc123;


---BOUNDRY-ABC---
Content-type: image/jpeg
Content-id: abc123
Content-encoding: base64

BKJSDFIWEIJELFJSELIFJEL


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




[PHP] how to send an MSWORD email?

2002-12-13 Thread See Kok Boon
Hi experts,

 

I have an email database which I want to send out newsletter to. I want to
send emails that have graphics, for example the pub logo. I know that there
are 2 ways to do so (maybe there are more, pls enlighten me):

 

1.  use html email with img src=http://www.mydomain.com/logo.gif;

 

2.  use MSWORD to insert the logo into the email. MSWORD will then send
the logo.gif as an attachment and will ALSO use img tags.

 

Due to web space concerns, I cannot point the img source to the http
location of the logo.gif, thus I have to use attachments. However, I only
know how to include the logo.gif using MSWORD emails (currently using
outlook xp), this in turn gives me another problem: how do I send the email
created in MSWORD to the emails I have in the database using PHP?

 

Please teach me one of the following methods:

1.  create an email with the same logic as MSWORD does, so that I can
use a web interface to create the email then send the logo.gif as an
attachment.

 

2.  send the code to send MSWORD emails not as a document attachment to
ANOTHER email, but an email itself.

 

3.  some other better methods.

 

 

I really need to know this urgently, Thanks in advance.




[PHP] getting mysql dump using php

2002-11-24 Thread See Kok Boon
hi Rich,

yes think i need more info to the mysqldump utility. i suppose you mean
there is in fact this utility?

-Original Message-
From: Rich Gray [mailto:[EMAIL PROTECTED]]
Sent: Sunday, November 24, 2002 8:14 PM
To: See Kok Boon; PHP
Subject: RE: [PHP] getting mysql dump using php


Answer is No. 2)

Use cron to run the mysqldump utility instead of a php script.
Let me know if you need more info.

Cheers
Rich





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




[PHP] getting mysql dump using php

2002-11-24 Thread See Kok Boon
thanks Morgan,

i am sure your script will do a great job... unfortunately, crontab returns
/bin/mail permission denied... and i cant chage system settings because i am
not the WSP (or ISP)

actually... i am thinking of something really silly.. but it will work
surely... and that is to use SELECT * then use a loop to format the
results into a database dump (data and structure) and then email the content
to myself. how's that?

-Original Message-
From: Morgan Hughes [mailto:[EMAIL PROTECTED]]
Sent: Sunday, November 24, 2002 12:35 PM
To: PHP
Subject: RE: [PHP] getting mysql dump using php


On Sun, 24 Nov 2002, Rich Gray wrote:

 Answer is No. 2)
 Use cron to run the mysqldump utility instead of a php script.
 Let me know if you need more info.

  I use this one with crontab, it works pretty well, if your email program
  can handle uuencode:


#!/bin/sh
# File: db_backup.sh
# Descript: Runs a ful mysqldump of one or more MySQL databases, uuencodes
#   and compresses them, and mails them to a specified address.
#   Requires mysqldump, gzip, uuencode, mail or mailx, and crontab.
#
#   Normally this run from crontab, with an entry like:
# 0 3 * * * sh ~/db_backup
#
# Version : 1.00
# Author  : Morgan Hughes ([EMAIL PROTECTED])
# License : Copyright (C) 2002, Morgan Hughes.  Use freely.


# Account/password/email info
db_list=your_database
db_user=your_username
db_pass=your_password
email=your_email_addy

# program locations
mysqldump=mysqldump
dump_opts=
uuencode=uuencode
gzip=gzip
mail=mail

# Actual code
for db_name in $db_list ; do

date=`date '+%Y%m%d-%H%M%S'`
$mysqldump $dump_opts -u $db_user --password=$db_pass $db_name | \
$gzip -c9 | $uuencode $db_name-$date.sql.gz | \
$mail -s DB backup, $db_name, $date $email

done

# Ends: db_backup.sh



  At home I have a script plugged into .procmailrc with an entry like:

# First off, catch inbound automated backups.
:0
* ^Subject: DB backup, kyhm
| ~/bin/catch_backup ~/kyhm.com/backups/db



  The ~/bin/catch_backup script is as follows:

#!/bin/sh
if [ $1 !=  -a -d $1 ] ; then
cd $1
else
cd ~
fi
cat | uudecode



  Hope this is useful...

--
   Morgan Hughes
   C programmer and highly caffeinated mammal.
   [EMAIL PROTECTED]
   ICQ: 79293356



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




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




[PHP] getting mysql dump using php

2002-11-24 Thread See Kok Boon
thanks Edwin!!

oki... now that i can create the dump, i'll just use lynx from crontab to
send the dump as attachment to my email. thanks!

-Original Message-
From: @ Edwin [mailto:[EMAIL PROTECTED]]
Sent: Sunday, November 24, 2002 9:24 PM
To: See Kok Boon
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] getting mysql dump using php


Hello,

...seems like Rich is not available yet so let me try :)

See Kok Boon [EMAIL PROTECTED] wrote:

 hi Rich,

 yes think i need more info to the mysqldump utility. i suppose you mean
 there is in fact this utility?

Well, most probably you'll be able to find it inside your mysql/bin
directory.

Check the manual for more info:

  http://www.mysql.com/doc/en/mysqldump.html

And of course you can google for some related info ;)

  http://www.google.com/search?hl=enie=UTF-8oe=UTF-8q=mysqldump

HTH,

- E



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




[PHP] getting mysql dump using php

2002-11-23 Thread See Kok Boon
hi,

can anyone tell me how to make auto backups of mysql databases?

i have a particular database that i want to backup everyday. what i can
think of now is to use crontab to execute a .php that will do the work, then
send the db schema (dump) via email every midnight.

however, i do not know the code to GET THE DUMP of the mysql db.

i know that i can be done because phpAdmin from sourceforge.net has the
export feature, which does what i want, except that i cannot execute the
hyperlink there using crontab.

can someone tell me:
1. what is the php code for getting the schema?
2. what is an alternatively BETTER way to backup?

thanks in advance

Yours sincerely,
See Kok Boon
-
looking for - jobs? career? customer?
look in realPortal!
http://realportal.realizecreations.com


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




[PHP] what is the PHP equivalent of Transactional ASP page

2002-11-17 Thread See Kok Boon
hi people,

just want to know if there such a thing as a Transactional PHP Page and who
do i go about setting up a page like this?

for those who don't know about ASP, a Transactional ASP page is able to
reverse its operations. it is used mainly in ecommerce, in a page where the
transaction is carried out.

the reason for this is so that if for example,

you click checkout to buy a downloaded software - the software removed from
shopping cart - money is deducted from your credit card - the download
page appears - the lightning strikes - your internet connection gone -
the download page expires ...

if i don't use a Trasactional Page, i will keep the money without having to
give my customer the software, which is good!!! lol but not for my customer.
so the Transactional Page will then detect that the lightning has striked...

... - transactional page realize that the transaction is not completed -
the money is returned to the credit card - the software back to the
shopping cart - i wait for the customer to fix the computer and return

And that is a transactional page. so can i also do that in PHP?

Yours sincerely,
See Kok Boon
Realize Creations
http://www.realizecreations.com
---
looking for - jobs? career? customer?
look in realPortal!
http://realportal.realizecreations.com


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