0

I have a perl test.pl page that sends an email. The emails contains a link to an html page linkfromTest.html.

(Interchange is a web-based application framework written in Perl provided by the Interchange Development Group. Homepage: http://www.icdevgroup.org/i/dev)

But I have to use the result of the sql query from test.pl '$ref->{'outofstock_prod'}' is required in the linkfromTest.html page to run the sql query.

 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;"]    

Thanks in advance

rachel
  • 225
  • 2
  • 5
  • 16

1 Answers1

0

You might try setting a temp variable in the scratch space.

In test.pl:

$Tag->tmp('outofstock_prod');  # remove this when done
$Scratch->{outofstock_prod} = $ref->{outofstock_prod};

Then, in 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;"]

(I'm not sure what $ref is, or what its outofstock_prod field contains. If it's not a string, you may have to build a string out of it before sticking it in $Scratch.)

cHao
  • 84,970
  • 20
  • 145
  • 172