Dreamweaver Club Forums

Dreamweaver Club Forums (http://www.dreamweaverclub.com/forum//index.php)
-   ASP (http://www.dreamweaverclub.com/forum//forumdisplay.php?f=187)
-   -   asp help (http://www.dreamweaverclub.com/forum//showthread.php?t=27700)

Nuttz 04-08-2008 03:41 AM

asp help
 
Why am I getting this error?
"No variables sent to form! Unable to process request."

form on the server:
http://www.precision-design.net/contact.htm

Code:

<form action="gdform.asp" method="post" enctype="text/plain" name="precision_form" target="_self" id="precision_form">
      <input type="hidden" name="subject" value="Form Submission" />
      <input type="hidden" name="redirect" value="thankyou.html" />
        <blockquote>
          <p align="left" class="style6"><strong>Contact Us:</strong></p>
          <p align="left" class="style6">Again, thank you for your interest in Precision Design, LLC. Please, feel free  to contact us with any questions or comments.</p>
        </blockquote>
        <table width="60%" border="4" align="center" cellpadding="5" cellspacing="0" bordercolor="#2B358D" id="comments" summary="Precision Design comment form.">
          <tr>
            <td width="19%"><div align="right"><span class="style4">Name</span>:</div></td>
            <td width="81%"><input name="name" type="text" id="name" size="40" /></td>
          </tr>
          <tr>
            <td width="19%" class="style4"><div align="right">Email:</div></td>
            <td><input name="email" type="text" id="email" value="Email address" size="40" /></td>
          </tr>
          <tr>
            <td width="19%" class="style4">Comments:</td>
            <td><textarea name="comments" id="comments" cols="45" rows="4">Please add your comments</textarea></td>
          </tr>
          <tr>
            <td class="style4"><div align="right">
              <input type="submit" name="button" id="button" value="Submit" />
            </div></td>
            <td><div align="left">
              <input type="reset" name="reset" id="reset" value="Reset" />
            </div></td>
          </tr>
        </table></form>

I tried contacting godaddy...but they said there is no problem on there end.

I really don't know a lot about this, I saw the example from godaddy to just change my form action to "gdform.asp" and method to "post"

any help is greatly appreciated.

mangofreak 04-08-2008 06:26 PM

On your gdform.asp

put the following code to the top of your page:

Code:

<% ' debugging code ******************************************************************************
 FOR EACH Form_Parameter IN Request.Form
  Response.Write(Form_Parameter & "&nbsp;" & "=" & "&nbsp;")'this are the field names
  Response.Write(Request.Form(Form_Parameter) & "<BR>")' this are the data entered
 NEXT
 'debugging code ******************************************************************************
 %>

That code will let you know what are the values passed from your form. Is this going to a DB or just a page, or email once it's processed??

What is the gdform.asp code like???

Nuttz 04-08-2008 09:03 PM

Code:

<% ' debugging code ******************************************************************************
 FOR EACH Form_Parameter IN Request.Form
  Response.Write(Form_Parameter & "&nbsp;" & "=" & "&nbsp;")'this are the field names
  Response.Write(Request.Form(Form_Parameter) & "<BR>")' this are the data entered
 NEXT
 'debugging code ******************************************************************************
 %>
 <%
Dim landing_page, host_url
Dim fso, outfile, filename, dirname, myFolder
Dim req_method, key, value
Dim bErr, errStr, bEmpty
On Error resume next
bErr = false
bEmpty = true
errStr = ""
Set fso = Server.CreateObject("Scripting.FileSystemObject")
host_url = Request.ServerVariables("HTTP_HOST")
req_method = Request.ServerVariables("REQUEST_METHOD")
dtNow = Now()
filename = Server.MapPath("\ssfm")
dirname = filename
filename = filename & "\gdform_" & DatePart("M", dtNow) & DatePart("D", dtNow) & DatePart("YYYY", dtNow) & DatePart("N", dtNow) & DatePart("S", dtNow)
Function FormatVariableLine(byval var_name, byVal var_value)
 Dim tmpStr
 tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " START>" & vbCRLF
 tmpStr = tmpStr & var_value & vbCRLF
 tmpStr = tmpStr & "<GDFORM_VARIABLE NAME=" & var_name & " END>"
 FormatVariableLine = tmpStr
end function
Sub OutputLine(byVal line)
  outfile.WriteLine(line)
end sub
if err.number = 0 then
 Set outfile = fso.CreateTextFile(filename, true, false)
 if err.number <> 0 then
  bErr = true
  errStr = "Error creating file! Directory may not be writable or may not exist.<br>Unable to process request."
 else
  if(req_method = "GET") then
  for each Item in request.QueryString
    if item <> "" then
    bEmpty = false
    key = item
    value = Request.QueryString(item)
    if(lcase(key) = "redirect") then
      landing_page = value
    else
      line = FormatVariableLine(key, value)
      Call OutputLine(line)
    end if
    end if
  next
  elseif (req_method = "POST") then
  for each Item in request.form
    if item <> "" then
    bEmpty = false
    key = item
    value = Request.form(item)
    if(lcase(key) = "redirect") then
      landing_page = value
    else
      line = FormatVariableLine(key, value)
      Call OutputLine(line)
    end if
    end if
  next
  end if
  outfile.close
 end if
 if(bEmpty = true) AND errStr = "" then
  bErr = true
  errStr = errStr & "<br>No variables sent to form! Unable to process request."
 end if
 if(bErr = false) then
  if (landing_page <> "") then
  response.Redirect "http://" & host_url & "/" & landing_page
  else
  response.Redirect "http://" & host_url
  end if
 else
  Response.Write errStr
 end if
 set fso = nothing
else
  Response.Write " An Error Occurred creating mail message. Unable to process form request at this time."
end if
%>

Here is the asp code from godaddy.

I am wanting a form to be submited our default email address, so we know when someone is interested something we offer.

Thanks

Nuttz 04-08-2008 09:05 PM

posted twice by acident....sorry

mangofreak 04-09-2008 06:42 PM

It's more involved than I thought.

Did you try changing the Enctype on your form from:

enctype="text/plain" to enctype="multipart/form-data"

Nuttz 04-10-2008 02:49 AM

I just tried it and still same error code: No variables sent to form! Unable to process request.

Man is this frustrating....I'm getting to the point that I would pay someone to fix/figure it out.
Thanks

mangofreak 04-11-2008 05:12 AM

what are you trying to accomplish exactly????
Is the form posting to a page or sending it to you as email. The code you have posted has all kind of functions for error handling as well as file uploading. The script you have may not be what you want.

so, what do you want the form to do for you?

I think that should have been my first question. before I even sent my first reply, but I have been very busy that I got caught in the panic. :)

It happens.

I decided to see what Godaddy was and I found this on my first search: http://forevergeek.com/articles/godaddy_sucks.php

Nuttz 04-11-2008 12:26 PM

What I am wanting the form to do is....once you enter the information(name, email, and comments) then click the submit button. It would then send an email to me at info@precision-design.net letting me know that that person has a question or comment.

Thatís what I want it to...If that is possible, or if you know of another way for a user to submit the form and I recieve it somehow.

I really do appreciate your time, thank you very much. :)

mangofreak 04-14-2008 03:17 AM

Sorry man, I have been as swamped as I can be. Pretty much the whole past week. Just now I had a chance to review your code more in detail so
Here are a few suggestions:

change your code from:
Code:

<form action="gdform.asp" method="post" enctype="text/plain" name="precision_form" target="_self" id="precision_form">
to
Code:

<form action="gdform.asp" method="post" name="precision_form" id="precision_form">
if still doesn't work, create a new page. Call it whatever you like and change that action of the form to the name of the new page you are creating. Then,
paste the debugging code I sent before (on the new page) in code view, in between the body tags or at the very beginning just below the
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> code bit.

then upload the files and test, you should be able to see if your new page receives the data passed from the form.

keep me posted. I'll be checking the forum tomorrow for updates.

second: If you don't have time, invest in a little application called FormstoGo, cheap but works for sending mail with asp and php, as well as validates the form. They also provide lifetime updates for their product. Google it FormstoGo from bebosoft. Nice stuff. cheap. worth it.

Nuttz 04-14-2008 02:38 PM

That worked....THANKS A MILLION!

the only thing is when my form submits it brings up an OOPS page from the server. Do I need to make a page that says.... Form has been submitted?

Thanks
David


All times are GMT. The time now is 01:44 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com