Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Cannot redeclare rank_adv()
gegos
post
Post #1





Grupa: Zarejestrowani
Postów: 13
Pomógł: 0
Dołączył: 11.11.2012

Ostrzeżenie: (0%)
-----


Witam, mam następujący problem
Fatal error: Cannot redeclare rank_adv() in settings.php on line 38
Kod którego to dotyczy:
  1. function rank_adv() {
  2. $total_points = mysql_result(mysql_query("SELECT total FROM points WHERE id = '$id'") ,0);
  3. $rank = mysql_result(mysql_query("SELECT level FROM users WHERE login = '$nick'"), 0);
  4. if(isset($nick)) {
  5. if ($total_points >= 800 and $total_points < 2400 and $rank == "Bronze") {
  6. $rankup = '<li><a href="rank.php"><u><b>Click here to get Silver rank</b></u></a></li><br />';
  7. }
  8. if ($total_points >= 2400 and $total_points < 7200 and ($rank == "Silver" or $rank == "Bronze")) {
  9. $rankup = '<li><a href="rank.php"><u><b>Click here to get Gold rank</u></b></a></li><br />';
  10. }
  11. if ($total_points >= 7200 and $total_points < 21600 and ($rank == "Silver" or $rank == "Bronze" or $rank == "Gold")) {
  12. $rankup = '<li><a href="rank.php"><u><b>Click here to get Diamond rank</u></b></a></li><br />';
  13. }
  14. if ($total_points >= 21600 and $total_points < 43200 and ($rank == "Silver" or $rank == "Bronze" or $rank == "Gold" or $rank == "Diamond")) {
  15. $rankup = '<li><a href="rank.php"><u><b>Click here to get Emerald rank</u></b></a></li><br />';
  16. }
  17. if ($total_points >= 43200 and $total_points < 86400 and ($rank == "Silver" or $rank == "Bronze" or $rank == "Gold" or $rank == "Diamond" or $rank == "Emerald")) {
  18. $rankup = '<li><a href="rank.php"><u><b>Click here to get Platinum rank</u></b></a></li><br />';
  19. }
  20. if ($total_points >= 86400 and $total_points < 129600 and ($rank == "Silver" or $rank == "Bronze" or $rank == "Gold" or $rank == "Diamond" or $rank == "Emerald" or $rank == "Platinum")) {
  21. $rankup = '<li><a href="rank.php"><u><b>Click here to get Extra Diamond rank</u></b></a></li><br />';
  22. }
  23. if ($total_points >= 129600 and $total_points < 194400 and ($rank == "Silver" or $rank == "Bronze" or $rank == "Gold" or $rank == "Diamond" or $rank == "Emerald" or $rank == "Platinum" or $rank == "Extra Diamond")) {
  24. $rankup = '<li><a href="rank.php"><u><b>Click here to get Extra Emerald rank</u></b></a></li><br />';
  25. }
  26. if ($total_points >= 194400 and ($rank == "Silver" or $rank == "Bronze" or $rank == "Gold" or $rank == "Diamond" or $rank == "Emerald" or $rank == "Platinum" or $rank == "Extra Diamond" or $rank == "Extra Emerald")) {
  27. $rankup = '<li><a href="rank.php"><u><b>Click here to get Extra Platinum rank</u></b></a></li><br />';
  28. }
  29. }
  30. echo $rankup;
  31. }

Problem jest jeszcze dziwniejszy, ponieważ błąd ten wyskakuje losowo, tzn raz odświeżę stronę i działa a raz (rzadko) przy odświeżeniu wyskakuje błąd.
Można powiedzieć, że dopiero zaczynam swoją przygodę w PHP. Szukałem już odpowiedzi na moje pytanie jednakże nie includuję kilkukrotnie tej funkcji (gdy dam include_once błąd wyskakuje nadal).
Z góry dzięki za odpowiedzi.

odświeżam
bardzo potrzebuję pomocy (zależy mi na czasie)

Ten post edytował gegos 14.12.2012, 09:03:21
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 05:59