Print Page | Close Window

Help please

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=13674
Printed Date: 30 March 2026 at 1:25pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Help please
Posted By: Barabbas
Subject: Help please
Date Posted: 06 February 2005 at 2:03pm
I'm after some help(how to) to grab text from some form submited text which is pasted into a textarea, below is the text i'm working on and wish to extract the bold text into seperate variables for processing into a database or maybe XML...Note that the involved parties could be anything from 1 to more than 20!
 
2004.10.11 23:57:00
Victim: Victim Name
Corporation: VICTIMCORPNAME
Destroyed Type: VICTIMS SHIP
Solar System: AAA-123
System Security Level: 0.0
Involved parties:
 
    Name: My Name (laid the final blow)
    Security Status: 0.8
    Corporation: My Corp
    Ship Type: My Ship
    Weapon Type: Big Gun Mk2
 
    Name: Friends Name
    Security Status: 1.2
    Corporation: Friends CorpName
    Ship Type: Friends Ship
    Weapon Type: Big Gun



Replies:
Posted By: dj air
Date Posted: 06 February 2005 at 2:10pm
set a veriable for example

strVictim = Request.form("victim")

within the "" for the request.form section you need to type the name of the field (the name of the form submitted from)

then after that point strVictim will have the value of the form field.. so you are then able to add it to a database etc.

you can subsiture form for querystring is passing values via querystring, also cookies you can pass and retrive cookes the same way.


Posted By: Barabbas
Date Posted: 06 February 2005 at 2:16pm
There is only 1 form field, the textarea where all the text is pasted into.
It would be too easy to just create all the different form fields for each variable needed but it would be too tedious and long to enter the text into each field, especialy if theres more than 20 involved parties!
 
I need to loop on the submited text and grab the different variables for the bold text above...like a parser etc


Posted By: Gullanian
Date Posted: 06 February 2005 at 9:26pm
There are lots of built in functions at your disposal to parse data files like the one above, such as:

mid()
left()
right()

Look them up on w3schools.com for details on their use.  Be careful though, unless your parser is written very well small syntax errors could cause errors when inputting the data.


Posted By: Phat
Date Posted: 11 February 2005 at 4:46am
try usiing split()



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net