← Desenvolvimento

Ajuda php erro!

Lida 1308 vezes

Offline

cenourinha 
Elite
Mensagens 4094 Gostos 21
Troféus totais: 34
Trófeus: (Ver todos)
Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

Ajuda php erro!

Bem, construi este bloco para phpnuke mas não tou a conseguir por a funcionar, queria saber se alguem percebe o que esta mal!

Código: [Seleccione]
<?php

if &#40;eregi&#40;"block-Fading.php",$_SERVER['PHP_SELF'&#93;&#41;&#41; &#123;

    
Header&#40;"Location&#58; index.php"&#41;;

    
die&#40;&#41;;

&#125;
//Amount of time image is displayed
mt_srand&#40;doubleval&#40;microtime&#40;&#41;&#41; * 100000000&#41;;
//Choose Banner
switch&#40;mt_rand&#40;1,11&#41;&#41;
&#123;
case 1&#58;
$bannerURL "http&#58;//www.topwizard.w3bsphere.net/in.php?id=cenourinha";
$bannerImage "http&#58;//www.topwizard.w3bsphere.net/images/1.png";
break;
case 
2&#58;
$bannerURL "http&#58;//www.killerz-tech.net/forum/index.php?act=toplist&code=hitin&site=16";
$bannerImage "http&#58;//www.killerz-tech.net/images/topsites.gif";
break;
case 
3&#58;
$bannerURL "http&#58;//topsites.webathigh.com/in.php?id=8";
$bannerImage "http&#58;//img351.imageshack.us/img351/2127/untitled15oi.gif";
break;
case 
4&#58;
$bannerURL "http&#58;//widescreenxp.net/topsites/in.php?id=25";
$bannerImage "http&#58;//widescreenxp.net/topsites/images/button.png";
break;
case 
5&#58;
$bannerURL "http&#58;//www.7maker.clubedohost.com/topsite/in.php?id=cenourinha";
$bannerImage "http&#58;//www.7maker.clubedohost.com/topsite/images/button.jpg";
break;
case 
6&#58;
$bannerURL "http&#58;//www.tutorialselect.com/topsites/in.php?id=35";
$bannerImage "http&#58;//www.tutorialselect.com/images/ourbutton.gif";
break;
case 
7&#58;
$bannerURL "http&#58;//www.khmerwebmaster.com/topsite/in-27.html";
$bannerImage "http&#58;//www.khmerwebmaster.com/topsite/images/button.png";
break;
case 
8&#58;
$bannerURL "http&#58;//www.090graphics.com/topsites/in.php?id=230";
$bannerImage "http&#58;//www.090graphics.com/topsites/images/button.png";
break;
case 
9&#58;
$bannerURL "http&#58;//www.pimpmycom.com/topsite/in.php?id=179";
$bannerImage "http&#58;//www.pimpmycom.com/topsite/images/button.jpg";
break;
case 
10&#58;
$bannerURL "http&#58;//free-toplist.de/script/count.php?liste=17579&id=214710";
$bannerImage "http&#58;//users.skynet.be/fa853369/vote/vote2.gif";
break;
case 
11&#58;
$bannerURL "http&#58;//www.neowin.net/forum/index.php?act=toplist&code=hitin&site=4";
$bannerImage "http&#58;//www.neowin.net/images/buttons/neowin/neowin%207.jpg";
break;
&
#125;
echo&#40;"<a href="$bannerURL">"&#41;;
echo&#40;"<img src="$bannerImage" "&#41;;
echo&#40;"width="88" height="31" border="0">"&#41;;
echo&#40;"</a>"&#41;;
?>
Offline

cenourinha 
Elite
Mensagens 4094 Gostos 21
Troféus totais: 34
Trófeus: (Ver todos)
Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

Bem, já resolvi o erro, mas aparecem.me os banners todos iguais, eu queria que fossem todos diferentes!

Código: [Seleccione]
<?                                                      //Amount of time image is displayed
mt_srand(doubleval(microtime()) * 10000000099999999);
//Choose Banner
switch(mt_rand(1,11))
{
case 1:
$bannerURL = "http://www.topwizard.w3bsphere.net/in.php?id=cenourinha";
$bannerImage = "http://www.topwizard.w3bsphere.net/images/1.png";
break;
case 2:
$bannerURL = "http://www.killerz-tech.net/forum/index.php?act=toplist&code=hitin&site=16";
$bannerImage = "http://www.killerz-tech.net/images/topsites.gif";
break;
case 3:
$bannerURL = "http://topsites.webathigh.com/in.php?id=8";
$bannerImage = "http://img351.imageshack.us/img351/2127/untitled15oi.gif";
break;
case 4:
$bannerURL = "http://widescreenxp.net/topsites/in.php?id=25";
$bannerImage = "http://widescreenxp.net/topsites/images/button.png";
break;
case 5:
$bannerURL = "http://www.7maker.clubedohost.com/topsite/in.php?id=cenourinha";
$bannerImage = "http://www.7maker.clubedohost.com/topsite/images/button.jpg";
case 6:
$bannerURL = "http://www.tutorialselect.com/topsites/in.php?id=35";
$bannerImage = "http://www.tutorialselect.com/images/ourbutton.gif";
break;
case 7:
$bannerURL = "http://www.khmerwebmaster.com/topsite/in-27.html";
$bannerImage = "http://www.khmerwebmaster.com/topsite/images/button.png";
break;
case 8:
$bannerURL = "http://www.090graphics.com/topsites/in.php?id=230";
$bannerImage = "http://www.090graphics.com/topsites/images/button.png";
break;
case 9:
$bannerURL = "http://www.pimpmycom.com/topsite/in.php?id=179";
$bannerImage = "http://www.pimpmycom.com/topsite/images/button.jpg";
break;
case 10:
$bannerURL = "http://free-toplist.de/script/count.php?liste=17579&id=214710";
$bannerImage = "http://users.skynet.be/fa853369/vote/vote2.gif";
break;
case 11:
$bannerURL = "http://www.neowin.net/forum/index.php?act=toplist&code=hitin&site=4";
$bannerImage = "http://www.neowin.net/images/buttons/neowin/neowin%207.jpg";
break;
}
echo("<a href=\"$bannerURL\">");
echo("<img src=\"$bannerImage\" ");
echo("width=\"88\" height=\"31\" border=\"0\">");
echo("</a>");
echo("<a href=\"$bannerURL\">");
echo("<img src=\"$bannerImage\" ");
echo("width=\"88\" height=\"31\" border=\"0\">");
echo("</a>");
echo("<a href=\"$bannerURL\">");
echo("<img src=\"$bannerImage\" ");
echo("width=\"88\" height=\"31\" border=\"0\">");
echo("</a>");
echo("<a href=\"$bannerURL\">");
echo("<img src=\"$bannerImage\" ");
echo("width=\"88\" height=\"31\" border=\"0\">");
echo("</a>");
echo("<a href=\"$bannerURL\">");
echo("<img src=\"$bannerImage\" ");
echo("width=\"88\" height=\"31\" border=\"0\">");
echo("</a>");
echo("<a href=\"$bannerURL\">");
echo("<img src=\"$bannerImage\" ");
echo("width=\"88\" height=\"31\" border=\"0\">");
echo("</a>");
?>
Offline

