Skip to content

Санамсаргүйгээр баннер харуулах

November 1, 2006

Вэбсофт Монгол ХХК-ын вэб боловсруулах программын эх кодыг та бүхэнд танилцуулж байна.
function  random_show($show_type , $page_type , $show_db, $show_banner_num)
    //$show_type  *******************
  $big_bottom_banner=”No banner”;
  $query = “SELECT  * FROM $show_db “;
  //echo “<br> Query–“.$query ;
  $result = mysql_query ($query) or die (“Query failed”);

  //echo “Result number:  “.$result_num;

   while ($row = mysql_fetch_array($result, MYSQL_NUM))
         //  printf (“ID: %s  Name: %s<br>”, $row[0], $row[1]);

 srand ((float) microtime() * 10000000);
 $rand_keys = array_rand ($banners,   $show_banner_num );
    for($i=1;   $i  < $show_banner_num; $i++)
    {  // for banner number sss
     case ‘img’ :
     list($id, $folderid, $pic, $mnname, $enname, $ddate) = $banners[$rand_keys[$i]];
     $image =  “зургийн байрлал/”.$pic;
     echo “<a href=’index.php?page_type=$page_type&gallery=4&g=$id&folderid=$folderid’>
     <img src=’зургийн байрлал/$pic’ “.$heigth_width.” border=0></a><br>”;
         echo $mnname;
         echo “<br>”;
         echo $ddate;
        } // switch eee
 } // function haalt

No comments yet

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: