How can i display/store data without login?? (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


kinyee -> How can i display/store data without login?? (4/6/2008 21:11:19)

i planning to show a teacher name in a page which is for visitor view but the page also can see the teacher name when i click in.

an example now i m in index.asp i click to studypackage.asp then at the studypakckage.asp it will show some book which i have already type and database teacher name from database!!!!

WHAT IS THE CODING STATEMENT I HAD TO PUT??[:)]THANKS




crosscreek -> RE: How can i display/store data without login?? (4/7/2008 15:39:47)

You many need to give more detail of what you want...database type your current code.....

If you don't have a login statement at the top of your page then you shouldn't have to login. It depends on your set up.

This is all dependent on your setup & database, but you will need a Query with code that will display the teachers name from the database & hyperlink that will transmit the teacher's id to the studypack.asp


Dim sql, objrs
SQL = "Select teacher, ID From tableteacher"
Response.write "Debug SQL: " & sql & "" <----this will show yo what your query is outputting...remove when works.
set objrs = conn.execute(SQL)

If objrs.eof then
response.write "no teacher listed"
Else
Response.Write "Please select teacher below<BR>"
Do While Not objRS.EOF
Response.Write "<a href=""studypack.asp?id="&objRS("id")&""">"&objRS("teacher")&"</a><BR>"
objRS.MoveNext
Loop
End if
conn.close
set conn = nothing.

Studypack page

TeacherID = request.querystring("ID") <---this will select of the teacher that the person clicked on.

Then you will kinda do the same.

Query codeing Select * from studytable WHERE teacher ID = teacherID

Then you can display what you want.. naturally theres much more to it then that, but this will give you an idea of the process.









Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.0625