Gots me a bug!

Results 1 to 2 of 2

Thread: Gots me a bug!

  1. #1
    Join Date
    Dec 1969

    Default Gots me a bug!

    Page gives news items each with a 150 character "teaser" user can then click the title to read the full item. This has worked without hitch until now. Problem being is that, as (bad) luck would have it, my 150 character teaser ends right in the middle of an URL. When the user clicks this link to go to an external web page we get a 404. (this is not the link to the full article but a clickable link that appears within the first 150 chars of the teaser.<BR>Here is the SQL (snippet is just response.written within the page)<BR>strSQL = "SELECT NewsID, NewsTitle, NewsDate, left(NewsContent,150) AS snippet FROM NewsBulletins ORDER BY NewsID DESC"<BR><BR>any idea how I could do some jiggery pokery in order to stop this from happening in the future?<BR><BR>Jay

  2. #2
    Join Date
    Dec 1969

    Default Easy answer:

    Remove all HTML tags from the "teaser" text.<BR><BR>I&#039;d suggest removing the tags *before* getting the left 150 characters. Maybe get the left 500 characters, remove the tags, and then get the left 150 characters.<BR><BR>You can use a regular expression to do this easily. I believe that one of the examples in the VBS regexp docs even shows this particular example!<BR><BR>All this means is that now the user will have to go to the actual article before she/he can click on the hyperlink.<BR><BR>Whaddya thing?<BR><BR>

Posting Permissions

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