[thelist] asp regexp/substring

Norman Beresford n.beresford at anansi.co.uk
Fri Oct 26 09:19:50 CDT 2001


Because my regexp is so flakey I'd do it differently

strFromPage = request.servervariables("HTTP_REFERER")
strFromPageArray = Split(strFromPage, "/")
strFromPageArrayCount = Ubound(strFromPageArray)
pageName = strFromPageArray(strFromPageArrayCount)

Bob's ya uncle.  Not elegant, and I'm sure it's a terrible waste of server
resources!

HTH

Norman


> -----Original Message-----
> From: thelist-admin at lists.evolt.org
> [mailto:thelist-admin at lists.evolt.org]On Behalf Of Les Lytollis
> Sent: 26 October 2001 15:19
> To: 'thelist at lists.evolt.org'
> Subject: [thelist] asp regexp/substring
>
>
> Hi All,
>
> Can anyone tell me how I get the pagename in a URI using VBScript?
>
> Example:
> strFromPage = request.servervariables("HTTP_REFERER")
> which gives
> http://thedomain.com/somefolder/thepage.asp
>
> how do I check if "thepage" is the name of the page?
>
>
>
> TIA
> Lez
>
> --------------------------------------
> Lez Lytollis
> Internet Developer, Morse Professional Services
> Morse Group Ltd
> Tel: +44 (0)1332 826029 Fax: +44 (0)1332 826044
> www.morse.com
>
> This email and any attachments are confidential and are intended only for
> the addressee. If you are not the intended recipient of this
> email and have
> received it in error, please notify the sender immediately by reply email
> and then delete it from your system.
>
>
> > -----Original Message-----
> > From: me [mailto:me at cgiguy.com]
> > Sent: 24 October 2001 19:55
> > To: thelist at lists.evolt.org
> > Subject: Re: [thelist] auction site integration
> >
> >
> > Les,
> >
> > i once wrote a cgi for a stock trader in LA.
> > He wanted to submit a message to multiple "message board" type
> > websites. We ended up with a single page whereby he could enter
> > a message in a textarea box, click one or more checkboxes to tell
> > the cgi which message sites to send the message to. The cgi would
> > then:
> >
> > a) automatically create a new login account for each site. (if needed)
> > b) login to each site. (if needed)
> > c) navigate thru the site and post the message.
> >
> > It was nothing short of challenging to do this. In a nutshell, what i
> > built was nothing short of a browser simulator. The websites actually
> > thought i was a netscape browser coming to their site. I
> > think that i let
> > them
> > think that i was netscape. for what its worth, there are
> > trivial differences
> > as to how the different browsers negotiate cookies, etc.
> >
> > Anyway, yes, it would be possible for you to automatically submit
> > anything to any site. The way i did it, you basically have to manually
> > open a socket to the site, read the site's html(just like a
> > browser would)
> > and then react accordingly.
> >
> > I've actually gotten a request, though i dont have the fine
> > details yet, to
> > write some code that would know how to automatically buy and/or
> > sell via several major stock exchanges/sites around the
> > world. The idea
> > would be for my code to look for certain patterns and then act
> > accordingly. Maybe when X happens at a particular exchange,
> > do something
> > else, maybe buy or sell at another exchange. it sure sounds fun.
> >
> > When i wrote the message board distribution code, i wrote a simulated
> > web server that, when called by netscape for example, allowed me to
> > see exactly what netscape was sending to the webserver. This way, i
> > knew exactly what to send to the message board via my cgi.
> >
> > Funny thing is, the stock trader that i wrote the message submission
> > code for, he foolishly flooded the message boards with so
> > many messages
> > that it almost made him look stupid. i told him, but he did
> > not listen.
> > he ended up looking like a common spammer. onward forward.
> >
> > by the way, its a lot easier to do such a thing in a lower
> > level language,
> > such as c. and unix only makes it just that much easier too.
> >
> > And, keep in mind, that my methods dont rely on any kind of API
> > whatsoever. In fact, it really matters to me none if the site
> > in question
> > even approves of my automatic submissions. Hell, thats what makes
> > it fun. But, if their site layout changes, you will need to make some
> > modifications to your site too. But also if you are careful about how
> > you code it, they can make minor changes to their site and your
> > auto submit code will still run.
> >
> > And, there may be easier ways to accomplish this...
> > I focus primarily on the lower level stuff. Thats all.
> >
> > later.
> > me.
> > Nuevo Laredo, Mexico.
> >
> >
> >
> > ----- Original Message -----
> > From: Les Lytollis <les.lytollis at morse.com>
> > To: <thelist at lists.evolt.org>
> > Sent: Wednesday, October 24, 2001 6:26 AM
> > Subject: [thelist] auction site integration
> >
> >
> > > Hi Evolters,
> > >
> > > I am trying to build some functionality into a site built
> > for collectors
> > and
> > > traders which will allow them to store or enter their
> > account details
> > (for,
> > > say eBay) on their own site, which would then allow them to
> > seamlessly
> > > upload content from their own database (or whatever
> > datastore) to their
> > > auction site account without having to re-enter all the
> > details (at, say
> > > eBay).
> > >
> > > As an example, a collector (OK, me;)) has a hundred comics
> > to sell which
> > are
> > > all stored in a mySQL database. Using his own content
> > management system
> > > (built in PHP), the collector would be able to select ten
> > of these comics
> > > and click a "publish to eBay" (or QXL, whatever) button and
> > the comics
> > would
> > > be published under the seller's account on the auction site and also
> > > displayed on his own site with a link to each auction.
> > >
> > > Does this mean I would have to contact each site and get
> > some sort of API,
> > > or is it fairly trivial to template the site forms and just
> > convert the
> > info
> > > from the seller's db (in XML?), passing login details along with the
> > > content?
> > >
> > > Lot's of questions and fairly vague, I know - but if I can
> > at least get
> > some
> > > directed questions from you guys, it will help me work out
> > where I am
> > going
> > > with this.
> > >
> > > TIA
> > > Lez
> > >
> > > <tip author="lez" type="php">
> > >
> > > Never discount the usefulness of phpinfo.
> > >
> > > If you have errors like "can't connect to tmp/sock/mysql",
> > use it to check
> > > that php is using the copy of php.ini that you think it is
> > (Configuration
> > > File (php.ini) Path).
> > >
> > > </tip>
> > >
> > >
> > >
> > > ---------------------------------------
> > > For unsubscribe and other options, including
> > > the Tip Harvester and archive of TheList go to:
> > > http://lists.evolt.org Workers of the Web, evolt !
> >
> >
> > ---------------------------------------
> > For unsubscribe and other options, including
> > the Tip Harvester and archive of TheList go to:
> > http://lists.evolt.org Workers of the Web, evolt !
> >
>
> ---------------------------------------
> For unsubscribe and other options, including
> the Tip Harvester and archive of TheList go to:
> http://lists.evolt.org Workers of the Web, evolt !
>





More information about the thelist mailing list