我有一个发送电子邮件的perl test.pl页面。电子邮件包含到html页面linkfromTest.html的链接。
(Interchange是一个用Perl编写的基于web的应用程序框架,由Interchange Development Group提供。主页:http://www.icdevgroup.org/i/dev)
但是我必须使用test.pl的sql查询结果'$ref->{'outofstock_prod'}‘在linkfromTest.html页面中运行sql查询。
test.pl
$sql = "select OS.id,OS.name,OS.date,OS.customer_email,OS.product as outofstock_prod,OS.salesperson_email,OS.salesperson
from outofstock_sku as OS
where mail_sent='0'
order by OS.id";
$ref->{'outofstock_prod'}
......
......
print MAIL "More items potentially matched.\n\n";
print MAIL "Click here to view more items : http://qqq.qqqq.com/linkfromTest.html\n\n";
.....
linkfromTest.html
[query list=1 sql="select P.sku,P.manufacturer,P.category,P.scat,P.description,P.imgid
from
products AS P LEFT JOIN inventory AS I
ON (I.sku = P.sku AND I.status = 'A')
WHERE P.manufacturer LIKE '$ref->{'outofstock_prod'}''
LIMIT 0,4;"] 提前感谢
发布于 2012-11-17 13:25:36
您可以尝试在临时空间中设置temp变量。
在test.pl中:
$Tag->tmp('outofstock_prod'); # remove this when done
$Scratch->{outofstock_prod} = $ref->{outofstock_prod};然后,在linkFromTest.html中:
[query list=1 sql="select P.sku,P.manufacturer,P.category,P.scat,P.description,P.imgid
from
products AS P LEFT JOIN inventory AS I
ON (I.sku = P.sku AND I.status = 'A')
WHERE P.manufacturer LIKE '[scratch outofstock_prod]'
LIMIT 0,4;"](我不确定什么是$ref,也不知道它的outofstock_prod字段包含什么。如果它不是字符串,那么在将其粘贴到$Scratch中之前,您可能需要用它构建一个字符串。)
https://stackoverflow.com/questions/9289109
复制相似问题