Just nu i M3-nätverket
Jump to content

Komma åt poster i ACSII databaser m CGI

Jonas Reppe

Recommended Posts

OK! Jag är lat, men jag antar att de flesta som genomgått det svenska skolväsendet behärskar engelska. Jag har postat detta på ett antal nyhetsgrupper och orkar inte översätta det, men... här kommer det:



I'm using a database admin script to administer a ASCII flatfile database.


I want to get specific content in a database on a web page using a Perl/CGI


linked in the HTML.-page through SSI. This is not a problem. The problem is


get a script that does the extraction of the specific data and displays it

on a new page.


The database is not complex in any way. It contains several rows where each


represents a post in the database with multiple fields separated by a

"sun-sign" (¤)

Here's an example of how it's structured:


ID¤Name¤Address¤Zip-code¤Phone¤Cell Phone¤Pager

1¤Mr Tester¤Test Avenue 1¤555 55¤555-55 55 55¤777-77 77 77¤888-88-88-88

2¤Mr Tester2¤Test Avenue 2¤555 56¤555-55 55 56¤777-77 77 76¤888-88-88-86




The script I want works like this:


The first CGI-script (not the one I want) is included with SSI into an


HTML-page and that CGI builds a page with contents from the

database. Selected fields from every record in the database generates a link


the page that is created. Then I want the user to be able to

click the link to display that specific record with all fields that the link

represents. I.e. check the ID of the link that the user has clicked and

fetch all the info in the database for the post that the ID represents.



1) The HTML-page is generated and gets database data through a CGI-

script (already present) and every link that the script puts on the


is for example called


"Record 1"

"Record 2"

"Record 3"

"Record 4"

"Record 5"


and so on as in the database structure example above


The generated link "Record 1" has the URL


the generated link "Record 2" has the URL


(I'm done so far!)


2) When the user clicks a link the script that is called should find the

correspontent ID and display all the fields in that record on a new page.

No user verification or security is neccesary.


Is there anyone out there that has got the solution?


Thanks in advance!




Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...