Just nu i M3-nätverket
Gå till innehåll

Komma åt poster i ACSII databaser m CGI


Jonas Reppe

Rekommendera Poster

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:

 

Hi!

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

script

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

to

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

row

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

 

etc...

 

The script I want works like this:

 

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

ordinary

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

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

on

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.

 

Scenario:

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

HTML-page

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

"/cgi-bin/dbman/newcgiscript.pl?ID=1",

the generated link "Record 2" has the URL

"/cgi-bin/dbman/newcgiscript.pl?ID=2"

(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!

Regards,

Jonas

jokre@geocities.com

Länk till kommentar
Dela på andra webbplatser

Arkiverat

Det här ämnet är nu arkiverat och är stängt för ytterligare svar.

×
×
  • Skapa nytt...