Broken links lead to last record in section

5 posts by 2 authors in: Forums > CMS Builder
Last Post: January 18, 2011   (RSS)

By steve_e - January 14, 2011 - edited: January 14, 2011

Hi -
Don't know quite how to describe this properly, but here goes:

You know when some mail clients receive an email with a long URL link in them, they 'break' the URL a part of the way along and wrap the rest of it onto the next line without the hyperlink?

We have to send out quite a few emails containing links like these, which some of our customers are sending back saying that the link doesn't work.

The problem we're having with CMSB detail page links is that instead of putting a broken link page up, which would be fine, the hyperlink on the first part of the link contains the detail page and part of the individual record, and this causes the link to deliver the last record for that section.

I hope that makes sense. I'll try to demonstrate what I mean below:

This link sends you correctly to a particular page:

http://www.foundation-stage.info/newfsf/aboutus/LEApages/laPage.php/Hampshire-County-Council-18


The following link, however, has been broken by the email client and contains only the first part of the link as a clickable hyperlink:

http://www.foundation-stage.info/newfsf/aboutus/LEApages/laPage.php/Hamp
with the rest of the line broken and wrapped onto the next line: shire-County-Council-18

However, instead of taking you to an error page, the link takes you to the page for Wandsworth, which is alphabetically the last record in the index.

Is there anything that can be done about this?

Re: [steve_e] Broken links lead to last record in section

By Jason - January 14, 2011

Hi,

What would you like to have happen when a partial link is sent? Let me know and we can work out a solution. If you could also attach laPage.php so I can see your code, I can give yo a more specific example.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [steve_e] Broken links lead to last record in section

By Jason - January 17, 2011

Hi Steve,

Before you select your record, you can do a check to make sure there's a record number at the end of your url. If not, you can stop the page and output and error message:

<?php
require_once "/home/viewer_functions.php";

if(!getLastNumberInUrl()){ //no record number in the link
die("Error! Record Not Found. Check to ensure URL is correct.");
}

$options = array();
$options['tableName'] = 'la';
$options['recordNum'] = '';
$options['where'] = '';
$record = getRecord($options);

?>


Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Broken links lead to last record in section

By steve_e - January 18, 2011

Thanks Jason -
I used the record check function you gave me above to send it to an error page, which works fine.

Regards, Steve.