Hello all.
I'm looking at a possibility of putting together a small banner advertisment script thats VERY simple for a website I'm trying to put together (none proffit - and non comercial adds, hence why I ask)
I have some basic PHP from a CMS that creates the following code
<table width="100%" height="68" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="34%" height="65" align="left" valign="middle" id="align_left"><a href="http://www.test.co.uk"><img src="img/test_logo.gif" width="228" height="54" border="0"></a></td>
<td width="66%" align="center" valign="middle"><a href="#"><img src="img/advert.gif" width="468" height="60" border="0"></a></td>
</tr>
</table>
The part that interest me is
What I'm thinking, is as follows something along the lines of
<td width="66%" align="center" valign="middle"><a href="#"><img src="img/advert.gif" width="468" height="60" border="0"></a></td>
and then<script language="javascript">
<!-- some javascript that loops though a flat file or something and assigns a link url to $LINK and the matching image the $IMAGE variable
--!>
</script>
<td width="66%" align="center" valign="middle"><a href="$URL"><img src="$IMAGE" width="468" height="60" border="0"></a></td>
having a config file somthing linke
ads.config
therefore the java script would loop through and assign www.testsite1.com to $LINK and images/test1.gif to $IMAGE
www.testsite1.com images/test1.gif
www.mysite.co.uk image/mysite.gif
www.bigbob.net images/fatty.gif
the code would then look like this
and then<script language="javascript">
<!-- some javascript that loops though a flat file or something and assigns a link url to $LINK and the matching image the $IMAGE variable
--!>
</script>
<td width="66%" align="center" valign="middle"><a href="$URL"><img src="$IMAGE" width="468" height="60" border="0"></a></td>
having a config file somthing linke
ads.config
therefore the java script would loop through and assign www.testsite1.com to $LINK and images/test1.gif to $IMAGE
www.testsite1.com images/test1.gif
www.mysite.co.uk image/mysite.gif
www.bigbob.net images/fatty.gif
the code would then look like this
and then<script language="javascript">
<!-- some javascript that loops though a flat file or something and assigns a link url to $LINK and the matching image the $IMAGE variable
--!>
</script>
<td width="66%" align="center" valign="middle"><a href="$URL"><img src="$IMAGE" width="468" height="60" border="0"></a></td>
having a config file somthing linke
ads.config
therefore the java script would loop through and assign www.testsite1.com to $LINK and images/test1.gif to $IMAGE
www.testsite1.com images/test1.gif
www.mysite.co.uk image/mysite.gif
www.bigbob.net images/fatty.gif
the code would then look like this
<script language="javascript">
<!-- some javascript that loops though a flat file or something and assigns a link url to $LINK and the matching image the $IMAGE variable
--!>
</script>
<td width="66%" align="center" valign="middle"><a href="www.testsite.com"><img src="images/test1.gif" width="468" height="60" border="0"></a></td>
this is only the principal I'm trying to get my head around - and I'm only using javascript as an example
I'd be happy to do something like include a php script that connects to a database and gets the data from a database table or flat file
such as
Does anyone have any experience with this, or could someone lend a hand.
select image,url from adverts
thanks.