Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Cgi Files?, where does this script belong?
spy_charly
post Apr 2 2006, 06:20 AM
Post #1


Premium Member
********

Group: Members
Posts: 195
Joined: 18-November 05
Member No.: 14,521



hello guys, it's been a couple of days that i dont know where this script must be placed and in which format...i know it is from perl but what format should i use .pl or .cgi, yep i am a newbie rolleyes.gif

i also saw that there is a folder in my directory called cgi-bin, do i have tu put it there?

QUOTE
#!/usr/bin/perl

$recipient = "me@somemail.com"; # watch out for backslash
$mail = "/usr/sbin/sendmail";

if($ENV{REQUEST_METHOD} eq 'POST')
{ read STDIN, $buffer, $ENV{CONTENT_LENGTH};
}
else
{ $buffer = $ENV{QUERY_STRING};
}
foreach $pair (split /&/, $buffer)
{ ($key, $value) = split /=/, $pair, 2;
$value =~tr/+/ /;
$value =~ s/%([0-9a-fA-F]{2})/chr(hex($1))/eg;
$FORM{$key} = $value;
}
## special treatment for the comments field
$FORM{comments} =~s/rn?/n/sg;
## here comes your form
open MAIL, "|$mail $recipient";
print MAIL <<END;
From: webserver@yoursite.com
Subject: Contact Form

Contact form filled by
$FORM{name}
$FORM{address}
phone: $FORM{phone}
fax: $FORM{fax}

Comments: $FORM{comments}
END
if(!close MAIL) {
print "(anti-spam-content-type:) text/htmlnn";
print "status=fail&error=Your+mail+could+not+be+sent";
}
else
{ print "(anti-spam-content-type:) text/htmlnn";
print "status=ok";
}
Go to the top of the page
 
+Quote Post
BuffaloHELP
post Apr 2 2006, 06:33 AM
Post #2


Desperately seeking "any key" to continue...
Group Icon

Group: Admin
Posts: 3,478
Joined: 23-April 05
From: Trap17 storage box
Member No.: 6,042



Simply the answer is yes. It makes calling your script easier. However, if I'm not mistaken you're trying to send information over the email using form?

There's built-in script called cgimail and you can find a short tutorial here: How To Use Trap17 Cgi Formmail
Go to the top of the page
 
+Quote Post
spy_charly
post Apr 3 2006, 02:57 AM
Post #3


Premium Member
********

Group: Members
Posts: 195
Joined: 18-November 05
Member No.: 14,521



thanx boss, actually i was trying to send the Receipent from flash and i thought that using another script it could be possible...

But what you provided seems to be very helpful, btw i set a serach on the forum for that topic but i didnt find anything, i guess i will have to be very careful next time... and if i get it working i will show it to you

EDITED: i got it working boss, but when it arrives at the mail it arrives like "myname@gamma.xisto.com" is there anyway i can solv this? replacing the account name with my name?

This post has been edited by spy_charly: Apr 3 2006, 04:07 AM
Go to the top of the page
 
+Quote Post
BuffaloHELP
post Apr 3 2006, 05:28 AM
Post #4


Desperately seeking "any key" to continue...
Group Icon

Group: Admin
Posts: 3,478
Joined: 23-April 05
From: Trap17 storage box
Member No.: 6,042



QUOTE(spy_charly @ Apr 2 2006, 10:57 PM) *

but when it arrives at the mail it arrives like "myname@gamma.xisto.com" is there anyway i can solv this?

Well that's better than myname@someusinversity.department.edu before... smile.gif

If you are the only recipient to submitted email then I guess it really does not matter. However, since the mail service is through gamma.xisto.com and our hosting server's name is gamma, I personally do not have the control over that.

I would suggest you contact OpaQue or send queries to Helpdesk (xisto.com/helpdesk) and see if there's a way of doing it.
Go to the top of the page
 
+Quote Post
gaea
post Apr 3 2006, 07:00 AM
Post #5


Super Member
*********

Group: Members
Posts: 205
Joined: 14-March 06
From: Vermont or Boston (USA)
Member No.: 20,077



QUOTE(spy_charly @ Apr 3 2006, 02:57 AM) *
EDITED: i got it working boss, but when it arrives at the mail it arrives like "myname@gamma.xisto.com" is there anyway i can solv this? replacing the account name with my name?


The is the default mailserver. If you it's displaying as that the "from" field in your script is probably misformatted.
Go to the top of the page
 
+Quote Post
tuddy
post Apr 3 2006, 10:18 AM
Post #6


Privileged Member
*********

Group: Members
Posts: 570
Joined: 5-July 05
From: Ballarat
Member No.: 9,042



Following on from gaea, I have my own question, is it possible to have a code line in there where you can tell the form, which mail server to use and what the email it should be replyed to and if you can put a name instead of an email address?

I know you can do it in PHP, but is cgimail that flexible?
Go to the top of the page
 
+Quote Post
spy_charly
post Apr 3 2006, 08:57 PM
Post #7


Premium Member
********

Group: Members
Posts: 195
Joined: 18-November 05
Member No.: 14,521



hi tudy!, i dont think you can do it, since it is already done by the cgi script, i tried downloading it but notepad and nor Dreamweaver could open it...

my suggestion anyway would be to download the script manually and set the preferences manually as well...the problem is that i dont know about cgi and that makes more the things more difficult...
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Uploading Files And Connecting To Ftp(27)
  2. Could Someone Make A Php Script For Me?(3)
  3. Guestbook (cgi-script) Problems(1)
  4. Help In A Php Script(1)
  5. Problems With Ftp(10)
  6. Coppermine Photo Gallery - Security Alert(1)
  7. What Do 1st Files In Ftp Do?(1)
  8. Script Error With Domain Name Changing(8)
  9. Fantastic Script(2)
  10. Unzipping (untar) Tar Files(5)
  11. Question About Uploading Files(3)
  12. Making The Files In File Manager Invisible(8)
  13. Help With Running A Cgi Script(2)
  14. I Need Help Uploading The Install Files(3)
  15. Upload Script To Transfer Files From Laptop To Desktop(3)
  1. Problems With Deleting Files In My Account(3)
  2. Accidentally Deleted Pre-set Files(3)
  3. Need Help Installing Smf(5)
  4. Different Log In Script...(6)
  5. Help! I Deleted All My Files!(5)
  6. Can't Find My Fantastico Installation!(2)
  7. Request For Coders (lots To Do)(1)
  8. Ftp Trap17 Account Help Please(14)
  9. Transferring Files From One Host To Another(8)
  10. Have There Been Any Changes?(1)
  11. Where Do I Upload My Ftp Files? [resolved](1)
  12. Css Problem On Website(8)
  13. Phpizabi Social Network Script(1)


 



- Lo-Fi Version Time is now: 7th October 2008 - 09:57 PM