Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

asp detect file?

  • 05-08-2003 09:50AM
    #1
    Registered Users, Registered Users 2 Posts: 1,747 ✭✭✭


    I have a preview system up and running on the dgi site at the moment here: http://www.dgi.ie/polls/t-shirt.asp

    If you click on the thumbnail up pops a larger version showing images numbered 1 - 48.
    on the pop up page i have this code:



    <img src="../designs/large/design<%=id%>.gif" alt="T-shirt design 01" width="425" height="600" />

    <a href="close_up.asp?id=<%=id-1%>"><< previous</a>

    <a href="close_up.asp?id=<%=id+1%>">next >></a>



    next goes up a number and previous goes down a number etc.

    What code can i put in the page so that it can detect if an image exists before going on to the next one?
    eg. im on design48.gif and i press next. Code does not detect design49.gif so stay on current page.

    At the moment i just have an image telling people to turn back.


Comments

  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Try try something like this:
    Dim objImage, strImagePath
    
    Set objImage = Server.CreateObject("Scripting.FileSystemObject")
    strImagePath = Server.MapPath("../designs/large/design" & CStr(id + 1) & ".gif"
    If objImage.FileExists(strImagePath)) Then
    	'Next Image Exists (Output link to buffer)
    Else
    	'Next Image does not Exist (Don't output link to buffer)
    End If
    Set objImage = Nothing
    


  • Registered Users, Registered Users 2 Posts: 266 ✭✭car


    how do u set up an ado connection to a database


  • Closed Accounts Posts: 19,777 ✭✭✭✭The Corinthian


    Originally posted by car
    how do u set up an ado connection to a database
    Why don't you start a new thread and ask rather than going off topic in an existing thread?

    Better still, STFW...


Advertisement