Closed Thread Icon

Topic awaiting preservation: variable, search and display (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=25031" title="Pages that link to Topic awaiting preservation: variable, search and display (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: variable, search and display <span class="small">(Page 1 of 1)</span>\

 
rayzun
Neurotic (0) Inmate
Newly admitted

From:
Insane since: Feb 2005

posted posted 02-16-2005 22:28

need some direction, searching a file, each line is seperate in a stored text file.
Using a variable in the address: db_id=1392
http://domain.com/cgi-bin/cs/cs.cgi?db_id=1392

Display select text from this file:
/home/2015/public_html/cgi-bin/data/As.data

As.data file contains:
1392|macdonald|01/15/2005|Gerry M|Private Seller|FOR SALE:|1997 Ford Mustang|Red with black interior

example url:
http://domain.com/cgi-bin/cs/cs.cgi?db_id=1392

example HTML on page:
<title>1997 Ford Mustang - Private Seller
</title>

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 02-16-2005 23:21

Depends. Are we talking php here? Or perl Or just anything?

either way, it's loading the file, exploding it on newlines, looping through lines till you found the one starting with
db_id|, then explode that on '|', print appropriatly.

Directions enough?

so long,
->Tyberius Prime

PS: Welcome to the Asylum. Please make sure to have a look at our ->faq. Much good stuff in there.

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 02-17-2005 00:21

The perl way

Simply because you referenced cgi-bin

rayzun
Obsessive-Compulsive (I) Inmate

From:
Insane since: Feb 2005

posted posted 02-17-2005 21:46

thanks for the direction..
Im still on this idea, Im trying php stuff, another code starts with

#!/usr/bin/perl

use CGI ':standard';
####

other code found in the template txt file is shown like:

<META name="keywords" content="%%KEYWORDS%%">

so basically
http://domain.com/cgi-bin/cs/cs.cgi
is the file for all other pages

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 02-17-2005 22:01

Umm you really need to explain more in your posts.

« BackwardsOnwards »

Show Forum Drop Down Menu