Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy If Then statement confusion

    Hi, I'm trying to let only one user (590CENTER77701) has access to delete or edit a record from a database. I have all users logging in and maintaining their usernames in their browser session. So, I assume that you could compare the Session with the string 590CENTER77701 like below:

    <% If Session("UID") = "590CENTER77701" Then %>
    <a href="edit_a_debtee.asp?ID=<%=FP_FieldURL(fp_rs,"ID")%>">Edit</a> |
    <a href="deleteConfirm.asp?ID=<%=FP_FieldURL(fp_rs,'ID')%>">Delete</a>
    <% End If %>

    But when I try to view the page, I get the following error message:

    Microsoft VBScript compilation (0x800A03EA)
    Syntax error
    /sop/results.asp, line 134, column 33

    For the life of me, I cannot see what is wrong with the code I have above.

  • #2
    Regular Coder
    Join Date
    Dec 2003
    Posts
    367
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It would help if you pointed out where exactly is line 134, column 33.

    shmoove

  • #3
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    where are you getting this value FP_FieldURL(fp_rs,'ID') from? what does fp_rs & ID stand for? are they coming from a data base?

  • #4
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    You can't use single quotes as string delimiter in vbscript unlike in javascript.

    <a href="deleteConfirm.asp?ID=<%=FP_FieldURL(fp_rs,'ID')%>">Delete</a>
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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