|
-
CGI Scripting Problem (Perl) -- PLEASE HELP A GIRL OUT!!
What have I gotten myself into? .I am doing this site for a NPO. They want to include an online registration form for teachers and volunteers to be able to sign up for the festival. However... For some reason, I can't get the CGI script to work. Right now it's set to email me, until I can figure out what the hell I did wrong.
When I hit submit, it goes to the cgi-bin/bizmail.pl (ok, i downloaded the script and followed the steps completely...)
I've never learned this scripting before, so bear with me.
At the beginning of the "readme" file it says:
Make sure the path to PERL is correct.
(THIS IS LOCATED ON THE VERY FIRST LINE OF THE bizmail.pl script.)
By default it is set to: #!/usr/bin/perl
What does this mean? In my .pl file, that line is there, but am I supposed to have a directory in my domain space that has that?
That's the only thing I can think of that's wrong... Why it's not executing the script. If anyone could please help me... The server host is not giving me any technical support on this.
If there's an easier way... I'm all ears!
-
__OSX powered__
ok: this means that the script needs to know the path to where perl is installed on the server.
So: first of all - what kind of server do you have? ( win/*nix)
can you telnet in to the server? If you can: execute whereis perl when you have logged in, this will tell you were perl is on the server ( that is: if it is a linux/unix server, don't know what the command is for a windows server) .
-
Hi,
the domain for your website does not seem to exist 
Musicman
-
the site exists... i had to take it down early this morning so that teachers wouldn't try to register and think that they had.
the server is a unix based one, but i do not have telnet. i was using a simple ftp program to upload the files there.
i've emailed the host, but they have yet to get back to me. so much for technical support. heh.
now... they do have a tech support site, but the only thing they mention there is how to chmod the files -- which i've done. they don't say where the path to perl is. and i know that they must have one because on their own site they use a very similar form that i'm trying to use!! (except that they use javascript to execute theirs and i'm using html... but that shouldn't make a difference, right?)
i still haven't figured this out yet.
-
Hi,
if they do not mention the path to perl, assume /usr/bin/perl
They do have instructions for chmodding the file - do they also have instructions for ascii upload?
And, well, I would really like to see the message from your script is sending back to flash
Musicman
-
__OSX powered__
Regarding path, you can also use:
/usr/bin/env perl
-
Originally posted by Musicman
Hi,
if they do not mention the path to perl, assume /usr/bin/perl
They do have instructions for chmodding the file - do they also have instructions for ascii upload?
And, well, I would really like to see the message from your script is sending back to flash
Musicman
i don't actually have the forms running in flash. i have it set up so that it opens a new window where the form appears in a simple html file. when you hit submit, it just goes to a 404 page and in the address bar it says: http://www.essexwaterfest.ca/cgi-bin/bizmail.pl
could that be the problem then? that i uploaded it wrong?
i don't understand that. i'm using coffeecup (becuz someone stole my cd with another ftp program on it and i haven't found another)...
i should be uploading it ascii? should the .pm file be uploaded into the MIME directory as ascii? are there any other files i should be uploading that way?
(i figured out how to upload in ascii using coffeecup...)
Last edited by weilerino; 03-14-2004 at 05:25 PM.
-
-
__OSX powered__
well: the file isn't there at all.... you need to upload it to the cgi-bin, or you need to modify the form so that it points to the correct file.
-
Originally posted by nucleuz
well: the file isn't there at all.... you need to upload it to the cgi-bin, or you need to modify the form so that it points to the correct file.
it is there!
i uploaded it myself. it's in the cgi-bin directory... and the form does point to the correct file.
i don't know why the hell it isn't working!
i'm even using a new script now that someone else sent me. still doesn't work. i followed the directions step by step, word for word...
i understand the concept. i understand what is supposed to happen.
i don't understand why it isn't working.
and the host server definitely told me that they supported perl.
-
Domo Arigato!
If you have ASP/CDO support, you can do it this way (more in depth details are available at http://www.asp101.com/samples/email_html.asp):
Code:
<%
' Declare our variables:
Dim objCDO ' Our CDO object
Dim strTo ' Strings to hold our email fields
Dim strFrom
Dim strSubject
Dim strBody
' First we'll read in the values entered and set by
' hand the ones we don't let you enter for our demo.
strTo = Request.Form("to")
' These could read the message subject and body in
' from a form just like the "to" field if we let you
' enter them.
'
'strSubject = Request.Form("subject")
'strBody = Request.Form("body")
'
' We instead hard code them below just so people
' don't abuse this page.
'***********************************************************
' PLEASE CHANGE THESE SO WE DON'T APPEAR TO BE SENDING YOUR
' EMAIL. WE ALSO DON'T WANT THE EMAILS TO GET SENT TO US
' WHEN SOMETHING GOES WRONG WITH YOUR SCRIPT... THANKS
'***********************************************************
strFrom = "User Name <[email protected]>"
strSubject = "Sample HTML Email sent from ASP 101!"
' This is multi-lined simply for readability.
' Notice that it is a properly formatted HTML
' message and not just plain text like most email.
' A lot of people have asked how to use form data
' in the emails so I added an example of including
' the entered address in the body of the email.
strBody = "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD HTML 4.0 Transitional//EN"">" & vbCrLf _
& "<html>" & vbCrLf _
& "<head>" & vbCrLf _
& " <title>Sample Message From ASP 101</title>" & vbCrLf _
& " <meta http-equiv=Content-Type content=""text/html; charset=iso-8859-1"">" & vbCrLf _
& "</head>" & vbCrLf _
& "<body bgcolor=""#FFFF99"">" & vbCrLf _
& " <h2>Sample Message From ASP 101</h2>" & vbCrLf _
& " <p>" & vbCrLf _
& " This message was sent from a sample at" & vbCrLf _
& " <a href=""http://www.asp101.com"">ASP 101</a>." & vbCrLf _
& " It is used to show people how to send HTML" & vbCrLf _
& " formatted email from an Active Server Page." & vbCrLf _
& " If you did not request this email yourself," & vbCrLf _
& " your address was entered by one of our" & vbCrLf _
& " visitors." & vbCrLf _
& " <strong>" & vbCrLf _
& " We do not store these e-mail addresses." & vbCrLf _
& " </strong>" & vbCrLf _
& " </p>" & vbCrLf _
& " <font size=""-1"">" & vbCrLf _
& " <p>Please address all concerns to [email protected].</p>" & vbCrLf _
& " <p>This message was sent to: " & strTo & "</p>" & vbCrLf _
& " </font>" & vbCrLf _
& "</body>" & vbCrLf _
& "</html>" & vbCrLf
' Some lines to help you check the formatting of your
' email before you actually start sending it to people.
'Response.Write "<pre>"
'Response.Write Server.HTMLEncode(strbody)
'Response.Write "</pre>"
'Response.End
' Ok... we've got all our values so let's get emailing:
' We just check to see if someone has entered anything into the to field.
' If it's equal to nothing we show the form, otherwise we send the message.
' If you were doing this for real you might want to check other fields too
' and do a little entry validation like checking for valid syntax etc.
' Note: I was getting so many bad addresses being entered and bounced
' back to me by mailservers that I've added a quick validation routine.
If strTo = "" Or Not IsValidEmail(strTo) Then
%>
<form action="<%= Request.ServerVariables("URL") %>" METHOD="post">
Enter your e-mail address:<br />
<input type="text" name="to" size="30" />
<input type="submit" value="Send Mail!" />
</form>
<%
Else
' Send our message:
' Note that I'm using the Win2000 CDO and not CDONTS!
' As such it will only work on Win2000.
Set objCDO = Server.CreateObject("CDO.Message")
With objCDO
.To = strTo
.From = strFrom
.Subject = strSubject
.HtmlBody = strBody
' BEFORE YOU UNCOMMENT THIS CHANGE THE VALUE OF
' strFrom ABOVE! IF YOU CAN'T FIND IT SEARCH FOR
' strFrom = "User Name <[email protected]>"
' THANK YOU.
'.Send
End With
Set objCDO = Nothing
'==============================================================
' You'd normally use the above, but I thought I should include
' the CDONTS version for those of you still running NT4.
'==============================================================
'Set objCDO = Server.CreateObject("CDONTS.NewMail")
'objCDO.From = strFrom
'objCDO.To = strTo
'objCDO.Subject = strSubject
'objCDO.Body = strBody
'
'objCDO.BodyFormat = 0 ' CdoBodyFormatHTML
'objCDO.MailFormat = 0 ' CdoMailFormatMime
'
''objCDO.Cc = "[email protected];[email protected]"
''objCDO.Bcc = "[email protected];[email protected]"
'
'' Send the message!
'objCDO.Send
'Set objCDO = Nothing
'Response.Write "Message sent to " & strTo & "!"
Response.Write "Message ARE NO LONGER BEING SENT because of all the abuse the system was receiving!"
End If
%>
(Sorry - I program with ASP, so I really can't offer PHP, CGI, etc. assistance)
I really enjoy forgetting. When I first come to a place, I notice all the little details. I notice the way the sky looks. The color of white paper. The way people walk. Doorknobs. Everything. Then I get used to the place and I don't notice those things anymore. So only by forgetting can I see the place again as it really is.
-
Hi
What file access attributes did you give it when you chmod'ed it.
-
Originally posted by dannyboy78
Hi
What file access attributes did you give it when you chmod'ed it.
I gave it Read & Execute... and write permissions for "user".
-
Is that 755?
You were saying about your ftp program, you could download the demo of cuteftp personally I think that is one the best ftp programs and really easy.
Have you tried a really simple script that you know definatley works like one that prints out the server time to the browser
Code:
#!/usr/bin/perl
$servertime=localtime(time);
print "Content-type: text/html\n\n";
print "server time is: $servertime";
try uploading that and chmoding with 755 and run it.
Dan
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|