Jump to content

Banner Advertising


prcollin

Recommended Posts

Also is there a place you can direct me to get a decent banner advertising script.  I want a script that rotates banner advertisements so that I can have a banner advertising on my website.  I am so used to creating strict html sites that i know nothing of php and I usually use JOOMLA lol the noobie cms.  Finally dipping my feet into doing my own programming.

 

 

Thanks for being patient

Link to comment
Share on other sites

If you have a decent number of similar sized banners, you could place them in a database and use php to pull one out at random everytime the page is loaded or refreshed.

 

That would be great is there a simple code for that.

 

If I upload multiple .php files to my web domain and they all have includes statements for eachother will hte all work simultaneously.

Link to comment
Share on other sites

or you could do somin like:

 

$h= 0;
$query = mysql_query("SELECT * FROM images");
while($array = mysql_fetch_array($query)) {
  $images[$h] = $array[name];
  $h++;
}
$num = rand(0,$h);
echo("<img src=\"images/$images[$num]\" />");

 

That should work :D

Link to comment
Share on other sites

alternativly you could do this...

 

$query = mysql_query("SELECT * 
FROM `banners` 
WHERE `id` = RAND() 
LIMIT 1;");
while($data = mysql_fetch_array($query))
{
    echo($data[0]);
}

Link to comment
Share on other sites

like i said i am a dummy so the 'banners' would be the database they are all stored in right or no?

 

alternativly you could do this...

 

$query = mysql_query("SELECT * 
FROM `banners` 
WHERE `id` = RAND() 
LIMIT 1;");
while($data = mysql_fetch_array($query))
{
    echo($data[0]);
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.