cenourinha 
Elite
Mensagens 4094 Gostos 21
Troféus totais: 34
Trófeus: (Ver todos)
Mobile User Apple User Level 6 Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 5 Level 4

Bem agora já tenho o codigo a funcionar perfeitamente:

Código: [Seleccione]
<?php

$n_ban 
0;
$rand 0;
$limit 12;
echo&
#40;"<p align=\"center\">"&#41;;
while &#40;$n_ban <= 5&#41;&#123;
$n_ban++;

if &
#40;$n_ban == 1&#41;&#123;
$rand mt_rand&#40;1,$limit&#41;;
&#125;else&#123;
$rand $rand 2;
if &#40;$rand > $limit&#41;
  
$rand 1;
&
#125;

switch&#40;$rand&#41;
&#123;
case 1&#58;
$bannerURL "http&#58;//www.topwizard.w3bsphere.net/in.php?id=cenourinha";
$bannerImage "http&#58;//www.topwizard.w3bsphere.net/images/1.png";
break;
case 
2&#58;
$bannerURL "http&#58;//www.killerz-tech.net/forum/index.php?act=toplist&code=hitin&site=16";
$bannerImage "http&#58;//www.killerz-tech.net/images/topsites.gif";
break;
case 
3&#58;
$bannerURL "http&#58;//topsites.webathigh.com/in.php?id=8";
$bannerImage "http&#58;//img351.imageshack.us/img351/2127/untitled15oi.gif";
break;
case 
4&#58;
$bannerURL "http&#58;//widescreenxp.net/topsites/in.php?id=25";
$bannerImage "http&#58;//widescreenxp.net/topsites/images/button.png";
break;
case 
5&#58;
$bannerURL "http&#58;//www.7maker.clubedohost.com/topsite/in.php?id=cenourinha";
$bannerImage "http&#58;//www.7maker.clubedohost.com/topsite/images/button.jpg";
break;
case 
6&#58;
$bannerURL "http&#58;//www.tutorialselect.com/topsites/in.php?id=35";
$bannerImage "http&#58;//www.tutorialselect.com/images/ourbutton.gif";
break;
case 
7&#58;
$bannerURL "http&#58;//www.khmerwebmaster.com/topsite/in-27.html";
$bannerImage "http&#58;//www.khmerwebmaster.com/topsite/images/button.png";
break;
case 
8&#58;
$bannerURL "http&#58;//www.090graphics.com/topsites/in.php?id=230";
$bannerImage "http&#58;//www.090graphics.com/topsites/images/button.png";
break;
case 
9&#58;
$bannerURL "http&#58;//www.pimpmycom.com/topsite/in.php?id=179";
$bannerImage "http&#58;//www.pimpmycom.com/topsite/images/button.jpg";
break;
case 
10&#58;
$bannerURL "http&#58;//free-toplist.de/script/count.php?liste=17579&id=214710";
$bannerImage "http&#58;//users.skynet.be/fa853369/vote/vote2.gif";
break;
case 
11&#58;
$bannerURL "http&#58;//www.neowin.net/forum/index.php?act=toplist&code=hitin&site=4";
$bannerImage "http&#58;//www.neowin.net/images/buttons/neowin/neowin%207.jpg";
break;
case 
12&#58;
$bannerURL "http&#58;//www.greycobra.com/topsites/in.php?id=257";
$bannerImage "http&#58;//www.greycobra.com/affiliates/gcpaffiliate3.gif";
break;
&
#125;
echo&#40;"<a href=\"$bannerURL\">"&#41;;
echo&#40;"<img src=\"$bannerImage\" "&#41;;
echo&#40;"width=\"88\" height=\"31\" border=\"0\">"&#41;;
echo&#40;"</a>"&#41;;
&#125;
echo&#40;"</p>"&#41;;


?>



Mas quando ponho em bloco no PhpNuke ele aparece.me mal.
Tipo aparecem os banner em cima e depois aparece o bloco em baixo a dizer Este Bloco Não Tem Nada Para Mostrar!

Alguem sabe se isto tem algum erro?