Wrox Programmer Forums
|
BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4
This is the forum to discuss the Wrox book Beginning Dreamweaver MX by Charles E. Brown, Imar Spaanjaars, Todd Marks; ISBN: 9780764544040
Please indicate which version of the book you are using when posting questions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Dreamweaver MX/MX 2004 MX ISBN: 978-0-7645-4404-0; MX 2004 ISBN: 978-0-7645-5524-4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old June 28th, 2006, 07:38 PM
Authorized User
 
Join Date: May 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default ASP not working with form

Hi,
I'm using Dreamweaver MX and am currently on page 248 of Beginning Dreamweaver MX, trying to get request.asp to work with the request form. When I try and preview I get the following message:

Tekniske oplysninger (for supportteknikere)

    * Fejltype:
      Microsoft VBScript compilation (0x800A03EA)
      Syntax error
      /thecookingplace/register.asp, line 11, column 30
      strName = Request.QueryString(*cust_name*)
       -----------------------------^

    * Browsertype:
      Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.4) Gecko/20060508 Firefox/1.5.0.4

    * Side:
      POST 163 bytes to /thecookingplace/register.asp

    * POST Data:
      cust_name=Fred+Bloggs&cust_interest=Recipes&cust_c ontact_type=email&cust_comments=This+site+is+great %21&cust_email=fred%40fredbloggs.com&submit=Send+M y+Information

    * Klokkeslæt:
      29 June 2006, 02:31:18

I've checked and rechecked the code for register.asp which looks like this:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<html>
<head>
<title>Thankyou</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<%
Dim strName, strInterest, strContact, strComments, strEmail
strName = Request.QueryString(*cust_name*)
strInterest = Request.QueryString(*cust_interest*)
strContact = Request.QueryString(*cust_contact_type*)
strComments = Request.QueryString(*cust_comments*)
strEmail = Request.QueryString(*cust_email*)
%>
Thankyou <em><%= strName %></em> for your interest in <em><%=strInterest%></em>
</body>
</html>

and it seems OK. I've also checked the code in request form and can't see anything that looks out of place.

Any suggestions?

Mikael

 
Old June 29th, 2006, 12:28 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

You are using * (star) instead of " (quotes).

This:

strName = Request.QueryString(*cust_name*)

should be

strName = Request.QueryString("cust_name")


Hope this helps,

Imar
 
Old June 29th, 2006, 02:31 AM
Authorized User
 
Join Date: May 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Imar,

Sorry, I'm using the e-book format of Beginning Dreamweaver MX and have the size set to 125% which means that I don't have to scroll left to right, but also means that I sometimes mistake one character for another because they aren't that clear.

I made the changes you suggested, but they only gave partial success. Now when I preview, all I get is: 'Thank you for you interest in'. The strName and strInterest variables don't seem to be getting processed. The only thing in the address bar is:http://localhost/thecookingplace/requestForm.htm

I also tried changing the language in the properties bar of the request form to VBScript, again with no success.

I'll continue playing about with it. Maybe the answer will come to me. In the meantime, many thanks for your help.

Mikael

 
Old June 29th, 2006, 04:24 AM
Authorized User
 
Join Date: May 2006
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yay! I found the answer. I tried changing the method in the request form from POST to GET. I don't know what happened but that must have escaped my attention. I'm so glad!

Mikael
 
Old June 29th, 2006, 03:05 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Yeah, that makes sense... When you use Post, you can access variables with Request.Form. When you use Get, you should use Request.QueryString.

You can also use the more generic form of Request (for example, Request("UserName") that searches both collections. Personally, I don't like that style because it doesn't make your intentions very clear.

Have fun with the rest of the book. Next up is the Soccer Site, right? That covers this Request thing in much more detail....

Imar





Similar Threads
Thread Thread Starter Forum Replies Last Post
Logon Form to Oracle quit working milledj VB Databases Basics 0 December 11th, 2006 01:32 PM
Form Validation not exactly working as intended.. Smythe Classic ASP Basics 1 July 25th, 2006 03:56 PM
asp.net form to act like old asp form namaste Classic ASP Basics 0 July 25th, 2003 01:29 AM
Form posting not working on Win32 but OK on linux synergz BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 July 21st, 2003 11:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.