SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict seanmayhew's Avatar
    Join Date
    Aug 2002
    Posts
    209
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ASP Pulling Email from access

    I have a database that has an email column that either contains an email address someemailaddy@mail.com or a value "n/a" All I want to do is loop through the column in ASP by checking to see if the "@" is in the address and if it is feed the email address into a mailto: href tag

    I think something is wrong with my code because it just returns the name but not the href.

    <% IF InStr(1, contactObjRS("Email"), "@") = 1Then %>
    <a href="<A href='mailto%=contactObjRS("Email'>mailto%=contactObjRS("Email") %>"><%=contactObjRS("FirstName") %>
    <%Response.Write(" ") %>
    <%=contactObjRS("LastName") %></a></font>
    <% Else %>
    <%=contactObjRS("FirstName") %>
    <%Response.Write(" ") %>
    <%=contactObjRS("LastName") %>
    <% End If %>



    Any help would be greatly appreciated.

  2. #2
    SitePoint Zealot fmavituna's Avatar
    Join Date
    Apr 2003
    Location
    istanbul
    Posts
    139
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Could you try this;

    Code:
    <% IF InStr(contactObjRS("Email" ), "@") > 0 Then %>
    <a href="<%=contactObjRS("Email")%>"><%=contactObjRS("FirstName" ) %> </a>
    <%Response.Write(" " ) %>
    <%=contactObjRS("LastName" ) %></a></font> 
    <% Else %>
    <%=contactObjRS("FirstName" ) %> 
    <%Response.Write(" " ) %>
    <%=contactObjRS("LastName" ) %> 
    <% End If %>

  3. #3
    SitePoint Addict seanmayhew's Avatar
    Join Date
    Aug 2002
    Posts
    209
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Worked perfect Thank You!

  4. #4
    SitePoint Zealot fmavituna's Avatar
    Join Date
    Apr 2003
    Location
    istanbul
    Posts
    139
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you're welcome


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •