Help with Links

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

I have a dynamic search page here:

http://www.axislighting.com/CMS/search_products.php

I also have dropdowns under the 'Products' tab that takes you to the specific search results page.

I coded it like this:

http://www.axislighting.com/CMS/search_products.php?mounting=recessed

It works nicely for all but the ones that have a space:

http://www.axislighting.com/CMS/search_products.php?mounting=Wall Wash or http://www.axislighting.com/CMS/search_products.php?mounting=Wet locations

I tried to put in the %20 between the spaces and it does not work either.

http://www.axislighting.com/CMS/search_products.php?mounting=Wall%20Wash or http://www.axislighting.com/CMS/search_products.php?mounting=Wet%20locations

One other issue is with the Distribution link:

http://www.axislighting.com/CMS/search_products.php?distribution=Asymmetric This only has no spaces but does not work either. It is really weird, since http://www.axislighting.com/CMS/search_products.php?distribution=Direct works just fine.

Note that the search using the filters on the side works nicely.

If anyone has any clue as to why these links are not working properly, please advise.

Re: [Jason] Help with Links

By dccreatives - June 23, 2011 - edited: June 23, 2011

I uploaded the search_products.php and the results page.

Let me know if you come up with anything.

Thank You,

Re: [dccreatives] Help with Links

By Jason - June 23, 2011

Hi,

The issue seems to be here on search_results.php:

list($itemsRecords, $itemsMetaData) = getRecords(array(
'tableName' => 'items',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));

$itemsRecord = @$itemsRecords[0]; // get first record

...

// show error message if no matching record is found
if (!$itemsRecord) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}


This is selecting 1 item from the items table based on a number in the URL. The results of this query don't seem to be used anywhere on the page, but if no item is returned, the page stops processing and outputs "Record Not Found"

Try removing this code since it isn't being used. That should take care of the issue for you.

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] Help with Links

Thanks, it works perfectly now