General Statistics
390 Tutorials
202 Total Votes
27 User(s) Online
770281 Views Total
3000 Registered Members
24534 Posts Total
Rooneyfeld is our newest member
About this Tutorial: Advanced Affiliation Script v1
Advanced Affiliation Script v1
Rated 5 / 3 Votes

Advanced Affiliation Script v1

The ultimate affiliation management system. With built in administration panel, its your all in one package!


Date Added: November 21, 2005 [ 4496 Views - 3 Votes ] [ Rate ]

Author: Chaos King [ PHP Coding ] [ 12 Comment(s) ]

Advanced Affiliation Script v1
4) Create a file called affiliates.php and add this code in: <?php include "db.php"; ?>

CODE
<?php
include "db.php";

$result = mysql_query("SELECT * FROM affiliates ORDER BY id");
while($row = mysql_fetch_array($result)){
echo "<a href='http://www.domain.com/affiliate_out.php?id=".$row['id']."' target='_blank'>
<img src='".$row['image']."' alt='".$row['name']."' title='".$row['name']."' width=88 height=31 border='0'></a> "; }

$result = mysql_query("SELECT * FROM affiliates");
$num_rows = mysql_num_rows($result);

echo "Total Affiliates: $num_rowsn";

?>


This file shows all the affiliates and how much affiliates there are.


5) Now, create a file called affiliate_out.php and add this code in there:
CODE
<?php
include "db.php";

if (isset($id)){
$update = mysql_query("UPDATE affiliates SET views = views + 1 WHERE id='$id'");
$result = mysql_query("SELECT link FROM affiliates WHERE id='$id'");
$row = mysql_fetch_array($result);
$afflink = $row['link'];
header("Location: $afflink");
mysql_close();}
?>



NOTE: Make sure that all the database connection files are in reach of the file requesting them. Also, for the administration panel, it is not password protected, so you may have to put it in the directory http://www.domain.com/admin/ and protect it with .htaccess. If you need help on password protecting the folder, read the tutorial on pd about it!

Thats it! I hope this tutorial has helped you! If you have any questions, feel free to ask and I will try and answer all of the errors/comments/questions that you may have.

Total Pages (3)
<<Prev 1 2 [3] 

Welcome User
Welcome Guest
( Login | Register )

Latest Tutorial Index - RSS Feed
Latest Resources - RSS Feed
Latest Tutorials - RSS Feed
Vote for Us
  • VixxIMG.com - Free Image Hosting, Free Myspace Image Hosting, Free Image Uploads
  • PageRank Plus - Google PageRank checking, with a twist.
Random Affilaites