Solved

Quotes problem

Posted on 2004-10-14
12
223 Views
Last Modified: 2008-02-01
 Response.Write("<form action=""chav.asp?action=aupdated?"" & PID & """ method=""post"" name=""upload"" enctype=""multipart/form-data"" OnSubmit=""return CheckNewRequest1(); return ShowProgress();"">" & vbCrLf)


can somone explain what is wrong with my quotage here for the action and why.  The PID is not showing in the URL.  I guess in some situations I still don't get the quotes and why I need more than 2 quotes in some situations.  I know if I am concatinating on a variable that I need to end the string, put in & var & but don't know how to end the quotage...do I use 3, 4, ???
0
Comment
Question by:dba123
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
12 Comments
 
LVL 6

Accepted Solution

by:
boblah earned 500 total points
ID: 12313236
Hi dba123,

you want:

Response.Write("<form action=""chav.asp?action=aupdated?" & PID & """ method=""post"" name=""upload"" enctype=""multipart/form-data"" OnSubmit=""return CheckNewRequest1(); return ShowProgress();"">" & vbCrLf)

Cheers!
0
 
LVL 96

Expert Comment

by:Lee W, MVP
ID: 12313250
You have double-quotes beside the PID - I don't think that's right.  Remove one from the left side, see:

Response.Write("<form action=""chav.asp?action=aupdated?" & PID & """ method=""post"" name=""upload"" enctype=""multipart/form-data"" OnSubmit=""return CheckNewRequest1(); return ShowProgress();"">" & vbCrLf)
0
 
LVL 1

Author Comment

by:dba123
ID: 12313265
but why...how are the quotes working in this situation....how is ASP interpreting this particular quote set?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:dba123
ID: 12313293
Ok, tried this but the PID still isn't showing a number....and I know the PID has a value if I print it to the screen.

Response.Write("<form action=""chav.asp?action=aupdated?" & PID & """ method=""post"" name=""upload"" enctype=""multipart/form-data"" OnSubmit=""return CheckNewRequest1(); return ShowProgress();"">" & vbCrLf)
0
 
LVL 1

Author Comment

by:dba123
ID: 12313299
this is before the form...the PID is returning a value if I print it to the screen

Set UploadProgress = Server.CreateObject("Persits.UploadProgress")
PID = "PID=" & UploadProgress.CreateProgressID()
barref = "framebar.asp?to=10&" & PID
0
 
LVL 23

Expert Comment

by:apresto
ID: 12313340
try using single quotes when inside a tag within an ASP tag:
%<

"<FORM name='name' action='...'>" & etc
0
 
LVL 1

Author Comment

by:dba123
ID: 12313347
we aren't using single quotes here.....I am keping to the standard.  I used to use single quotes also but now using double.
0
 
LVL 1

Author Comment

by:dba123
ID: 12313375
We are using Response.Write so we have to use double quotes...I'm sticking to Response.Write.
0
 
LVL 6

Assisted Solution

by:boblah
boblah earned 500 total points
ID: 12313376
dba123,

two sets of double quotes puts a single set of double quotes in the existing string.

One set of double quotes ends the string.

You have two sets to the left of the PID, when you actually need to close the string, and append the PID.

"<form action=""chav.asp?action=aupdated?" & PID & """ method=""post"" "

will produce

<form action="chav.asp?action=aupdated?XX" method="post"

(where PID = XX)

where

"<form action=""chav.asp?action=aupdated?"" & PID & """

will produce

<form action="chav.asp?action=aupdated?" & PID & "
0
 
LVL 6

Expert Comment

by:boblah
ID: 12313404
dba123,

Add the following line before the form write, and post the source of the resulting document for the form and the bit before.

Response.Write(PID)
0
 
LVL 1

Author Comment

by:dba123
ID: 12313436
yea, that's what I was saying...I was printing PID to the screen and it returned a valid number...outside of my sub since the 3 lines below were outside my sub so I thought that PID would then be global.

but what I had to do is move the lines below to be inside my sub.  for some reason, my sub wasnt' recognizing PID.

Set UploadProgress = Server.CreateObject("Persits.UploadProgress")
PID = "PID=" & UploadProgress.CreateProgressID()
barref = "framebar.asp?to=10&" & PID
0
 
LVL 1

Author Comment

by:dba123
ID: 12313531
yea, I always understood that "" = " and knew that " was an escape character but I guess sometimes it gets confusing...even when you've done it a million times.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question