|
 |
asp_web_howto thread: "Add to Favorites" problem
Message #1 by "taherm@f... on Tue, 19 Jun 2001 10:44:25
|
|
Scenario
when ever we go to a site we can save the url by clicking teh add
favorites button and the url gets saved in the favorites folder. i want to
do the same but it should get saved in a table in my access db so taht i
can then access it through ASP/ADO .
basically i am designing a web based application where each user can save
a url. this information should be shared by other users as this url will
be saved in a DB.
First of is the above possible and if yes then how can i achieve it.
thankyou very much for your advice.
taher
Message #2 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Tue, 19 Jun 2001 11:42:07 +0100
|
|
yes, its certainly possible
put something this in each page
<FROM METHOD=3D"POST" ACTION=3D"addfavourites.asp">
<SCRIPT language=3D"javascript">
document.write("<INPUT TYPE=3D'HIDDEN' NAME=3D'url' VALUE=3D'" +
document.location.href() + "'>");
</SCRIPT>
<INPUT TYPE=3D"SUBMIT" VALUE=3D"Add URL to Favourites">
</FORM>
then your addfavourites.asp takes this form
<%
Dim sURL
sURL =3D Request.form("url")
'code here to add to DB
%>
<HTML>
<HEAD>
<% if len(sURL)>0 then %>
<SCRIPT language=3D"javascript">
window.navigate("<%=3DsURL%>");
</SCRIPT>
<% end if %>
</HEAD>
<BODY>
Error: no URL supplied
</BODY>
</HTML>
Alternatively you could just have a link to the ASP and get the URL
from
HTTP_REFERER, but I'm not sure how relaible that is.
If the refering pages are on the same server then you could extract the
relative path and use response.redirect, which would be quicker.
-----Original Message-----
From: taherm@f...
[mailto:taherm@f...]
Sent: 19 June 2001 11:44
To: ASP Web HowTo
Subject: [asp_web_howto] "Add to Favorites" problem
Scenario
when ever we go to a site we can save the url by clicking teh add
favorites button and the url gets saved in the favorites folder. i want
to
do the same but it should get saved in a table in my access db so taht
i
can then access it through ASP/ADO .
basically i am designing a web based application where each user can
save
a url. this information should be shared by other users as this url
will
be saved in a DB.
First of is the above possible and if yes then how can i achieve it.
thankyou very much for your advice.
taher
Message #3 by "Taher Moiyed" <taherm@f...> on Tue, 19 Jun 2001 18:39:16 +0100
|
|
hi alex shiell
thanks a million times your idea does work out.
taher
|
|
 |