Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
How Put Counter With Redirect File???
Old 07-30-2009, 02:43 PM How Put Counter With Redirect File???
Average Talker

Posts: 15
Trades: 0
I've got a php redirect file for a site that I instantly want my affiliate code redirected to the home site (home site is not mine). How can I keep tabs on how many redirects the site makes, other than from my control panel within my hosting account? Thanks for the help.
__________________
How Long Till You Renew Your Web Hosting?
Please login or register to view this content. Registration is FREE

High PR Backlinks for $5 per Month
Please login or register to view this content. Registration is FREE
joeldavis is offline
Reply With Quote
View Public Profile Visit joeldavis's homepage!
 
 
Register now for full access!
Old 07-30-2009, 02:57 PM Re: How Put Counter With Redirect File???
danielsolution's Avatar
Novice Talker

Posts: 9
Name: Daniel
Trades: 0
How is your redirect occuring? There are a couple of ways to track hits to that page - depending on the redirect method.

Let me know,
Daniel
danielsolution is offline
Reply With Quote
View Public Profile
 
Old 07-30-2009, 03:50 PM Re: How Put Counter With Redirect File???
Average Talker

Posts: 15
Trades: 0
I uploaded a php file named index.php to my site's directory, which redirects it to the site my affiliate link takes it to automatically. The index.php script is written below:

<?php header("Location: http:/myaffiliatelink.com
"); ?><html><head><title>redirect</title><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"></head><body></body></html>

I appreciate your help.
__________________
How Long Till You Renew Your Web Hosting?
Please login or register to view this content. Registration is FREE

High PR Backlinks for $5 per Month
Please login or register to view this content. Registration is FREE
joeldavis is offline
Reply With Quote
View Public Profile Visit joeldavis's homepage!
 
Old 07-30-2009, 05:20 PM Re: How Put Counter With Redirect File???
danielsolution's Avatar
Novice Talker

Posts: 9
Name: Daniel
Trades: 0
Do you have access to a dbase (MySQL) on that server. If so you can create a function to add / update the number of views before sending the php header and doing the redirect.

This would only take a few lines of code and would of course require a page created to show you how many hits were sent thru that redirect.

I can help you throw that together, if you like.
__________________
Daniel S.

Please login or register to view this content. Registration is FREE
Toronto
danielsolution is offline
Reply With Quote
View Public Profile
 
Old 07-30-2009, 05:36 PM Re: How Put Counter With Redirect File???
danielsolution's Avatar
Novice Talker

Posts: 9
Name: Daniel
Trades: 0
We would open a dbase connection as such:

PHP Code:
<?php
mysql_connect
("localhost""admin""1admin") or die(mysql_error());

mysql_select_db("test") or die(mysql_error());

?>
Then update a table/field;

PHP Code:

$tracker_sql 
"UPDATE `your_table` SET `views` = `views`+1";

$track_it mysql_query$tracker_sql ); die("Couldn't execute query. "); 
Then set the header redirect as you have it now...

This is just written here and I have obviously not tested it - let me know if you need a working version.
__________________
Daniel S.

Please login or register to view this content. Registration is FREE
Toronto
danielsolution is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How Put Counter With Redirect File???
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.22498 seconds with 12 queries