PDA

View Full Version : Using database to display different information?


chrisgray999
10-09-2002, 05:42 PM
Hi, following my post on the Javascript (http://www.codingforums.com/showthread.php?s=&postid=34832#post34832) forum, I would like to be able to use a url to display different infomation.

What i would like is a url which says "http://www.mysite.com/display.asp?ID=1" From this, I would like an image and some text to be displayed, prefably in a table as shown below:

Blue : ***image***
Red: No
Green: ***image***

and so on. If the URL would be different, it would display different text and images.

An example of what I would like is on http://www.esato.com/phones/?phone=21 (according to the number, a different phone is displayed).


Thanks very much for your help. I hope it is not too much trouble! :D

Chris Gray

http://www.plusmedia.tk

whammy
10-09-2002, 06:20 PM
Can you use a server-side scripting language? If not, I have an example of how you can get the value from a querystring in javascript here (http://www.codingforums.com/showthread.php?s=&threadid=7538). :)

chrisgray999
10-10-2002, 01:41 PM
Thanks, Yes I can use a simple form of ASP which http://www.brinkster.com is compatable with.

Thanks for your help

Chris

whammy
10-10-2002, 04:51 PM
Is it a paid account or a free one? Because if it's a paid account, you can use an Access DB which will greatly simplify things.

If not, you can always use Scripting.FileSystemObject and keep the information you need in a text file, but that makes it a little more difficult...

Basically all you need to get the variable from the querystring is:

ID = Request.QueryString("ID")

...and go from there.

chrisgray999
10-10-2002, 09:52 PM
Its a free account.

What do you mean when you use the asp function? I don't know asp at all. Is there a website where I can download this asp script? Thanks :D

whammy
10-11-2002, 01:00 AM
If you don't know ASP at all, I would check out some scripts at:

http://www.liquidrage.com
http://www.w3schools.com/asp
http://www.haneng.com

for starters... the only thing is, you're going to run into a LOT of examples that use a database - and you can't do that on a free account at brinkster (but you CAN store information in text files on a free account). :|

For some good tutorials, check out http://www.webmonkey.com/authoring as well.

chrisgray999
10-11-2002, 12:44 PM
Brilliant, Thanks very much.

btw I registered on your website! its a nice site! :D

whammy
10-11-2002, 06:59 PM
Thanks! Wait until the redesign is done... it's going to be nicer (functionality-wise, too). :D