You load the record in the controller, before you push the data to the view
that you have in your link below. I would record the statistics at this
point in the controller.
I noticed in your view code, you have an array which you iterate. After the
first iteration, you have a header(Location:) - so I wouldn't bother load
an array of data, just the single record you wish to redirect from.
Hope this helps,
Richard
On Thu, Jul 16, 2009 at 2:50 AM, ramzwatcher coolramz...@gmail.com wrote:
Hi,
I want to create a redirect function in cakephp while having cloak
redirect (using iframe) or normal redirect,
plus I want to records the statistics of views for every attempt.
Here's the link that I want to redirect where it's cloaked.
http://www.hoturl.im/recommends/url/testing
Below are codes that i write:
So where can I place a query to insert date for every views?
I seriously don't have any idea to do this one.
And i also attach my db structure for references and thanks a lot!
This file is recommends/URL.CTP
head
meta content=text/html; charset=utf-8 http-equiv=Content-
Type/
?php e($html-css('empty')); ?
/head
?php
foreach ($recommends as $recommend):
if($recommend['Recommend']['cloacked'] == 1){
$this-layout = 'empty';
?
iframe height=100% frameborder=0 width=100% marginwidth=0
marginheight=0 name=body src=?php echo $recommend['Recommend']
['url'] ?/
/iframe
?php
}else{
header(Location: .$recommend['Recommend']['url']);
}
endforeach; ?
I want to insert hits to statistics table in this /recommends/url.ctp
that contains:
-id
-click date
-click counts
-recommend_id
Your comment is appreciated. Thanks!
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
CakePHP group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~--~~~~--~~--~--~---