The following tutorial shows you how to make an affiliation system for you, or your admins/moderators, to add affiliate dynamically through a database
1. Make a database connection page. If you do now know how to, there is a tutorial in the php section.
2. Run the following query in your phpmyadmin on the database you are connecting to.
| CREATE TABLE 'affiliate' ( 'id' int(11) NOT NULL auto_increment, 'link' varchar(255) NOT NULL default '', 'name' varchar(255) NOT NULL default '', PRIMARY KEY ('id') ) TYPE=MyISAM AUTO_INCREMENT=3 ; |
3. Now to make your admin bit, so you can add affiliates to your table.
Name this file add.php
| <form name="affiliateadd" action="affiliateadd.php" method="POST"> Site Name:<br> Name :<br> <input name="name" type="text" id="name" style="border: 1px solid #000000; background: #f8f8f8; font-size: 10px; font-family: Tahoma;"><br> URL:<br> <input name="url" type="text" id="url" style="bored: 1px solid #000000; background: #f8f8f8; font-size; 10px font-family: Tahoma;"><br> <input type="submit" value="Submit" style="border: 1px solid #000000; background: #f8f8f8; font-size: 10px; font-family: Tahoma;"> </form> |
4. Now to make the process for that, so it actually adds the data, rather than redirecting to an empty page that does nothing... Please also change "connect.php" to your connection page. Save this as affiliateadd.php
| <? include("connect.php"); $name = $_POST['name']; $url = $_POST['url']; $sql = "INSERT INTO affiliate (id, name, link) VALUES ('NULL', '$name','$url')"; $query = mysql_query($sql) or die("Cannot query the database.<br>" . mysql_error()); echo "Affiliate Added, They will now appear on the affiliate box. Please alert Fin if you f#!*ed up with something. "; ?> |
5. Now all we need to do is display your affiliates. This is just a simple query that takes the data from your table.
Save this as whatever you want, it doesnt really matter, but it displays your affiliates. Please remember to edit the connect.php to your connection page again.
| <?php include('connect.php'); $query = "SELECT * FROM affiliate"; $result = mysql_query($query) or die('Error, query failed'); while ($row = mysql_fetch_array($result)) { echo "<a href='".$row['link']."'>".$row['name']."</a><br>"; } ?> |
6. Thats all done, now just add affiliates to your hearts content. I might write another tutorial soon on having images in your affiliates system.
Related Articles
- The Characteristics of the Perfect Affiliate Marketing ManagerAt the heart of every company that makes healthy profits every day is an affiliate marketing manager that ensures that affiliates around the world are selling their products and services automatically.
- Niche Product Marketing: How To Elude Your Competition And Feed On Low Hanging FruitOne of the first horrible mistakes that newbie internetmarketers run into is jumping into the deep end without learning how to swim oreven stay afloat. This is a metaphor for tacking a niche that has ruthlesscompetitors with years of experience.
- Google Finally Dropped The Bombshell On Affiliate MarketersGoogle finally dropped the bombshell on affiliate marketers. Their was a lot of speculation in the affiliate marketing community if they would actually go through with it. Well, they finally did...
- Don't Let Them Steal Your Affiliate URL!Cloaking is the magic word that will help you both to keep your commissions and make your affiliate URL look more appealing. It takes 10 minutes of work with the guidance in our tutorial.
- The Key To Writing Affiliate Marketing ArticlesThere are a lot of methods to driving targeted traffic to websites. One commonly overlooked method for getting free traffic to websites is writing affiliate marketing articles. Unfortunately, this is even more true for affiliate marketers who are trying to siphon traffic to their sites.
- What Is Affiliate Marketing?Affiliate marketing has many descriptions, yet all have the same meaning. Affiliate marketing is a huge business piece on the Internet. It is a cooperative effort between merchants and an affiliates website.
- 7 Ways to Drive Laser-Targeted TrafficAn affiliate marketer may have all the things needed for him to be able to succeed in a business such as affiliate marketing. He may have the necessary drive, diligence and perseverance to be able to understand how the system works.
- Affiliate Marketing Blogs: The Affiliate Marketer's Secret To RichesFrequently, when harnessing article marketing to drive traffic to a website, people by default post their articles to article-marketing sites such as EzineArticles.com. However, there is a way to siphon traffic to your website with the use of affiliate marketing blogs.
- Affiliate AssetsYour affiliate marketing business is just that ... a business. To be successful, you need to treat your business like a business and focus on growth.
- Choosing an Affiliate ProgramWhat should you consider when choosing an affiliate program? You need to think about two key things: what business are you in and what can the affiliate program provide to your customers. No matter what business you are in, the largest investment you make will be customer acquisition. If you hav...
