Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
php notify another php
Old 01-22-2009, 07:25 PM php notify another php
Novice Talker

Posts: 14
Name: Andy
Trades: 0
What is the best way for a php to call an external php file? I am using cakephp. I want to send out 2 or 3 emails after user registered. However, it takes a long time to send out the email. I want to spin another process to send email and return the UI right away.

What is the best way to do it? Do a system call out? Or use message queue? Or cron job?
__________________
TextLinksDepot.com -
Please login or register to view this content. Registration is FREE
andylaubobby is offline
Reply With Quote
View Public Profile Visit andylaubobby's homepage!
 
 
Register now for full access!
Old 01-22-2009, 09:11 PM Re: php notify another php
PeachyJuice's Avatar
Super Talker

Posts: 116
Name: Michele T.
Location: Ny, Ny
Trades: 1
Well you don't need to 'notify' another php file. Just add in the mail() function to whatever php script processes the form when a user registers

OR

If you mean send an email out to everyone who's registered you just use the mail() function in the form process.

I might not be interpreting what you mean correctly. If you could explain a bit more that would be helpful.
__________________
Freelance web+graphic designer and PHP developer.

Please login or register to view this content. Registration is FREE
PeachyJuice is offline
Reply With Quote
View Public Profile
 
Old 01-22-2009, 09:12 PM Re: php notify another php
Decaf's Avatar
Ultra Talker

Posts: 489
Name: Adam
Trades: 0
PHP Code:
# This is an example, it may/may not work for your situation.
# Please read this code and get an idea of what to do.
if ($userReged == true) { // If the user has registered
$userEmail "example@domain.com";
$msgType 'newUser';
     
email_user($userEmail,$msgType); // Call the function
}
function 
email_user($userEmail,$msgType) {
  if (
$msgType == 'newUser') { // If the email needs to be about a new user.
    
$msg "Thanks for registering, your password has been encrypted into our database and can not be unencrypted.";
  }
     
mail($userEmail,"Congrats on Registering",$msg,$headers);
flush(); // Ensure that the email has sent.
header("Location: thanks.html"); // Redirect

Something along those lines.

*Edit* Agh, peachy beat me */EDIT*
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE


Last edited by Decaf; 01-22-2009 at 09:13 PM..
Decaf is offline
Reply With Quote
View Public Profile Visit Decaf's homepage!
 
Reply     « Reply to php notify another php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.30155 seconds with 12 queries