Can you modify a .cgi in text edit?
Good Morning Everyone. I am hoping someone can help me out with a problem I am having.
Here is some background before I get started. I am using a G4 Mac running OS version 10.3.2 and I am using DreamWeaver MX to create a form.
This will probably win the prize for the most stupid question contest, but here it goes.
I wanted to know if it is possible to modify a .cgi script in text edit (kinda Apple's version of Windows Notepad) without causing problems?
The reason that I ask is this:
I have created a form in DWMX with about 6 fields. The form does a post to a cgi program. The .cgi script that I am using I took off a cdrom from a book and did a few modifications with textedit. Nothing harmful, just changed the email address and a few other things (color change, added html text, etc.).
So here is the problem. When I test it on a mac, either with Netscape, Chimera, IE, or Safari, everything works fine. I get the results page and the email with all of the information from the fields. Everything is fine. When I do it on a PC (running either NT, XP, 2000), the results page shows fine, but the email only has the results from 1 field on the form. I have tried this on the pc with both IE and netscape.
I emailed the cgi to my job(PC) and opened it up in Notepad. It looked all messed up and it had blocks everywhere. Could this be causing the problem? If this is not the problem and anyone has anyother suggestions, I would love the help.
As always, thanks for taking the time to read this and for the help!
Don
dmacimus posted this at 14:32 — 7th April 2004.
They have: 3 posts
Joined: Mar 2004
Sorry, I forgot one piece of information:
When I look in the cgi(mailform.cgi), it states that it is a generic cgi email generator and it uses sendmail. In the instructions, the creator states that you can modify the destination email address as well as the correct directory for the sendmail program.
s0da posted this at 14:56 — 7th April 2004.
He has: 157 posts
Joined: Mar 2004
yes it is possible. i do it all the time.
Suzanne posted this at 17:26 — 7th April 2004.
She has: 5,507 posts
Joined: Feb 2000
1. Don't use Notepad -- it can add all sorts of extra badness to your scripts that will make it fail, including the wrong line endings.
2. When you're working with Mac v. Windows v. Unix, you can have a pile of different line endings that will screw up your scripting.
I'm not sure about TextEdit, but BBEdit and Tex-Edit other text editing applications allow you to save as a particular kind of file. Hold on, I'll open TextEdit. Yes you can set plain text to Unicode.
BBEdit allows you to specify Unix, however. Mac line endings will cause problems on PCs and sometimes on Unix servers. So will special hidden spaces -- one thing I use frequently is BBEdit because it shows hidden spaces (they look like spaces, but are special characters).
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.