Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo Leute ich habe mir einen Webserver (IIS) mit PHP und MySql aufgesetzt.

mun habe ich danach meine HP rüberkopiert und bekam bei dem Counter diese Fehlermeldung:

Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\wwwroot\homepage\quelltext\php\navigation.php:2) in C:\Inetpub\wwwroot\homepage\quelltext\php\counter.php on line 3

4937

Notice: Undefined index: count in C:\Inetpub\wwwroot\homepage\quelltext\php\counter.php on line 30

kann mir jemand da weiterhelfen?

ist das ein berechtigungsproblem ?

mfg

Xandie

Das ist der Quelltext das in den ersten 4 Zeilen steht.

1. <?php

2. // Cookie wird gesetzt

3. setcookie("count","yes");

4. ?>

mfg

Xandie

könntes du bitte den kompletten counter.php sourcecode posten.

Gruß,

Markus

<?php

// Cookie wird gesetzt

setcookie("count","yes");

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>

<title>bla bla</title>

<head>

<title>bla bla</title>

<meta name="author" content="bla bla">

<link rel='Stylesheet' href='../../css/page.css' type='text/css'>

<style type="text/css">

body {

scrollbar-arrow-color: #FF4D00;

scrollbar-base-color: #000000;

scrollbar-track-color: #000000;

scrollbar-face-color: #000000;

scrollbar-highlight-color: #FFFFFF;

scrollbar-3dlight-color: #000000;

scrollbar-darkshadow-color: #000000;

scrollbar-shadow-color: #FFFFFF;

}

</style>

</head>

<body text="#FF4D00" link="#FF4D00" vlink="#FF4D00" alink="#FF4D00" bgcolor="black" >

<font face="Arial Black"><?php

$fp=fopen("../../include/counter.txt","r+");

$counter=fgets($fp,10);

echo $counter;

if ($_COOKIE["count"]!="yes") {

$counter++;

}

rewind($fp);

fputs($fp,$counter);

fclose($fp);

?>

</font>

</body>

</html>

Das komisce ist, dass es mit xampp funktionert!

mfg

Xandie

dieses script wird von einem anderen included?

dann bitte dieses auch posten...

<HTML>

<?

include('../../include/head.txt');

?>

<body bgcolor="black">

<font face="Arial" size="-1" color="#FF4D00"><b>Navigation</b></font>

<br>

<hr noshade size="1" color="#FFFFFF">

<a href="../html/unten.html" target="iframe2"><font size="-10">Home</font></a><br>

<a href="../html/impressum.html" target="iframe2"><font size="-10">Impressum</font></a><br>

<hr noshade size="1" color="#FFFFFF">

<a href="../php/burningbook/index.php" target="iframe2"><font size="-10">Gästebuch</font></a><br>

<a href="../php/wbboard/index.php" target="iframe2"><font size="-10">Forum</font></a><br>

<hr noshade size="1" color="#FFFFFF">

<a href="../html/bilder_2004.html" target="iframe2"><font size="-10">Bilder 2004</font></a><br>

<a href="../html/bilder_2005.html" target="iframe2"><font size="-10">Bilder 2005</font></a><br>

<hr noshade size="1" color="#FFFFFF">

<br><br><br><br><br><br><br><br><br><br>

<?

include('counter.php');

?>

</BODY>

</HTML>

mfg

Xandie

<HTML>

[...]

<hr noshade size="1" color="#FFFFFF">

<br><br><br><br><br><br><br><br><br><br>

<?

include('counter.php');

?>

[...]

In include.php willst du einen Cookie setzen. Das geht aber nur, wenn davor noch keine Ausgabe erfolgt ist. In deiner Datei erfolgt aber schon ne Menge an Ausgaben, bevor der Cookie gesetzt werden soll.

Das kann nicht funktionieren, ausser du hast deinen XAMPP so eingestellt, dass die Ausgaben gecached werden, also erst ganz am Ende die Ausgabe erfolgt. Die sollte man aber nicht nutzen, weil es eben für den Server belatender ist.

wär noch für ne lösung dankbar!

mfg

Xandie

Header senden und DANN Content schreiben.

Content ist HTML aber auch Kommentare... also am Besten Header als erstes senden.

wär noch für ne lösung dankbar!

[b]<?

include('counter.php');

?>

[/b]

<HTML>

<?

include('../../include/head.txt');

?>


<body bgcolor="black">



<font face="Arial" size="-1" color="#FF4D00"><b>Navigation</b></font>

<br>

<hr noshade size="1" color="#FFFFFF">

<a href="../html/unten.html" target="iframe2"><font size="-10">Home</font></a><br>

<a href="../html/impressum.html" target="iframe2"><font size="-10">Impressum</font></a><br>



<hr noshade size="1" color="#FFFFFF">

<a href="../php/burningbook/index.php" target="iframe2"><font size="-10">Gästebuch</font></a><br>

<a href="../php/wbboard/index.php" target="iframe2"><font size="-10">Forum</font></a><br>


<hr noshade size="1" color="#FFFFFF">

<a href="../html/bilder_2004.html" target="iframe2"><font size="-10">Bilder 2004</font></a><br>

<a href="../html/bilder_2005.html" target="iframe2"><font size="-10">Bilder 2005</font></a><br>

<hr noshade size="1" color="#FFFFFF">

<br><br><br><br><br><br><br><br><br><br>



EDIT:

Da du in der cookie.php auch Ausgaben machst, solltest du dies aufteilen... wieso Teilst du das ganze eigentlich in 2 Dateien? Kannst du das nicht in einer machen?

Dann prüfst du eben, ob der Cookie gesetzt ist z.B.:

if (isset($_COOKIE["counter"]))

{

}

oder so...

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.