ASP Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreASP Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 24th, 2012, 07:41 PM
dsfx dsfx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 65 dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 18 h 38 m 2 sec
Reputation Power: 15
Help me figure this code out.

Ok so i've got little to no JS experience. I'm learning as i go but not fast enough. I need some help deciphering what this is doing exactly. This vendor doesn't seem to like doing things the standard way and doesn't have any documentation for their services.

This is a snippet of code they sent me from another users site and said go to town...

I've included my specific questions as comments in the code.

Code:


if Request.QueryString("authtype").Item = "mobile" then

//clears any buffered output 
//Why would this be required?
Response.Clear()


if Request.QueryString("cn").Item <> "" then
cn = Request.QueryString("cn").Item
end if


if Request.QueryString("pn").Item <> "" then
pn = Request.QueryString("pn").Item
end if

if pn <> "" and cn <> "" then

//i don't understand this whole block.
//what is auth(), what is it checking and doing?
//What is the p.Item("RECORD#")for?
good = auth()
if good = true then
pt = p.Item("RECORD#")


Response.Write("OK:" & pt)

else 
Response.Write("Error: Bad card number or PIN")

end if

end if

Response.End()

else

good = auth()

if good = true then
//why is SC being set and not used?
sc = ""

//What is the p.Item("RECORD#")for?
pt = p.Item("RECORD#")

songurl = "http://www.website.com/libraries/patron/" & pt

Response.Redirect(songurl)
end if
end if


Any help would be much appreciated.

Thanks,
DSFX

Last edited by dsfx : October 24th, 2012 at 07:44 PM.

Reply With Quote
  #2  
Old October 24th, 2012, 07:56 PM
web_loone08's Avatar
web_loone08 web_loone08 is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Aug 2008
Posts: 599 web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level)web_loone08 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 1 Week 1 Day 12 h 40 m
Reputation Power: 69
I think your code is Internet Information Services (IIS) 6.0 - ASP Built-in Objects; you might want to start here; to read up on it's documentation: http://msdn.microsoft.com/en-us/lib...6(v=vs.90).aspx

Reply With Quote
  #3  
Old October 25th, 2012, 01:18 PM
dsfx dsfx is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2009
Posts: 65 dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level)dsfx User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 18 h 38 m 2 sec
Reputation Power: 15
Quote:
Originally Posted by web_loone08
I think your code is Internet Information Services (IIS) 6.0 - ASP Built-in Objects; you might want to start here; to read up on it's documentation: http://msdn.microsoft.com/en-us/lib...6(v=vs.90).aspx


Thanks for the info. No wonder why it wasn't making total sense.

DSFX.

Reply With Quote
  #4  
Old October 25th, 2012, 08:43 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,234 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 14 h 20 m 49 sec
Reputation Power: 4445
Also fyi the code you posted appears to be vbscript. // isn't a comment in vbscript, an apostrophe starts comment text in vbs.
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

Reply With Quote
  #5  
Old November 15th, 2012, 06:00 AM
bolainmarsh4 bolainmarsh4 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Posts: 2 bolainmarsh4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 43 sec
Reputation Power: 0
I remember doing this assignment, cheater cheater pumpkin eater.

In anycase, you have to create the methods for getIntWithinRange, which is the whole point to the course, its teaching you data validation.

I'm not going to do your homework for you but I will walk you through the computer logic steps.

1. Method getIntWithinRange takes in a Scanner sc, and two integers, one for the minimum range, and maximum range.
2. You need to code out how compare the "nextInt()" from the scanner with the min/max and if its a valid value, store that variable in "testScore".
3. The only answer I will give you is to include sc.next(); to discard a false value.

I will help you if you post your attempt at this method.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreASP Programming > Help me figure this code out.

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap