In php we use the following code to block the url link passing via text boxes or textarea on form submit(For avoid bad link

passing from contact us form ).Is there any methode like this in classic asp using vb.

if($_POST['Register'])
{
    $username=$_POST['username'];
    if (preg_match('~(?:[a-z0-9+.-]+://)?(?:\w+\.)+\w{2,6}\S*~i', $username))
    {
         die('Access Denied Avoid Link');

    }
}

I use the following code in asp but shows error

<%@Language="VBScript%">
<%
Option Explicit

Dim Address 
Address = Request("Address") 

if(!preg_match("/^[a-zA-Z]+[:\/\/]+[A-Za-z0-9\-_]+\\.+[A-Za-z0-9\.\/%&=\?\-_]+$/i",& Address&))
{
Echo"Access Denied Avoid Link.";
Response.End
'Exit();
}
%>

Pls do help me .:-/

<asp:Repeater id="rpComments" runat="server">
<ItemTemplate>
<div class="comment">
<div class="from_admin"><%# (bool)DataBinder.Eval(Container.DataItem, "From_Admin") ? "<p>Admin Says:</p>" : "" %></div>
<div class="copy"><%# DataBinder.Eval(Container.DataItem, "Copy") %></div>
<div class="date"><%# DataBinder.Eval(Container.DataItem, "Date") %></div>

<!-- THIS IS THE TRICKY BIT HERE -->
<div class="rating">
<p>Agree: <%# DataBinder.Eval(Container.DataItem, "Agree") %> -
<asp:HyperLink id="linkAgree" onserverclick="linkAgree_OnClick" runat="server">I agree with this</asp:HyperLink></p>
Disagree: <%# DataBinder.Eval(Container.DataItem, "Disagree") %> -
<asp:HyperLink id="linkDisagree" onserverclick="linkDisagree_OnClick" runat="server">I disagree with this</asp:HyperLink></p>
</div>
<!-- /THIS IS THE TRICKY BIT HERE -->

<div class="report"><%# (bool)DataBinder.Eval(Container.DataItem, "Reported") ? "<p>Reported</p>" : "" %></div>
</div>

</ItemTemplate>
<SeparatorTemplate><hr /></SeparatorTemplate>
</asp:Repeater>

Web Design and Development

Seem to master, php I am beginning to learn, thank you for help

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.