Hilfe Php Was?

Element0r

Mitglied
Warning: Unable to access shoutbox/shouts.html in /home/usr/grafixart/shoutbox/shoutbox.php on line 79


was isn das bitte?!?!?

Code:
<html>
<head>
<title>Shoutbox</title>
<script language="javascript" type="text/javascript">
<!--

var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
win=window.open(mypage,myname,settings);}

// -->
</script>
<style type="text/css">.textbox {
background-color: #cccccc;
border-color: #ffffff;
border-style: solid;
border-width: 1;
color: #000000;
font-size: 8pt;
font-family: verdana;
}
</style>
<style type="text/css">.button {
background-color: #cccccc;
border-color: #ffffff;
border-style: solid;
border-width: 1;
color: #000000;
font-size: 8pt;
font-family: verdana;
}
</style>
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000000" vlink="#000000" alink="#000000">
<table width="150" border="0" valigh="top">
<font face="verdana" size="1">
<?php
if($submit)
{
?>
<?php
//emoticons
$shout=ereg_replace(":)","<img src='1.gif'>",$shout);
$shout=ereg_replace(":D","<img src='3.gif'>",$shout);
$shout=ereg_replace(":p","<img src='4.gif'>",$shout);
$shout=ereg_replace(":/","<img src='5.gif'>",$shout);
$shout=ereg_replace(":d","<img src='2.gif'>",$shout);
?>
<?php
//language filter
$shout=ereg_replace("fuck","*",$shout);
$shout=ereg_replace("scheiss","*",$shout);
$shout=ereg_replace("Scheiss","*",$shout);
$shout=ereg_replace("SCHEISS","*",$shout);
$shout=ereg_replace("FUCK","*",$shout);
$shout=ereg_replace("bitch","*",$shout);
$shout=ereg_replace("BITCH","*",$shout);
$shout=ereg_replace("shit","*",$shout);
$shout=ereg_replace("SHIT","*",$shout);
$shout=ereg_replace("ass","*",$shout);
$shout=ereg_replace("ASS","*",$shout);
$shout=ereg_replace("cock","*",$shout);
$shout=ereg_replace("COCK","*",$shout);
?>
<?php
//writing shouts to file
$fp = fopen("shoutbox/shouts.html",  "a");  
fputs($fp, "<a href=\"$website\" target=\"new\"> $name</a> :\n");  
fputs($fp, "$shout<br>\n"); 
fclose($fp);  
}
?>
<?php 
//displaying shouts
$lines = file("shoutbox/shouts.html"); 
$a=array_slice($lines,count($lines)-10); 
foreach ($a as $b) echo $b."<br>\n"; 
?>
</font>
<center>
        <form action="shoutbox/shoutbox.php" method="post">
        <input type="text" name="name" value="Name" class="textbox">
        <br>
        <input type="text" name="website" value="Website" class="textbox">
        <br>
         <input type="text" name="shout" value="Shout" class="textbox">
        <br>
        <input type="submit" name="submit" value="Shout" class="button">
      </form>
</center>
<center>
<a href="past.php" onclick="NewWindow(this.href,'messenger','220','440','yes','random');return false" onfocus="this.blur()"><font face="verdana" size="1">Past Shouts</font></a>
<a href="emoticons.php" onclick="NewWindow(this.href,'messenger','220','440','yes','random');return false" onfocus="this.blur()"><font face="verdana" size="1">Emoticons</font></a><br>
<font face="verdana" size="1">Script by <a href="http://www.digitaleffect.org">Digital Effect</a></font>
</center>
</table>
</body>
</html>
 

poolpage

Erfahrenes Mitglied
Hast du die Datei shouts.html freigegeben (chmod), damit PHP darauf zugreifen kann?

Ansonsten liegt der Fehler wohl in diesem Teil:

PHP:
<?
$fp = fopen("shoutbox/shouts.html",  "a");  
fputs($fp, "<a href=\"$website\" target=\"new\"> $name</a> :\n");  
fputs($fp, "$shout<br>\n"); 
fclose($fp);
?>

Versuch mal "a+" statt "a" im fopen()...

hth, mfg
poolpage
 
Ich glaub mal, dass die Verzeichnisangabe falsch ist...
PHP:
<?
$fp = fopen("shouts.html",  "a");  // ohne vorgestelltes shoutbox/
fputs($fp, "<a href=\"$website\" target=\"new\"> $name</a> :\n");  
fputs($fp, "$shout<br>\n"); 
fclose($fp);
?>

Übrigens: Um unabhängig von Groß- u. Kleinschreibung Teilstrings zu ersetzen, kann man die eregi_replace()-Funktion verwenden.
 

Element0r

Mitglied
ok das sie funktioniert hab ich schon einmal hinbekommen..aber kann mir wer sagen wie ich da nun einen hintergrund reinbekomme..

kann das ich das im style sheet definieren?

oder muss ich in den ganzen files nach der bezeichnung suchen?