Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Help please
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Help please

 Post Reply Post Reply
Author
Barabbas View Drop Down
Groupie
Groupie


Joined: 15 June 2002
Location: United Kingdom
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote Barabbas Quote  Post ReplyReply Direct Link To This Post Topic: Help please
    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


Edited by Barabbas - 06 February 2005 at 2:05pm
Back to Top
dj air View Drop Down
Senior Member
Senior Member
Avatar

Joined: 05 April 2002
Location: United Kingdom
Status: Offline
Points: 3627
Post Options Post Options   Thanks (0) Thanks(0)   Quote dj air Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Barabbas View Drop Down
Groupie
Groupie


Joined: 15 June 2002
Location: United Kingdom
Status: Offline
Points: 126
Post Options Post Options   Thanks (0) Thanks(0)   Quote Barabbas Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
Gullanian View Drop Down
Senior Member
Senior Member
Avatar

Joined: 04 January 2002
Location: England
Status: Offline
Points: 4373
Post Options Post Options   Thanks (0) Thanks(0)   Quote Gullanian Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
Phat View Drop Down
Senior Member
Senior Member


Joined: 23 February 2003
Status: Offline
Points: 386
Post Options Post Options   Thanks (0) Thanks(0)   Quote Phat Quote  Post ReplyReply Direct Link To This Post Posted: 11 February 2005 at 4:46am
try usiing split()
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.