PDA

View Full Version : ASP Web Get/Post


greenace
05-17-2003, 01:23 AM
There is vry little information on using the Web Post/Get with ASP. Other users have asked, but I haven't found any good examples that I can make work.

I love SUF, but I need to authorize installations. Perhaps a sample PHP script, and I can muddle my way through that. Prefer ASP - Already know that pretty well.

Corey
05-17-2003, 01:55 AM
Indigo Rose uses PHP for 100% of our web stuff so as a result we are simply not fluent in ASP. Although we get an occasional ASP request, the overwhelming majority of our users appear to be using PHP also it's just a logical way for us to operate.

We apologize to any ASP users who need code examples and can't find them.Maybe we'll be able to address this at some future time but for the moment it's a PHP only environment.

That being said maybe we can still help, what exact problem(s) are you having trying to make this work? Please describe exactly what you have done so far to get this actionh working, and the results you received in the process...

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

greenace
05-17-2003, 09:16 AM
On 11/15/02 you replied to another user
"It doesn't matter what type of form you are submitting to, variables are all passed the same way, i.e. JSP, PHP, ASP. If Cold Fusion has some special syntax you'll need to create some sort of form to translate it, i.e. I use PHP to translate AMS data for MySQL. "

Perhaps that has now changed.

All I want to do is a simple install verification. I want to submit a couple of fields to the web page, validate the information against an MS Access Database, and provide a return authorization code, and expiration date. I would imagine this is quit common, and quite simple to do.

The ASP limitation is that the "<%" and "%>" characters are ASP directives - that is they are used in ASP to indicate a switch between ASP and HTML code. Another user 'kaylward' submitted what appeared to be a solution on 11-30-2002, but I havn't been able to get that to work.

Here is what happens - I do the web submit, it appears to communicate, but to verify if it is getting information back, I added the following to a subsequent screen.

From Web: %tusername%, %authorized%
Lasterror %LastErrorNum% - %LastErrorDetails% - %LastErrorMsg%

When this displays, it looks like:

From Web: %tusername%, %authorized%
Lasterror 0 - -

It looks to me like I am not getting an error, but I simply am not getting the variables %tusername% and %authorized%.

I feel quite certain it's the syntax of my return page because of the difficulty with the "<%" and "%>".

Any thoughts - I can help you with a basic ASP page so you can try it out if that would help.

Corey
05-17-2003, 05:52 PM
No nothing's changed. Everything is exactly like I said, but as I said we are unable to offer any ASP assistance simply because we are not fluent in it.

The program can easily handle any scripting lanuguage perfectly but I promise you that no software support team on earth provides support for PHP *and* ASP *and* JSP *and* Cold Fusion usage. That scenario simply does not exist, although if I knew ASP I would help.

So when you say you can supply me with an ASP page I'm not sure if you even read my first post. I don't do any ASP ergo we don't have it installed nor are we in the process of installing it. And accordingly I have no insights into ASP usage to offer at all. Sorry...

As you can see by the amount of users who have jumped in on this thread to help, no one seems to be using ASP. That's why I don't, not to mention that PHP is 39% faster than ASP in benchmark tests. If 95% of our users used ASP I would learn it, but asit happens about 95% of our users seem to be using PHP.

Surely you can understand my position.

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

Brett
05-18-2003, 02:20 PM
Is there a way to escape the "<%" and "%>" characters in ASP? Try poking around the Web a bit to find that out. In every programming language there is usually a way to escape special characters.

It is not that we do not want to support ASP or anything else out there, it is just that we don't have the resources to become proficient in all of the development tools and technologies out there. Like Corey says, we are mainly a PHP shop so that is the advice we give. However, there is all sorts of good information out there about ASP, JSP, etc.

greenace
05-19-2003, 08:24 AM
I have found no way to get away from the "<%" and "%>" characters in ASP. However, I have managed a solution. Evidently, building a series of small strings - then concatenating them together produces the desired output.

The following ASP code works with SUF.

<%
p1 = "<SUF60>"+"%OKtoinstall%,%ReturnText%,%expdate%,%WebKey%</SUF60>"
p2 = "<"+"%OKtoinstall%"+">" &amp; oktoinstall &amp; "</%OKtoinstall%"+">"
p3 = "<"+"%ReturnText%"+">" &amp; returntext &amp; "</%ReturnText%"+">"
p4 = "<"+"%expdate%"+">" &amp; edate &amp; "</%expdate%"+">"
p5 = "<"+"%WebKey%"+">" &amp; InstallKey &amp; "</%WebKey%"+">"

response.write p1
response.write p2
response.write p3
response.write p4
response.write p5
%>

Show this to any ASP Developer, and they can run with it.

As you can see, the code simply takes the string variable "<" and concatenates another string with the "%" to it. This fools ASP into producing the desired output of "<%" The same thing is done to produce the ">%" - put that together with the rest of the needed output, and the problem is solved.

SUF is once again - the favorite part of my development cycle.

Corey
05-19-2003, 12:40 PM
I think you'd have found Brett's approach better, there is always a way to escape characters in any scripting language, i.e. a backslash (Which I believe applies to ASP also) but hey as long as you're happy, all's well...

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

kaylward
05-19-2003, 03:14 PM
This is an issue that I have noted before. I didn't have any luck encoding the <% or %>, but if it can be done with the code shown, all the better. Next time the question comes up you'll have two threads to point to...

http://www.indigorose.com/ubbthreads/showflat.php?Cat=&amp;Board=UBB7&amp;Number=14626&amp;fpart=1&amp; PHPSESSID=

Corey
05-19-2003, 07:27 PM
Did you try using a backslash escape character?

Corey Milner
Creative Director, Indigo Rose Software (http://www.indigorose.com)

arthurb
06-07-2003, 12:01 AM
FYI, see http://www.aspfaq.com/show.asp?id=2100