Free For all Link Page (.asp)

Files needed

index.shtml (or index.asp)
    this file will be the result of adding the content of the next three files:

        head.txt
               the html code of the first part of "index.shtml".
        links.txt
                the file containig all the links
        tail.txt
               the html code of the final part of "index.shtml".

addurl.asp
    this files allows adding new files to the Free For All Link Page.
 

All files must be save to a directory named "Links".
You may customize the files head.txt and tail.txt to meet your needs.
Please, do not remove the link to my site from the system.

index.shtml
<!--#include virtual="/Links/head.txt" -->

<OL>

<!--#include virtual="/Links/links.txt" -->

</OL>
<HR>
<form method=post action="/Links/addurl.asp">
<CENTER>
Add a new link
<TABLE BORDER=0>
<tr>
<td>Title</td>
<td><input type=text size=45 name=title Maxlenth=100></td>
</tr>
<tr>
<td>URL</td>
<td><input type=text size=45 name=url Maxlenth=256 value="http://"></td>
</tr>
<tr>
<td>Description</td>
<td><input type=text size=45 name=description Maxlenth=256></td>
</tr>
</TABLE>
<input type=submit value=Submit>
</center>
</form>

<!--#include virtual="/Links/tail.txt" -->


head.txt
<html><head><title>Links Page</title>
</head>
<body bgcolor="#FFFFFF">
<center><BR>
<table BORDER=0 COLS=2 WIDTH="500"><tr><td ALIGN=CENTER BGCOLOR="#AAAAFF" COLSPAN=2>
<font face="Times New Roman,Times" color="red" size=7><b><i>My Links Page</i></b></font><br><font face="Times New Roman,Times" color="green" size=4><b><i>The place to find the very new</i></b></font>
</td></tr>
<tr><td>
<HR>

tail.txt
<HR></TD></TR></TABLE>

<!-- Please do not remove next two lines -->
<table BORDER=0 WIDTH="500"><TR><TD ALIGN=RiGHT><FONT SIZE=1>This script obtained from <A HREF="http://www.submitside.com">Submitside.com</A>.</TD></TR></TABLE>
<!-- Thank you -->

</CENTER>
</BODY></HTML>


addurl.asp
<!--#include virtual="/Links/head.txt" -->

<%
aa=Request.Form("url")
bb=Request.Form ("title")
cc=Request.Form ("description")

newlink="<LI><A HREF=" & aa & ">" & bb & "</A><BR>" & cc

badhtml=0
if instr(aa,"<")>0 OR instr(bb,"<")>0 OR instr(cc,"<")>0 OR instr(aa,">")>0 OR instr(bb,">")>0 OR instr(cc,">")>0 OR instr(aa,".")=0 then
badhtml=1
end if

if instr(aa,".")=0 OR aa="" OR bb="" OR cc="" OR len(aa)>256 OR len(bb)>100 OR len(cc)>256 OR badhtml=1 then %>

<CENTER>Please go back and check your data<BR>Some data are incorrect</CENTER>

<% else %>

<%
dim thelink(50)
Wfile=Server.Mappath ("/") & "\Links\links.txt"

Set fs = CreateObject("Scripting.FileSystemObject")
Set thisfile = fs.OpenTextFile(Wfile)
registeredlink=0
   for counter = 1 to 50
   thelink (counter)=thisfile.readline
   if instr (thelink (counter),aa)>0 then
   registeredlink=1
   end if
   next
thisfile.Close
set thisfile=nothing
set fs=nothing

if registeredlink=0 then
Response.write ("<OL>")
Set fs = CreateObject("Scripting.FileSystemObject")
Set a = fs.CreateTextFile(Wfile,True)
   for counter = 2 to 50
   a.WriteLine(thelink (counter))
   Response.write thelink (counter)
   next
   a.WriteLine(newlink)
a.Close
Response.write (newlink)
Response.write ("</OL><center><A HREF=/Links>Links Page</A></center>")
else
Response.write ("The link is already included in the list")
end if
%>

<% end if %>

<!--#include virtual="/Links/tail.txt" -->


links.txt (this file must contain 50 lines. In this case the first 49 lines are blank lines. If there are less than 50 lines you will get an error when the script is running)

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

<LI><A HREF=http://www.submitside.com>Free promotion</A><BR>Free url submision to top search engines. Webmaster: own your submission service.
 


 

AspTutorial.info