Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-03-2005, 03:00 PM
WebProWorld Member
 

Join Date: Dec 2004
Location: New York City
Posts: 37
icon kid RepRank 0
Default My javascript "Submit" form is not submitting!

I'm creating a javascript form (for a games company) to take "pre-orders" from past buyers and potential buyers. When the form is filled out and the Submit button is pressed, an e-mail of this information is supposed to be sent to a certain e-mail recipient, but this isn't happening. Instead, it returns a 404 error. Can someone please explain why?

This is the test page with the form:
http://www.jeffs-icons.net/sv/formTest-01.html

This is the code (with some of the input fields removed:

<P ALIGN=center>
<form method=POST action="/cgi-bin/contact">
<input type=hidden name="recipient" value="russell9387@runbox.com">
<input type=hidden name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT">
<input type=hidden name="bgcolor" value="#ffffff">
<input type=hidden name="text_color" value="#000000">
<input type=hidden name="return_link_url" value="http://www.jeffs-icons.net">
<input type=hidden name="return_link_title" value="Back to My Page">

<FONT COLOR="#FFFFFF">
<table border="0" cellpadding="0" cellspacing="10" width="520">
<td>Organization Name:</td><td><input name="Organization" type="text" rows=1 size="37"></td>
</tr>

<tr>
<td>Contact Person Name & Title:</td>
<td><input name="Contact" type="text" rows=1 size="37"></td>
</tr>

<tr>
<td>Address:</td>
<td><input name="Address" type="text" rows=1 size="37"></td>
</tr>

<tr>
<td>Country:</td>
<td><input name="Country" type="text" rows=1 size="16"></td>
</tr>

<tr>
<td>Number of units
you expect to order:</td>
<td><input name="Units" type="text" rows=1 size="16"></td>
</tr>
</table>




<center><input type="Submit" value="Submit"><input type="Reset">
</form>
Reply With Quote
  #2 (permalink)  
Old 07-03-2005, 03:23 PM
brian.mark's Avatar
Administrator
 

Join Date: Jul 2004
Location: Omaha
Posts: 2,717
brian.mark RepRank 2brian.mark RepRank 2
Default Easy enough...

Easy enough to explain. /cgi-bin/contact on the test server doesn't exist. contact doesn't seem like a valid script name. You'll need to change that script name to something that exists for it to work.

Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies
Reply With Quote
  #3 (permalink)  
Old 07-03-2005, 05:16 PM
WebProWorld Member
 

Join Date: Dec 2004
Location: New York City
Posts: 37
icon kid RepRank 0
Default

Your right, in that it's not a valid script name -- "contact" is the valid name of a folder on my server. It seems that I should put something in that folder to make the script work, but what!
Reply With Quote
  #4 (permalink)  
Old 07-03-2005, 05:53 PM
brian.mark's Avatar
Administrator
 

Join Date: Jul 2004
Location: Omaha
Posts: 2,717
brian.mark RepRank 2brian.mark RepRank 2
Default Probably...

Probably some sort of a form mailer. Just make sure you turn the security options on so you don't have a spam mailer as well.

Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies
Reply With Quote
  #5 (permalink)  
Old 07-04-2005, 02:02 PM
WebProWorld Member
 

Join Date: Dec 2004
Location: New York City
Posts: 37
icon kid RepRank 0
Default

Yes, a form mailer is what I needed. I got a free one here:
http://www.scn.org/~bb615/scripts/sendform.html

You place it in your cgi bin and edit the form to direct it there "on submit."

It still doesn't work yet because of some kind of server error. It's a "500" error which can be caused by a number of things. The ones I checked were these:

make sure the script was uploaded in ascii format
make sure your have set the permissions
make sure the shebang line is correct ie: #!/usr/bin/perl

The first two were good but the third was different in my mailer cgi script. It read:

#!/usr/bin/local/perl

The shebang line on all the other working scripts on my server don't have the string "/local" so I removed it -- still didn't work. Then I looked at my server error log to get some kind of specific description of the errors and so it turns out to be this:

"Premature end of script headers"

OK -- so how do I prevent my script headers from ending prematurely?
Reply With Quote
  #6 (permalink)  
Old 07-04-2005, 02:51 PM
brian.mark's Avatar
Administrator
 

Join Date: Jul 2004
Location: Omaha
Posts: 2,717
brian.mark RepRank 2brian.mark RepRank 2
Default If you have...

If you have command line access to your server, simply run the script with ./scripname.cgi to get the actual errors. Otherwise, it could be tough to tell what the exact problem is. It is usually the FTP problems or permissions problems, but there are other issues that could arise.

If you can run it from the command line, then it will take more digging to find the problem.

Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0