Anyone Know CGI/Perl - i need help please?

free web hosting
Open Discussion > General > Hosted Members Area

Anyone Know CGI/Perl - i need help please?

Trystim
If anyone knows cgi/perl would like to contact me and help with a simple send mail problem lol *cuz i have no clue* please feel free or post here but messenger probably better

yahoo is p00l_dem0n77
msn is p00l_dem0n77@hotmail.com
icq is 255-051-386)


thanks in advance

Reply

mobileunlocking
why not go to hotscripts.com they have some good help they can offer you.

they do all kinds of stuff like flash and dhtml html php and lots more.

Worth trying out.

Mick

Reply

Trystim
it isn't a script I need it is how to set it up that i need

Reply

riao
I may be of some assistance... what is the script and the problem you're having? (Be as detailed as possible).

Reply

Trystim
CODE
#!/usr/local/bin/perl
# NOTE- on above line- your path to PERL could be different!
# If you're not sure, check with your web host.
# NOTE- again, your path to sendmail could be different
$mailprog = "/usr/lib/sendmail";
# NOTE- this is where you want the email sent to.
# Be sure and "escape" the "@" sign.
$recipient = "sitemail@timsmed.com";
# get the input
# put it in $buffer
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# split the input into name-value pairs
@pairs = split(/&/, $buffer);
# standard processing loop
# this will un-URLencode as many variables as you send and place
# in an array ($FORM).
foreach $pair (@pairs) {
# split the name-value pair into name and value
($name, $value) = split(/=/, $pair);
# convert '+' to space
$value =~ tr/\+/ /;
# convert embedded comma to space delimiting purposes
$value =~ tr/\,/ /;
# convert hex symbols to alphanumeric
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("c", hex($1))/ge;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("c", hex($1))/ge;
$value =~ s/<!--(.|\n)*-->//g;
# create new array with each name and value as elements
$FORM{$name} = $value;
}
# now assign a variable name to each value from the input array
$NAME = $FORM{'name'};
$EMAIL = $FORM{'email'};
$SUBJECT = "Web Site Inquiry";
$MESSAGE = $FORM{'message'};
# next we have to re-URLencode any values being sent back to flash.
# for my contact form I'm only going to send the name.
$NAME =~ tr/ /\+ /;
# this assigns a "name" to our name/value pair being sent
# and sends it back to flash through the standard output stream.
# be sure and note the content type!
print "Content-type: application/x-www-urlform-encoded\n\n";
print  "rtn_name=$NAME";
# now we open a stream to "sendmail" and send the email
# using the variables from above.
open (MAIL, "|$mailprog $recipient") || die "Can't open $mailprog!\n";
print MAIL "To: $recipient\n";
print MAIL "From:$EMAIL\n";
print MAIL "Subject: $SUBJECT\n";
print MAIL "------------------------------------------------------\n";
print MAIL "$MESSAGE\n\n";
print MAIL "$NAME\n";
close (MAIL);
exit;


that is my perl code that i have in my cgi folder.

here is the form that wont send or submit done in flash
form for submit
and you can download the fla here appx 2 megs
Righ Click Save As

that is about as specific as i can get. Let me know if you have an questions.

 

 

 


Reply

riao
1st line (path to perl) should be:

#!/usr/bin/perl

path to sendmail should be:

$mailprog = "/usr/sbin/sendmail";

(At least the above is true for my account.. I assume yours would be the same. It would only be different if our accounts resided on different servers. This info can be found in your cpanel).

Make sure $recipient = your email address

make sure the file is chmodded to 755 in the cgi bin.

Sorry, I cannot open the fla file here. I don't have flash installed on my system. Would you be able to give me a mock-up html form i could i could see?

One thing that you could look for is ACTION of the form contains the url of this file, and the method = POST.. like this:
<form ACTION="http://yoursite.trap17.com/cgi-bin/mailprog.cgi" method="POST">

(mailprog.cgi of course should be replaced by the name of this file).

If that doesn't work try method="GET"

Reply

Trystim
Well i fixed the 2 lines you said about correcting you can find the html and swf version at the following locations.
http://www.timsmed.com/contact/contact1.html
http://www.timsmed.com/contact/contact1.swf
i still get an error not sure as to why so i contacted the sites customer support because i am at ends with this tongue.gif but thanks for your help riao those 2 lines did need changed.

Reply

riao
The html page doesn't really do me much good as all it does is insert the .swf file. It doesn't show how it sends the data to the mail prog. That is in the swf file that I cannot open.

What is the error you are getting? Did you CHMOD the file to 755 after putting it in your cgi folder?

If you want I could send you a working mailscript. It won't be a flash file, but I could make it operate the was this one is supposed to. I would just need to know what email address you would want the form data sent to.

What's more is if you know how to set up a simple html form, you can set up others as well with no changes made to the cgi script.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.

Similar Topics

Keywords : cgi perl

  1. So...what's The Perl Deal? - Where do I learn it, how can I use it on my hosting account? (0)



Looking for cgi, perl

*RANDOM STUFF*





*SIMILAR VIDEOS*
Searching Video's for cgi, perl

*MORE FROM TRAP17.COM*
advertisement



Anyone Know CGI/Perl - i need help please?



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute your information that might help someone here.
Ask your Doubts & Queries to get answers.. "Together, We enlight each other!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE