If single record go directly to Details Viewer
4 posts by 2 authors in: Forums > CMS Builder
Last Post: November 29, 2011 (RSS)
By fleff - November 28, 2011
<?php if ($itemsMetaData['totalRecords'] == 1): {
header("Location: /items_details.php");
exit;
}
?>
<?php endif ?>
That brings up the details viewer for the first record in the section, not the record we want. If I physically add the record number in the code, it works fine. My question is, how do I append the record number of the single item in the category requested? I tried the following:
<?php if ($itemsMetaData['totalRecords'] == 1): {
header("Location: /items_details.php?<?php echo $record['num'] ?>");
exit;
}
?>
<?php endif ?>
I get an error message. What should I have here to make it work?
Thanks,
Farnham
Re: [fleff] If single record go directly to Details Viewer
By Jason - November 28, 2011
What you need to do is take out the <?php ?> tags where you're outputting the record num. You don't need these tags are you are already inside a PHP block.
Try this:
<?php if ($itemsMetaData['totalRecords'] == 1): {
header("Location: /items_details.php?". $record['num'] );
exit;
}
?>
<?php endif ?>
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] If single record go directly to Details Viewer
By fleff - November 28, 2011
Farnham
Re: [fleff] If single record go directly to Details Viewer
By Jason - November 29, 2011
Could you attach the .php file you're working with along with a link to an example that demonstrates the problem? That way, I can take a closer look.
If you don't want to post this information in the forum, please email it to support@interactivetools.com
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/