37 users online (0 members and 37 guests)  


  Results 1 to 3 of 3

Related

  1. Help with SQL query    Forum: Databases
    Replies: 1
  2. query    Forum: HTML Forum
    Replies: 1
  3. Replies: 2
  4. help in formatting a query    Forum: PHP Forum
    Replies: 1
  5. My sql query    Forum: PHP Forum
    Replies: 0
  1. #1
    ChrisX's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2007
    Posts
    2

    Query String-Dependant Page

    I'd like to know how to create a Perl page based on query strings. For example, I want a 'Showdata.pl' page, but it will only show something if there is a query string, such as 'ID=100'. Otherwise it will mention 'No data specified'. Problem is, I don't know where to start. Can anyone help me?

    Thank you.

  2. #2
    pageBuzz.com's Avatar
    New User

    Status
    Offline
    Join Date
    Oct 2006
    Posts
    21

    Re: Query String-Dependant Page

    There are many ways to do anything and being more specific is always better for more detailed answers.

    You can parse a querry string the same as any form input. So there is no difference in parsing a post or a querry as long as you use the same format.

    $name=$value&

    Just use the standard form parsing subrountine.

    If you want to specify a file to open try

    $file = $ENV{'QUERY_STRING'};

    open FILE, "<$file";
    ($data1,$data2,$data3) = <FILE>;
    close FILE;

    print "$data1 or $data2 or $data3";

  3. #3
    xmassey's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Apr 2007
    Posts
    100

    Re: Query String-Dependant Page

    $id = "100"
    if ($id == 100) {
    print "ID is 100";
    }
    else {
    print "ID is not 100";
    }

    Do you mean something like this? But the other responder is right, you have to be more specific



Tags for this Thread