Jump to content
php.lv forumi

Palidzat Ludzu


KidRock

Recommended Posts

Man vaijag tadu skriptu kura es ievadu bildi linku un beigsanas laiku ( Banneriem )

Bet man jau ir iesakts :

<center><script language="JavaScript">

<!--

// Create arrays to contain all the values

// for links and image locations

link = new Array

image = new Array

 

link[1]=""

image[1]=""

 

link[2]=""

image[2]=""

 

link[3]=""

image[3]=""

 

link[4]=""

image[4]=""

 

link[5]=""

image[5]=""

 

link[6]=""

image[6]=""

 

link[7]=""

image[7]=""

 

link[8]=""

image[8]=""

 

link[9]=""

image[9]=""

 

// Create a random number between 1 and last number

random_num = (Math.round((Math.random()*8)+1))

// Write a link and images with random array

document.write('<a href="' + link[random_num] + '" target="_blank">');

document.write('<img src="' + image[random_num] + '" border="0"></a>');

-->

</script>

</center>

 

KO MANN TUR VEL VAIDZETU PIERAKSTIT LAI KATRAM TAM LINK UZLIKTU BEIGSANAS LAIKU ?

Link to comment
Share on other sites

<?php
$baneris = array();

//Baneris
$baneris['beigsanas_laiks'] = strtotime('03-01-2010 16:00:00'); //Beigsies 03-01-2010 16:00:00
$baneris['bilde'] = '/images/baneri/kautkadabilde1.jpg';
$baneris['links'] = 'http://links.uz_lapu.lv';

//Izvadam

if($baneris['beigsanas_laiks'] < time()) {
echo '<a href="'.$baneris['links'].'"><img src="'.$baneris['bilde'].'" alt="Baneris" border="0" /></a>';
}

?>

 

EDIT: nepamanīju ka tev tas ir JS, ja jau JS tad ej uz JS sadaļu nevis posto PHP sadaļā

Edited by Pentiums
Link to comment
Share on other sites

×
×
  • Create New...