Links With ID
Suppose I have links in one page called showlinks.asp . The other page have links like showlinks.asp?ID=101.How to open the links from such ID?I really liked this because it's secure.Also How can we make the page not viewable from simply typing http://someurl.com/showlinks.asp ?
Please Advice
Dibyendra
Dibyendra Hyoju
Busy posted this at 03:01 — 12th November 2002.
He has: 6,151 posts
Joined: May 2001
Welcome dibyendra,
I don't know .asp, but PHP is kind of similar, say you have showlinks.php?id=101 on the showlinks.php page you could have an array, if/else, switch options to go through matches to display the result.
example (if/else)
Suzanne posted this at 03:02 — 12th November 2002.
She has: 5,507 posts
Joined: Feb 2000
The way to do that is to create a script in ASP that reads the ID and then delivers the url either through a meta refresh or a header redirect or a new window.
In order to prevent someone from accessing the script directly, you can set the script to redirect empty queries to a page explaining how it work, or back to the page with the links on it, or to display an error message. You can also set it to check for the referring page to be the one on your site, so people cannot abuse the script for their own purposes (which would be hacking your server...)
You will need someone who knows how to program ASP, which is a server-side language.
Abhishek Reddy posted this at 03:10 — 12th November 2002.
He has: 3,348 posts
Joined: Jul 2001
I'm guessing that a Select Case will do the trick-
Select Case ID
Case 100
'show what you want for 100
Case 101
'show what you want for 101
Case Else
'default output - blank
End Select
And welcome to TWF.
Mark Hensler posted this at 06:13 — 12th November 2002.
He has: 4,048 posts
Joined: Aug 2000
expanding on Abhi's SELECT CASE..
<%
Select Case ID
Case 100
' redirect to another page
Response.Redirect "id100.asp"
Case 101
' include contents of another page
%><!--#include virtual="id101.asp"--><%
Case Else
' print something
Response.Write "Page not found"
End Select
%>
Mark Hensler
If there is no answer on Google, then there is no question.
The Webmistress posted this at 15:05 — 13th November 2002.
She has: 5,586 posts
Joined: Feb 2001
Does this help you at all?
openmind posted this at 20:19 — 13th November 2002.
He has: 945 posts
Joined: Aug 2001
I.m only doing this coz I'm difficult!!
In ColdFusion it would be:
<!---Make sure ID has been passed--->
<cfif NOT IsDefined("ID")>
<cflocation="index.cfm">
</cfif>
<!---If the ID has been passed, let's assume your URL is in a datbase--->
<!---First get the ID and the link--->
<cfquery datasource="DSN" name="Jump">
SELECT ID, Link
FROM LinksTable
WHERE ID = #ID#
</cfquery>
<!---Now just relocate the user to that link--->
<cfoutput query="Jump">
<cflocation="#Link">
</cfoutput>
Always more than one way to skin an elephant! No thats not it....A racoon, nope,....er...cat?
dibyendra posted this at 23:51 — 13th November 2002.
They have: 3 posts
Joined: Nov 2002
Thank You All Guys For Helping Me.
I really Appreciated Your Help.
Hey zollet yeah I'm A very Beginner but i'm very interested in ASP Programming.Nevermind zollet .
Dibyendra
Dibyendra Hyoju
zollet posted this at 00:02 — 14th November 2002.
He has: 1,016 posts
Joined: May 2002
That's all I wanted to know
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.