Solved

Quotes problem

Posted on 2004-10-14
12
217 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
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 95

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
 
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

757 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now