Broken links lead to last record in section

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

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: [Jason] Broken links lead to last record in section

By steve_e - January 14, 2011

Hi Jason -
I think probably to get an Error 404 type of page? Or a custom equivalent where I could suggest what might have happened?
Regards, Steve.
Attachments:

lapage.php 6K

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.