Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Simple Parsing of string

by Anonymous Monk
on May 12, 2000 at 02:09 UTC ( [id://11212]=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This question is related to How to get into $ENV{'QUERY_STRING'}?. I thought I knew how to handle this, but I am having trouble. When a person goes through and selects the jobs that they wish to apply for, that information will get appended to the end of the url as they step through each screen to apply for a job. The url will look like this: foo.com/cgi-bin/job.pl?STXXXX+STXXXX+STVVV+STAAAA They may select 1 job or they may select 25 jobs. When they get to the last page of the application process, I would like to able to query the job database for each of this jobs and display some information about each one: for instance You are applying for ST1256 - Perl Programmer in Juneau, Alaska, ST3009 and JavaScript Programmer in London, England, etc. Also in the e-mail that gets sent back to us, I want to have links to the text version of the specific job on our intranet, so the recruiters can just click and go right to each job opening that this person is interested in. So how do I get each job id seperated so that I can do this... I have these scripts all done where people can just select one job and apply and where it queries the database and returns the above info, but having a hard time getting this to work with more than one. Thank you all for your help....

Replies are listed 'Best First'.
Re: Simple Parsing of string
by plaid (Chaplain) on May 12, 2000 at 02:16 UTC
    I'm not sure if I am understanding your question correctly, but it seems like you're just looking for a way to split the '+' delimited query string into an array? If this is the case, all you'd need to do is
    my @job_ids = split(/\+/, $ENV{'QUERY_STRING'});
    Then, you can do database queries, create text links, etc., on each of the @job_ids. Let me know if I'm grossly misunderstanding your question.
      Yes, this is exactly what I needed. Thanks.
Re: Simple Parsing of string
by Specimen (Acolyte) on May 12, 2000 at 14:03 UTC
    Hi
    Wouldn't setting cookies be a much nicer way to do it ? That way clicking the back button in the browser wouldnt result in a lost jobid. I quite often use the back button to get back to a previous point in my surfing so i can follow another branch off a page.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://11212]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-19 19:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found