no to zrób to reczęnie.. najpiersw stwórz tabelę podając jej nazwę potem 3 rekordy ustaw odpowiednie wartości i już
no to zrób to reczęnie.. najpiersw stwórz tabelę podając jej nazwę potem 3 rekordy ustaw odpowiednie wartości i już
Zaplanuj swoją spontaniczność![]()
no dobra stworzyłem tabele ręcznie i sie udało ale teraz gdy wejde w gre i klikne na czat wszystko wydawało by sie oki ponieważ to standardowy czat bez grafiki itd ale mam na dole błąd
podam tutaj kawałek tegoo pliku zaczne od 15 linijki a skończe na tej 23Fatal error: Cannot redeclare mysql_fetch_query() (previously declared in C:\wamp\www\includes\inc.functions.php:15) in C:\wamp\www\includes\inc.functions.php on line 23
i jeśli chce coś napisać i klikam wyśli pojawia sie komunikat że nie można wyświetlić strony...Kod php:
function mysql_fetch_query($query)
{
if(strtolower(substr($query, 0, 6)) == "select") {
$selection = mysql_query($query);
return mysql_fetch_assoc($selection);
} else {
die('<br /><b>Parse error</b>: using unexpected query in <b>' . __FILE__ . '</b>, expecting SELECT on line <b>' . __LINE__ . '</b><br />');
}
}
masz 2 razy includowany plik inc.functions.php
Zeby tego uniknac mozesz dodac "_once" do standardowej funkcji includowania plikow.
przecież napisał Karer .. robisz 2 razy inlude inc.functions.php
a masz zrobić include_once co spowoduje ze include wykona się tylko raz a nie za każdym razem kiedy odświeżasz stronę ipt
więcej ze strony kess.snug.pl
Instrukcja include_once() służy do wczytania i wykonania kodu z określonego pliku w trakcie wykonywania skryptu. Działanie instrukcji podobne jest do include(), z jednym wyjątkiem, tzn. jeśli dany plik został już raz do danego skryptu wczytany, nie będzie już wczytany ponownie. Wskazuje na to nazwa instrukcji: include_once znaczy wczytaj_raz.
include_once() powinno być stosowane w przypadkach, gdzie ten sam plik może być wczytany więcej niż raz w czasie wykonywania skryptu, ale ty chcesz mieć pewność że będzie wczytany tylko jeden raz, aby uniknąć problemów z redefiniowaniem funkcji, nadpisaniem wartości zmiennych, itp.
Ostatnio edytowane przez mex ; 05-09-2010 o 17:25
Zaplanuj swoją spontaniczność![]()
no tak ale gdzie mam to zrobić w którym pliku...
Tego to juz nie wiem. Tresc ktora mi podales nie mowi w ktorym pliku. Mozesz przeszukiwac wszystkie pliki i szukac odpowiedniego kawalka![]()
aha czyli teraz cie rozumiem przed tym co ci podałem jest
require("includes/class.filter.php");i tam musze szukac lecz tam nie mam nigdzie zwrotu include może pokaże pliczekKod php:
<?php
/*
* Script voor het weghalen van de beginbescherming.
*/
if(@$_GET['action'] == "deletesafe") {
$own['safe'] = 0;
mysql_query("UPDATE users SET safe = '0' WHERE id = '" . @$own['id'] . "'");
}
//Functies
require("includes/class.filter.php");
function mysql_fetch_query($query)
{
if(strtolower(substr($query, 0, 6)) == "select") {
$selection = mysql_query($query);
return mysql_fetch_assoc($selection);
} else {
die('<br /><b>Parse error</b>: using unexpected query in <b>' . __FILE__ . '</b>, expecting SELECT on line <b>' . __LINE__ . '</b><br />');
}
}
function groot($getal)
{
return number_format($getal, 0, '.', '.');
}
function special_check($userid)
{
$user = mysql_fetch_query("SELECT login, admin, moderator, vip, health FROM users WHERE id = '" . $userid . "'");
$name = $user['login'];
if($user['admin'] == "Ja") {
$name = '<font color="red"><b>' . $name . '</b></font>';
} elseif($user['moderator'] == "Ja") {
$name = '<font color="blue"><b>' . $name . '</b></font>';
}
if($user['health'] <= 0) {
$name = '<s>' . $name . '</s>';
}
if($user['vip'] > 0) {
$name .= '<img src="images/icons/vipstar.gif" border="0">';
}
return $name;
}
function online($userid)
{
$user = mysql_num_rows(mysql_query("SELECT id FROM users WHERE id = '" . $userid . "' AND '" . tijd() . "' - UNIX_TIMESTAMP(online) < '180'"));
if($user > 0) {
return "<img src=\"images/icons/status_online.gif\" alt=\"Online\">";
} else {
return "<img src=\"images/icons/status_offline.gif\" alt=\"Offline\">";
}
}
$minutenerbijdateentijd = -4;
function get_global_date($string)
{
global $minutenerbijdateentijd;
$datum = new DateTime(date("Y-m-d H:i:s"));
$datum->modify("+" . $minutenerbijdateentijd . " minutes");
return $datum->format($string);
}
function tijd()
{
global $minutenerbijdateentijd;
return time() + (60 * $minutenerbijdateentijd);
}
function correct_number_input($number) {
if(is_numeric($number) && $number >= 0 && $number == floor($number)) {
return true;
} else {
return false;
}
}
function missiondone($mission) {
global $own;
$mission = mysql_fetch_query("SELECT opdracht, beloning_geld, beloning_power, rank, id FROM missions WHERE id = '" . $mission . "'") or die(mysql_error());
if($own['rank'] >= $mission['rank'] && !preg_match("/-" . $mission['id'] . "-/", $own['missiesvolbracht'])) {
$own['missiesvolbracht'] .= "-" . $mission['id'] . "-";
mysql_query("UPDATE users SET missiesvolbracht = '" . $own['missiesvolbracht'] . "', cash = cash + '" . $mission['beloning_geld'] . "', power = power + '" . $mission['beloning_power'] . "' WHERE id = '" . $own['id'] . "'");
mysql_query("INSERT INTO berichten (onderwerp, bericht, afzender, geaddresseerde, datum, outbox) VALUES('Missie volbracht!', 'Beste crimineel,\r\n\r\nJe hebt een missie volbracht: [b]" . $mission['opdracht'] . "[/b]\r\nMet vriendelijke groet,\r\nAnoniem.', 'Anoniem', '" . $own['id'] . "', '" . get_global_date("Y-m-d H:i:s") . "', 'False')") or die(mysql_error());
}
}
?>
Kod php:
<?php
class filter
{
function scheldwoorden($text)
{
$text = str_ireplace("kut", "***", $text);
$text = str_ireplace("loser", "*****", $text);
$text = str_ireplace("kanker", "******", $text);
$text = str_ireplace("tering", "******", $text);
$text = str_ireplace("godverdomme", "***********", $text);
$text = str_ireplace("fuck", "****", $text);
$text = str_ireplace("klootzak", "********", $text);
$text = str_ireplace("lul", "***", $text);
$text = str_ireplace("stront", "******", $text);
$text = str_ireplace("sex", "***", $text);
$text = str_ireplace("seks", "****", $text);
$text = str_ireplace("neuk", "****", $text);
$text = str_ireplace("tyfus", "*****", $text);
$text = str_ireplace("gvd", "***", $text);
$text = str_ireplace("trut", "****", $text);
$text = str_ireplace("hoer", "****", $text);
$text = str_ireplace("banditi", "*******", $text);
$text = str_ireplace("bitch", "*****", $text);
$text = str_ireplace("fack", "****", $text);
$text = str_ireplace("slet", "****", $text);
$text = str_ireplace("eikel", "*****", $text);
return $text;
}
function ubb($text)
{
$text = str_replace("[b]","<b>",$text);
$text = str_replace("[/b]","</b>",$text);
$text = str_replace("[i]","<i>",$text);
$text = str_replace("[/i]","</i>",$text);
$text = str_replace("[u]","<u>",$text);
$text = str_replace("[/u]","</u>",$text);
$text = eregi_replace("\\[img]([^\\[]*)\\[/img]","<img src=\"\\1\" border=\"0\">",$text);
$text = eregi_replace("\\[color=([^\\[]*)\\]([^\\[]*)\\[/color]","<font color=\"\\1\">\\2</font>",$text);
$text = str_replace("[center]", "<center>", $text);
$text = str_replace("[/center]", "</center>", $text);
$text = str_replace("[small]", "<small>", $text);
$text = str_replace("[/small]", "</small>", $text);
return $text;
}
function smilies($text)
{
$text = str_replace(":)", "<img src=\"images/smilies/blij.gif\">", $text);
$text = str_replace(":-)", "<img src=\"images/smilies/blij.gif\">", $text);
$text = str_replace(":(", "<img src=\"images/smilies/nietblij.gif\">", $text);
$text = str_replace(":-(", "<img src=\"images/smilies/nietblij.gif\">", $text);
$text = str_replace(":'(", "<img src=\"images/smilies/huilen.gif\">", $text);
$text = str_replace(":'-(", "<img src=\"images/smilies/huilen.gif\">", $text);
$text = str_replace(";)", "<img src=\"images/smilies/knipoog.gif\">", $text);
$text = str_replace(";-)", "<img src=\"images/smilies/knipoog.gif\">", $text);
$text = str_replace(":-p", "<img src=\"images/smilies/tong.gif\">", $text);
$text = str_replace(":-P", "<img src=\"images/smilies/tong.gif\">", $text);
$text = str_replace(":p", "<img src=\"images/smilies/tong.gif\">", $text);
$text = str_replace(":P", "<img src=\"images/smilies/tong.gif\">", $text);
$text = str_replace(":D", "<img src=\"images/smilies/heelblij.gif\">", $text);
$text = str_replace(":d", "<img src=\"images/smilies/heelblij.gif\">", $text);
$text = str_replace(":-d", "<img src=\"images/smilies/heelblij.gif\">", $text);
$text = str_replace(":-D", "<img src=\"images/smilies/heelblij.gif\">", $text);
$text = str_replace("8-)", "<img src=\"images/smilies/cool.gif\">", $text);
$text = str_replace("8)", "<img src=\"images/smilies/cool.gif\">", $text);
$text = str_replace(":o", "<img src=\"images/smilies/verbaasd.gif\">", $text);
$text = str_replace(":-o", "<img src=\"images/smilies/verbaasd.gif\">", $text);
$text = str_replace(":O", "<img src=\"images/smilies/verbaasd.gif\">", $text);
$text = str_replace(":-O", "<img src=\"images/smilies/verbaasd.gif\">", $text);
$text = str_replace(":-$", "<img src=\"images/smilies/blozen.gif\">", $text);
$text = str_replace(":$", "<img src=\"images/smilies/blozen.gif\">", $text);
return $text;
}
function addquote($text)
{
while(eregi_replace("\\[quote]([^\\[]*)\\[/quote]","<div class=\"quotetitle\">Quote:</div><div class=\"quotecontent\">\\1</div>",$text) != $text) {
$text = eregi_replace("\\[quote]([^\\[]*)\\[/quote]","<div class=\"quotetitle\">Quote:</div><div class=\"quotecontent\">\\1</div>",$text);
}
return $text;
}
}
?>
Na:Kod php:
require("includes/class.filter.php");
O to chodzi?Kod php:
require_once 'includes/class.filter.php';
nie niestety też pojawia sie ten sam błąd...;/
Aktualnie 1 użytkownik(ów) przegląda ten wątek. (0 zarejestrowany(ch) oraz 1 gości)
Zakładki