Click to See Complete Forum and Search --> : Linking Forms


melgjl
11-24-2006, 08:13 PM
Hi, I just have a question.

Currently, I am doing a Forum. My Forum have a Topic Page where by all the main categories are (e.g. General Discussion, Suggestions).

And, I have a Subject Page.

It goes like this. (User will click on a topic. And it will lead them to the subject page, reflecting subjects that is only under that Topic.)

I have a topic table and subject table.

So, how do i make sure it recognize that the User click on the topic 'General Discussion' so my subject page will reflect only topics under 'General Discussion'?

Do I use Foreign Keys to achieve that?

Any help would be appreciated! Thanks! :)

Terrorke
11-27-2006, 01:27 AM
Ok put on your topic pages some links like :


<a hef=subject.asp?topic=1>Topic 1</a>
<a hef=subject.asp?topic=2>Topic 2</a>
...


And on your subject.asp page :

dim topic
topic=request.querystring("topic")
sql = "select value form tbl_Topic where topiccat = '"&topic&"'"


Where topic (value 1 in this case) is the value of a topic category.

Hopes this will help you in the wright way.

melgjl
11-30-2006, 09:05 PM
hey thanks for the help. i have not tried yet. but will do so soon! currently overseas. :p

chrismartz
12-01-2006, 05:52 PM
If you are going to be passing information directly into your sql query I suggest that you make sure the information works and you check for sql injection.

topic = Replace(request.querystring("topic"), "'", "''")

russell
12-01-2006, 08:12 PM
If you are going to be passing information directly into your sql query I suggest that you make sure the information works and you check for sql injection.

topic = Replace(request.querystring("topic"), "'", "''")

good call. nice site by the way Chris!! :) well, you'll find php pretty easy to learn.

melgjl
12-06-2006, 11:32 PM
hi christmartz,

i do not understand the code you gave... haa... what it does?

Terrorke
12-07-2006, 01:15 AM
It is replace all the single quotes into double single quotes to prevent sql injection via your querystring.

Look at this thread : http://www.webdeveloper.com/forum/showthread.php?t=56764