Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Passing perl vars into asp

Status
Not open for further replies.

tarn

Technical User
Aug 19, 2001
534
GB
Hi all,
Any idea how I pass variables from perl into an ASP code snippet with in a pl file ?


++++ Start Script ++++++++++++++++++++++++++++++++++++++
# script to send feedback
#
#

use CGI;

print("Content-type: text/html\n\n");

my($name, $email, $comments, $helper);

my $q = new CGI;

$name = $q->param('name');
$email = $q->param('email');
$comments = $q->param('comments');
$helper = $q->param('helper');

$remote_addr = $ENV{'REMOTE_ADDR'};

$recipiant = 'tarn@something.com';

$date = scalar localtime();
chop $date;

print &quot;name\t$name<br> \n&quot;;
print &quot;email:\t\t$email<br> \n&quot;;
print &quot;comments?\t$comments<br> \n&quot;;
print &quot;Helper?\t\t$helper<br> \n&quot;;
print &quot;\n<br>&quot;;
print &quot;IP\t\t\t$remote_addr\n<br>&quot;;

print &quot;\n<br>&quot;;
print &quot;Report entered on $date<br> \n&quot;;

print &quot;<HTML>&quot;;
print &quot;<HEAD>&quot;;
print &quot;<TITLE>OUTPUT</TITLE>&quot;;
print '<link REL=stylesheet HREF=&quot; TYPE=&quot;text/css&quot;>';

print &quot;</head>&quot;;


print &quot;<body>&quot;;

print &quot;<H2>Feedback Form Confirmation</H2>&quot;;

print &quot;<% \@LANGUAGE = VBScript %>&quot;;
print &quot;<% Option Explicit Dim myMail Set myMail = Server.CreateObject('CDONTS.NewMail')&quot;;
print &quot;MyMail.Send '$recipiant,$email', _&quot;;
print &quot;'Subscription Form', '$comments', 0 &quot;;
print &quot;Set myMail = Nothing %>&quot;;

print &quot;<P>Your feedback was sent to tarns asp on $date</P>&quot;;

print &quot;</body>&quot;;
print &quot;</HTML>&quot;;
++++ END SCRIPT ++++++++++++++++++++++++++++++++
 
If the HTML and ASP are output of the Perl script, then you need your server to parse the file as Perl first, then that output would be parsed as an ASP script. I've never done that before, but I'm sure it could be done.

Would have to be some sort of clever server configuration.

--jim
 
Coderifous,
Cheers for that, darm! I thought that might be the case because I am pasing the vars ok now (I can see that from &quot;view source&quot; on the output from the .pl) but nothing happens with the asp code (by that I mean it dose not send a mail as I would expect it to ..... Ah ! that's because its wrapped in a .pl and not in an .asp which is what the IIS is waiting for .... doh ! what a div-head).

Again cheers for that, at least it made me think what I was doing.

(Hmm.. I'm sure I could work around this some how ... Hmmm .........)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top