NameSilo

SQL Affiliates

Spaceship Spaceship
Watch

Danaldinho

Established Member
Impact
0
I have created a couple of fansites now on my favourite music artists and I do the menu on the left hand side of the page. You can see the menu on one of them here: http://www.chamillionairechat.com

Anyway I am getting more and more people who want to affiliate with me and it takes me a long, long time to add their link into the box as there is hundreds of pages like all the lyrics page.

Anyway I was just wondering is it possible for me to do this a quicker way by using SQL

I haven't really used it before except for some phpbb mods

Thanks, Daniel Mousdell :)
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
You can also use PHP Include function and include one other php file with ads code in all the rest of the pages.
 
0
•••
-Nick- said:
You can also use PHP Include function and include one other php file with ads code in all the rest of the pages.

Like an iframe?
 
0
•••
Nope it is not Iframe it is pure single page HTML output without an Iframe.

Search for PHP Include Function in google.

You will know exactly what to do :)

Thanks.
 
0
•••
Use this on your (php) page where you want to include the links:

Code:
<?php include("filename.php"); ?>


Here is a basic php script to connect to a mysql database, query, and display the links which would you put into filename.php:

Code:
<?php

# db vars
$dbuser = "dbuser"; # username
$dbpass = "dbpass"; # password
$database = "dbname"; # name of database
$dbhost = "localhost"; # usually localhost

# db connect
$dbh = mysql_connect($dbhost, $dbuser, $dbpass) || die ("Unable to connect to host");
$selected = mysql_select_db($database) || die ("Unable to select database");

# query
$query="SELECT url from [[tablename]]";
$result=mysql_query($query);
$numrows = mysql_numrows($result);
$i = 0;

while ($i < $numrows) {
  $url=mysql_result($result,$i,"url");
  echo "<a href=\"$url\">$url</a><br>";
$i++;
}

?>

Replace:

[[tablename]] = the table name that contains the url data
 
0
•••
0
•••
In order for the php code to be interpreted properly in most cases it must have a .php file extension. If you used the include() code above on your index.html...it will not work.
 
0
•••
Thanks mate, that worked brilliantly

Thanks again for your help :D
 
0
•••
Not a problem. Glad to be a help! :)
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back