cgi bin

  Amadas 23:02 12 Oct 03
Locked

Good day all, I'm hoping this is the right forum to post this question.

I'm attempting to create a form to email using a cgi bin. However, it doesn't seem to be working correctly and I'm pulling my hair out trying to direct it properly.

The address is click here
There is a cgi bin there with cgiecho and cgiemail, and I've got the form pointed to the cgiemail, but I know it needs to access something else, and I'm having a hell of a time in either editing this or creating the .txt or ASCII file. I don't know where to put it?

I'm receiving a message that It's done incorrectly, then it's states that it's done correctly??? I've checked their email by accessing it over the web, but there's nothing there.

Maybe I've been looking at this too long now as nothing seems to make sense to me anymore. I would really appreciate some assistance. Don't be afraid to break it down to the lowest common denominator as it looks as though I may have to start from scratch.

Thanking you all in advance

Regards,
Amadas

  Forum Editor 00:08 13 Oct 03

Are you using a Perl script or PHP?

What type of server does your site run on, Windows or Unix?

What software are you using to generate your HTML pages?

Do you have cgi access on the server? Just because you can create your own directory called cgi-bin doesn't mean you have cgi access.

If you have installed a script on a Unix server you'll have to set the correct permissions using the CHMOD command - have you done this?

If you can let me have the answers to those questions I'll be able to help you further - the form script needs to send the form using your server's 'sendmail' facility (assuming it's there).

  Amadas 00:42 13 Oct 03

I'm thinking it's perl, but it could be PHP as there is no extension on the cgiemail? This host uses both. I've attempted to open it with notepad, and it looks like perl.

I'm certain I have access as I can access it though either ftp or cpanel.

The script was already within the cgi bin, so I was using what was already there, so I have not used the CHMOD command. I wouldn't know how to use it. I think it's within the FTP?

When you hit submit, it sends you to mit.edu, click here

This is all new to me. Thank you for your help.

Regards,
Chris

  Forum Editor 01:09 13 Oct 03

but it will be a fairly complex procedure doing it via this thread. Why don't you
click here and follow the very helpful guide to doing this?

I'll help you resolve any glitches. Installing and running a Perl script on a Unix server can seem a little daunting at first, but it's like everything else - easier once you've done it a few times.

You'll need to have some FTP software so you can CHMOD the files properly.

click here to download WS_FTP Pro which is one of the best available programs.

  Amadas 02:38 13 Oct 03

I've gone to the site and into the cgi bin. I've noticed something there I didn't before. The template.txt file. I checked the CHMOD and ensured it was writable, edited the file by replacing the email address with the address I want the form to go to. It still doesn't work. I had created a to.txt file in word and saved it as a txt file, (which I learned from the MIT site). I'm now thinking that it should have been saved as a template.txt, but I don't want to tamper with a file that already exists, just in case I could use that one and just edit it. I'm also thinking that since that file is up there, it is pointing to the cgiemail file, so this is also why I don't wish to tamper with it.

I agree with the experience thing. Once I've done it a time or two, it will make sense. You've heard the old adage " Tell me and I'll forget, teach me and I'll remember, show me and I'll understand."

I'm at that point now where I need to see how it's done to understand it. I can read until I'm blue in the face, but if it still doesn't work, I won't understand why.

You have pointed me in another direction that I missed before and will try the instructions again with this new found knowledge. Thank you.

One last question: How do I open or create an ASCII file? I take it this is binary? If so, do I just save it as a txt file? Then put it up with the CHMOD command? I'm asking just so I understand.

I'm a designer, not a programmer, so this is all new to me. Thank you for your patience.

Regards,
Amadas

  harristweed 09:04 15 Oct 03

Your form sends the values entered in the various fields to the cgimail script as value pairs.

i.e. the name of the field and the value in contains. The first box on your form is called 'name' If I entered my name, Richard the value pair would be 'name=Richard'

When the user clicks submit all the value pairs are sent to the cgiscript.

The file called template.txt tells the script what to do with the values.

and should look like this

To: your [email protected] co . uk
Subject: form from web site

Senders name [name]
senders address [address]
.....etc

The first two lines tell the script where to send the email and what the subject is.
VERY IMPORTANT to have a BLANK LINE next

the email will contain the text'Senders name' but will subtitle the value pair information that corresponds to the text in square brackets.

The template should be saved as template.txt EXACTLY the same as described on the line of code <form action="http:// www. bitsetc.ca/ cgi-bin/cgiemail/ template.txt" method="post" name="form1" >

his should be uploaded as ASCII in to the directory that your isp instructions state. (usually the cgibin)

chomond

and all should work, to test the script you could add a redirect see here for more info click here

hope this helps.

  harristweed 09:07 15 Oct 03

To: your [email protected] co . uk
Subject: form from web site

Senders name [name]
senders address [address] .....etc

  harristweed 09:09 15 Oct 03

to: on first line
subject on second line
then a blank line

then the rest of it on separate lines..........

  harristweed 09:10 15 Oct 03

subtitle shoud read as 'substitute'

  Amadas 18:13 15 Oct 03

I needed to move the template.txt up to the root. I had it in the cgibin folder and this is why I was having problems. It is working fine now.

Thank you harristweed and to Forum Editor for all your assistance.

Regards,
Amadas

  Forum Editor 18:36 15 Oct 03

I'm glad it's working OK now.

This thread is now locked and can not be replied to.

New Google phones UK release date | Pixel XL price, new features, specifications: Pixel X and…

1995-2015: How technology has changed the world in 20 years

This is the future of TV, VR and holograms

iPhone 7 review: Enhanced cameras, a refreshed design and water resistance make the iPhone 7 an…