[phorm] [Phorm:] Re: Cannot get DBFETCH to work with PHORM_TO

  • From: webbbs@xxxxxxxxx
  • To: support@xxxxxxxxx
  • Date: 9 Sep 2003 05:33:02 -0000

The following new message has been posted on Phorm Support Forum at 
<http://www.phorm.com/support/>. 

*************************************************************************** 

  MESSAGE:  (#3198) Re: Cannot get DBFETCH to work with PHORM_TO 
            <http://www.phorm.com/support/?rev=3198> 
  AUTHOR:   Patrick O'Hara 
  DATE:     September 9, 2003 at 1:33 a.m. EST 

  Reply To: (#3193) Cannot get DBFETCH to work with PHORM_TO 
  Author:   Julie 
  Date:     September 7, 2003 at 11:18 p.m. EST 

> $PHORM_MYDBV = "setdb.php"; 
> $PHORM_MYTABLE = "internal_email"; 
> $PHORM_DBFETCH = "Code, Email"; 
> $PHORM_TO = "$db_Email"; 
> $PHORM_TMPL = "email.txt"; 

Hi there, the problem is that the dbfetch is not actually carried out until 
later on in the execution of Phorm. What you are actually doing is setting 
PHORM_TO to a null string. Have a look at the documentation for dbfetch for 
syntax for referencing dbfetch variables - however this won't help you get 
what you want to do as it can't be done. 

If you are just trying to get the spambots to not find the addresses, you 
should remember that the config file is completely transparent. The PHP source 
code can not be seen. This is because there are no echo, print or similar 
statements in the config file to make the addresses appear in the browser. 
Only PHP will see the addresses. 

If you want multiple addresses, try something like 

$emailAddress['finance'] = 'finance@xxxxxxx'; 
$emailAddress['marketing'] = 'marketing@xxxxxxx'; 
$PHORM_TO = $emailAddress[$whichAddress]; 

....where whichAddress is the name of a select box or similar on the form, and 
the 'finance' or 'marketing' bit is the value of the appropriate option. 
This will pick the appropriate address out of the PHP array and us it in the 
email. 

It will also be a lot faster than doing a database lookup. 

Regards, 

Patrick O'Hara 
WhitsundayIT 
QLD, Australia 

patrick@xxxxxxxxxxxxxxxx 
www.whitsundayit.com 
www.vacationaustralia.com.au 

*************************************************************************** 

This is an automatically-generated notice.  If you'd like to be removed from 
the mailing list, please visit Phorm Support Forum at 
<http://www.phorm.com/support/>, or send your request to webbbs@xxxxxxxxxx  If 
you wish to respond to this message, please post your response directly to the 
board.  Thank you! 
-------------------------------------------------
You are receiving this message because you are subscribed to the Phorm mailing 
list. To send messages to the mailing list, simply send email to 
phorm@xxxxxxxxxxxxx from the address you have subscribed. You may unsubscribe 
from the list by sending email to phorm-request@xxxxxxxxxxxxx with 
'unsubscribe' in the SUBJECT field.

Other related posts: