php.de

Zurück   php.de > Webentwicklung > PHP Einsteiger > PHP Tipps 2004

 
 
LinkBack Themen-Optionen Thema bewerten
Alt 29.08.2004, 21:26  
Gast
 
Beiträge: n/a
Standard counter verschwindet immer! HILFE!

Hallo.

Ich hab einen Counter mit IP Sperre in meine HP eingebaut. Nur, wenn eine andere Seite geöffnet wird, in die der Counter mit INCLUDE eingepasst ist, verschwindet er. Ohne Fehlermeldung! Hab jetzt versucht den Counter-Code einzubinden auch ohne Erfolg! Bitte helft mir!!

Code:
<html>
<head>
<title>Willkommen auf WWW.LYRIC-WORLD.DE</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
	background-image: url();
}
body,td,th {
	font-family: Courier New, Courier, mono;
}
a {
	font-family: Courier New, Courier, mono;
}
a:link {
	text-decoration: none;
	color: #FFFFFF;
}
a:visited {
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
.Stil5 {
	font-size: 12px;
	color: #000000;
}
.Stil6 {
	font-size: 12px;
	color: #FFFFFF;
}
.Stil7 {color: #000000}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
//-->
</script>
</head>

<body>

<div id="Layer1" style="position:absolute; left:1px; top:0px; width:799px; height:140px; z-index:3; background-image: url(file:///C|/Dokumente%20und%20Einstellungen/Martin/Desktop/test2/layout/navi3.JPG)"../layout/navi3.JPG); layer-background-image: url(a href="../layout/navi3.JPG); border: 1px none #000000;"></div>
<div id="Layer3" style="position:absolute; left:87px; top:115px; width:500px; height:25px; z-index:5"><span class="Stil6">HOME<span class="Stil7">__</span> Songtexte<span class="Stil7">__</span> Hinzuf&uuml;gen<span class="Stil7">__</span> G&auml;stebuch<span class="Stil7">__</span> Kontakt<span class="Stil7">__</span> Disclaimer</span></div>
<div id="Layer2" style="position:absolute; left:711px; top:24px; width:69px; height:30px; z-index:6"><?






$cnt_file = "counting.txt";


$cnt_mode = 1;


$cnt_werbung = 0;

$cnt_txtstyle = "right";


$cnt_txtsize = 4;
$cnt_txtfont = "Arial";
$cnt_txtcolor = "#000000";


$cnt_imgpath = "../layout/counter";


$cnt_imgin  = "digit_";


$cnt_imgout  = ".gif";


$exp_date = 3600;





// &Uuml;berpr&uuml;fung ob die Counter-Datei vorhanden ist.
if (!file_exists($cnt_file))
{
// Ausgabe einer Fehlermeldung.
  $txt = "Die Counterdatei $cnt_file konnte nicht ge&ouml;ffnet werden";
}
else
{
  // &Ouml;ffnen der Counter-Datei und einlesen des Counters.
  $file = fopen("$cnt_file", "r+");
	flock($file, 1);
	$count = fgets($file, 4096);

  // &Uuml;berpr&uuml;fung ob der Cookie vorhanden ist.
  if (!$eiscount)
  {
    // Counter um 1 erh&ouml;hen.
		$count ++;
    // Cookie setzen.
		setcookie(eiscount, 1, time()+$exp_date);
    // Counter in Datei schreiben.
		fseek($file,0);
		fputs($file, $count);
	}
  // Datei speichern.	
	flock($file, 3);
	fclose($file);
}
// Counter zuweisen.
$cnt_counter = $count;

// Zusammenstellung der Counter-Ausgabe
// Copyright Zeilen! Bitte nicht entfernen!
$cnt_in  = "\n\n\n<div align=".$cnt_txtstyle.">";

if ($cnt_werbung ==0)
{
$cnt_middle ="";
}
else
{
$cnt_middle ="
<font size='2'>EisCount</font>";
}

$cnt_out = "</div>\n\n\n";

If ($cnt_mode == 0)
{
  // Textversion des Counters
  $cnt_src = $cnt_in."<font face=\"".$cnt_txtfont."\" size=\"".$cnt_txtsize."\" color=\"".$cnt_txtcolor."\">".$cnt_counter."</font>".$cnt_middle."".$cnt_out;
}
else
{
  // Grafikversion des Counters
  $cnt_stellen = strlen($cnt_counter);
  for ($anzahl=0; $anzahl < $cnt_stellen; $anzahl++)
  {
    $cnt_image = "".substr($cnt_counter,$anzahl,1)."".$cnt_imgout."";
    $cnt_gfx .= "<img src=\"$cnt_imgpath/$cnt_imgin$cnt_image\" border=\"0\">";
    $cnt_src = $cnt_in."".$cnt_gfx."".$cnt_middle."".$cnt_out;
  }
}
?>
<? echo $cnt_src; ?>
  <div align="right"></div>
  <div align="right"></div>
</div>
<div id="Layer4" style="position:absolute; left:720px; top:81px; width:59px; height:26px; z-index:7">
  <div align="right">
   
 
  
<?php
$sql1="SELECT COUNT(*) AS gesamt FROM lyrics";
$ergebnis1=mysql_query($sql1);
$array1=mysql_fetch_array($ergebnis1);
$gesamtanzahl=$array1["gesamt"];
echo "" . $gesamtanzahl;
?>
   
 
  </div>
</div>
</body>
</html>
Das ist meine Navigationsleiste, die auf jede andere Unterseite per INCLUDE eingefügt wird. Beim Start geht alles, danach verschwindet der Counter spurlos.

www.lyric-world.de schaut euch das desaster bitte mal an. Ich blick nicht mehr durch!!
 
Sponsor Mitteilung
PHP Code Flüsterer

Registriert seit: 21.08.2005
Beiträge: 4682
PHP-Kenntnisse:
Fortgeschritten

Alt 29.08.2004, 22:45  
Gast
 
Beiträge: n/a
Standard

kopier doch bitte einfach den abschnitt des counters raus.

ich habe wirklich keine lust mir den ganzen salat da anzuschauen.
 
Alt 30.08.2004, 11:02  
Gast
 
Beiträge: n/a
Standard

wie unhöflich. hab diesen code jetzt per include eingefügt

Code:
$cnt_file = "counting.txt"; 


$cnt_mode = 1; 


$cnt_werbung = 0; 

$cnt_txtstyle = "right"; 


$cnt_txtsize = 4; 
$cnt_txtfont = "Arial"; 
$cnt_txtcolor = "#000000"; 


$cnt_imgpath = "../layout/counter"; 


$cnt_imgin  = "digit_"; 


$cnt_imgout  = ".gif"; 


$exp_date = 3600; 





// &Uuml;berpr&uuml;fung ob die Counter-Datei vorhanden ist. 
if (!file_exists($cnt_file)) 
{ 
// Ausgabe einer Fehlermeldung. 
  $txt = "Die Counterdatei $cnt_file konnte nicht ge&ouml;ffnet werden"; 
} 
else 
{ 
  // &Ouml;ffnen der Counter-Datei und einlesen des Counters. 
  $file = fopen("$cnt_file", "r+"); 
   flock($file, 1); 
   $count = fgets($file, 4096); 

  // &Uuml;berpr&uuml;fung ob der Cookie vorhanden ist. 
  if (!$eiscount) 
  { 
    // Counter um 1 erh&ouml;hen. 
      $count ++; 
    // Cookie setzen. 
      setcookie(eiscount, 1, time()+$exp_date); 
    // Counter in Datei schreiben. 
      fseek($file,0); 
      fputs($file, $count); 
   } 
  // Datei speichern.    
   flock($file, 3); 
   fclose($file); 
} 
// Counter zuweisen. 
$cnt_counter = $count; 

// Zusammenstellung der Counter-Ausgabe 
// Copyright Zeilen! Bitte nicht entfernen! 
$cnt_in  = "\n\n\n<div align=".$cnt_txtstyle.">"; 

if ($cnt_werbung ==0) 
{ 
$cnt_middle =""; 
} 
else 
{ 
$cnt_middle ="
<font size='2'>EisCount</font>"; 
} 

$cnt_out = "</div>\n\n\n"; 

If ($cnt_mode == 0) 
{ 
  // Textversion des Counters 
  $cnt_src = $cnt_in."<font face=\"".$cnt_txtfont."\" size=\"".$cnt_txtsize."\" color=\"".$cnt_txtcolor."\">".$cnt_counter."</font>".$cnt_middle."".$cnt_out; 
} 
else 
{ 
  // Grafikversion des Counters 
  $cnt_stellen = strlen($cnt_counter); 
  for ($anzahl=0; $anzahl < $cnt_stellen; $anzahl++) 
  { 
    $cnt_image = "".substr($cnt_counter,$anzahl,1)."".$cnt_imgout.""; 
    $cnt_gfx .= "<img src=\"$cnt_imgpath/$cnt_imgin$cnt_image\" border=\"0\">"; 
    $cnt_src = $cnt_in."".$cnt_gfx."".$cnt_middle."".$cnt_out; 
  } 
} 
?> 
<? echo $cnt_src; ?> 
  <div align="right"></div> 
  <div align="right"></div> 
</div> 
<div id="Layer4" style="position:absolute; left:720px; top:81px; width:59px; height:26px; z-index:7"> 
  <div align="right">
 
 


Themen-Optionen
Thema bewerten
Thema bewerten:

Forumregeln
Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are an
Gehe zu

Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
Counter in "selbstgestrickte" Homepage - wie? magro PHP Tipps 2008 11 30.03.2008 16:37
[Erledigt] Hilfe: Projektabreit Informatik und Technik bitte helft uns. Off-Topic Diskussionen 31 05.04.2006 18:25
[Erledigt] HILFE HILFE HILFE mysqladmin.exe fehlt Datenbanken 7 20.12.2005 14:00
ein counter - und berechnungen netti PHP Tipps 2005-2 11 24.10.2005 21:03
HILFE ! Brauche ganz dringend hilfe! PHP Tipps 2005-2 2 10.10.2005 23:08
Suche folgenden Counter: PHP Tipps 2005-2 3 08.09.2005 13:19
HILFE! Download Counter funktioniert nicht - Warum? :-( nicobischof PHP Tipps 2005-2 12 21.08.2005 21:15
Schon wieder-ein funktionierender Counter mit Fehlermeldung PHP Tipps 2005 2 15.03.2005 18:34
Counter funktioniert, aber trotzdem wird Fehler gezeigt ... PHP Tipps 2005 4 07.03.2005 17:56
Suche Counter Script Beitragsarchiv 8 17.01.2005 13:42
Problem mit counter HTML, Usability und Barrierefreiheit 10 12.01.2005 06:04
Counter für registrierte user PHP Tipps 2004-2 3 26.12.2004 11:32
counter mit reload - ip zur unterscheidung nicht eindeutig PHP Tipps 2004 6 09.09.2004 20:39
counter für gallerie Sclot PHP Tipps 2004 2 05.07.2004 15:36
Problem mit einem Counter JeeZ PHP Tipps 2004 6 18.06.2004 13:36

Besucher kamen über folgende Suchanfragen bei Google auf diese Seite
counter verschwindet, counter text html charset iso-8859-1, warum verschwindert der besuchzähler immer

Alle Zeitangaben in WEZ +2. Es ist jetzt 02:43 Uhr.




Powered by vBulletin® Version 3.7.2 (Deutsch)
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
Aprilia-Forum, Aquaristik-Forum, Liebeskummer-Forum, Zierfisch-Forum, Geizkragen-Forum

Creative Commons License
Dieser Inhalt ist unter einer Creative Commons-Lizenz lizenziert.