Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics 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 January 16th, 2006, 07:05 PM
Registered User
 
Join Date: Jan 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default script to tally cookies

hi i was wondering how to keep a running tally of inputed numbers through form using cookies

my thought is you have a form and you input a number

and the output becomes

You have added 0
Your previous tally was 0
Your new tally is 0

what pieces of code would i need i know you have to convet cookies with the
dblInput
dblCookie
functions but i dont know where to start.

thanx for the help prior

 
Old January 17th, 2006, 01:48 AM
Registered User
 
Join Date: Jan 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

can anybody help me with this plz


 
Old January 17th, 2006, 01:57 AM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

mmmmmm, what are you trying to achieve and why would you want to use cookies?

isnt this:

dblInput
dblCookie

Visual Basic syntax?

Can help you achieve this with classic ASP and VBScript, is this what you want?

BTW: You are not in the .net area if thats what your code is to be

Wind is your friend
Matt
 
Old January 17th, 2006, 03:29 AM
Registered User
 
Join Date: Jan 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes that is what i meant asp and VB script sorry for that its not asp.net just asp im in an asp class that asks for us to create a simple asp page that stores inputed numbers with cookies so you submit a value into the form and it outputs

You have added 0 (number just entered)
Your previous tally was 0 (last number entered)
Your new tally is 0 (all numbers added stored in cookies added together)

the html for the page is

<html>
<head>
<title>Cookie Tally</title>
</head>
<body>
<center>
<h2>Cookie Tally</h2>
<form>
  <p>Please enter a number:
  <input type="text" name="strValue">
  <input type="submit" value="Add to my tally" ></p>
</form>
</body>
</html>

ive tried using functions like
dblCookie and dblInput because you have to convert the cookies so they become numbers i just dont know where to start.

thanx for the help

 
Old January 17th, 2006, 06:24 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

This page lists the built-in conversion functions for VBScript: http://msdn.microsoft.com/library/de...6cfd0a3fe1.asp

HTH,

Chris

 
Old January 17th, 2006, 11:20 AM
Registered User
 
Join Date: Jan 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thank you but can anyone give me some hard code to look at i dont like msdn that much

 
Old January 17th, 2006, 01:13 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

If you don't like MSDN a simple Google for "conversion functions vbscript" will return you the names of the functions you need. By the look of things you are after CDbl or CLng

Cheers,

Chris

 
Old January 17th, 2006, 02:40 PM
Registered User
 
Join Date: Jan 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

any way you can show me some simple script that i can put into this page






Similar Threads
Thread Thread Starter Forum Replies Last Post
tally? ealkurabi C++ Programming 1 April 2nd, 2005 05:23 PM
Help!About Cookies jelsen ASP.NET 1.0 and 1.1 Basics 2 September 9th, 2003 08:36 AM
Call and run CGI script from a PHP script ... how? dbruins BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 June 10th, 2003 03:09 PM





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