xajax uploaden!!!

  • Hallo erstmal.


    Ich hatte schonmal in vergangenheit ein thema über xajax geschrieben weil es immer nicht ging nun hab ich es endlich zum
    Laufen gebracht. da hab ich mir gedacht mal so zur übung mal einen kleinn chat zu kreiren.
    Bei mir auf dne localhost funktioniert er einwandfrei aba auf meinen webspace wird im chatverlaufs feld immer das ausgegeben { hat Geschrieben {
    am anfang steht der name der den text geschrieben hat und die zweite geschweifte Klammer soll te eigentlich der inhalt sein.
    hier mal der quelltext:
    natürlich gibt es eine vorseite wo der Name abgefragt wird und erst dann kann mann in den chat das auch funktioniert!!!

    Code
    1. <span class="syntaxhtml"><br /><span class="syntaxdefault"><?php<br />session_start</span><span class="syntaxkeyword">();<br /></span><span class="syntaxdefault">error_reporting</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">0</span><span class="syntaxkeyword">);<br /><br />require_once(</span><span class="syntaxstring">'xajax/xajax_core/xajax.inc.php'</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">$xajax </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> new xajax</span><span class="syntaxkeyword">();<br /></span><span class="syntaxdefault">$xajax</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">configure</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'javascript URI'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'./xajax/'</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">$xajax</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">configure</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'setCharEncoding'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">'ISO-8859-1'</span><span class="syntaxcomment">/* 'UTF-8' */</span><span class="syntaxkeyword">);<br /></span><span class="syntaxcomment">//$xajax->configure('setFlag', "decodeUTF8Input", true);<br />//$xajax->configure('debug', true);<br /><br /></span><span class="syntaxdefault">function schreiben</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$schreiben</span><span class="syntaxkeyword">)<br />{<br /></span><span class="syntaxdefault">    $obj </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> new xajaxResponse</span><span class="syntaxkeyword">();<br /></span><span class="syntaxdefault">    $inhalt1 </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> nl2br</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">trim</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$schreiben</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'schreiben_schreibfeld'</span><span class="syntaxkeyword">]));<br /></span><span class="syntaxdefault">    $inhalt </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> $schreiben</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'absenden_schreibername'</span><span class="syntaxkeyword">]</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> </span><span class="syntaxstring">" hat Geschrieben: "</span><span class="syntaxdefault"> </span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> $inhalt1 </span><span class="syntaxkeyword">.</span><span class="syntaxdefault"> </span><span class="syntaxstring">"<br />"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">       $handle </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> fopen</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"chatverlauf.txt"</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"a"</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">       fwrite</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> $inhalt</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">       fclose</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">    $empty </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">"Schreiben sie hier ihre nachicht"</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">    $obj</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">assign</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'writingfield'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'value'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> $empty</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">    return $obj</span><span class="syntaxkeyword">;<br />}<br /></span><span class="syntaxdefault">function display</span><span class="syntaxkeyword">()<br />{<br /></span><span class="syntaxdefault">       $handle </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> fopen</span><span class="syntaxkeyword">(</span><span class="syntaxstring">"chatverlauf.txt"</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"r"</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">       $inhalt10 </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> fgets</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> filesize</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'chatverlauf.txt'</span><span class="syntaxkeyword">));<br /></span><span class="syntaxdefault">       fclose</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$handle</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">    $objResponse </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> new xajaxResponse</span><span class="syntaxkeyword">();<br /></span><span class="syntaxdefault">    $objResponse</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">assign</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'display'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'innerHTML'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> $inhalt10</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">    $objResponse</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">script</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'window.setTimeout("xajax_display()", 1000); '</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">    return $objResponse</span><span class="syntaxkeyword">;<br />}<br /></span><span class="syntaxdefault">function textwegmachen</span><span class="syntaxkeyword">()<br />{<br /></span><span class="syntaxdefault">    $leer </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">''</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">    $object </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> new xajaxResponse</span><span class="syntaxkeyword">();<br /></span><span class="syntaxdefault">    $object</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">assign</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'writingfield'</span><span class="syntaxkeyword">,</span><span class="syntaxstring">'value'</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> $leer</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">    return $object</span><span class="syntaxkeyword">;<br />}<br /><br /></span><span class="syntaxdefault">$xajax</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">register</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">XAJAX_FUNCTION</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"schreiben"</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">$xajax</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">register</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">XAJAX_FUNCTION</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"display"</span><span class="syntaxkeyword">);<br /></span><span class="syntaxdefault">$xajax</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">register</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">XAJAX_FUNCTION</span><span class="syntaxkeyword">,</span><span class="syntaxdefault"> </span><span class="syntaxstring">"textwegmachen"</span><span class="syntaxkeyword">);<br /><br /></span><span class="syntaxdefault">$xajax</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">processRequest</span><span class="syntaxkeyword">();<br /><br /></span><span class="syntaxdefault">class chat<br /></span><span class="syntaxkeyword">{<br /><br /></span><span class="syntaxdefault">    var $display_width</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">    var $display_height</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">    var $writing_field_height</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">    var $writing_field_width</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">    var $writing_field_button_width</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">    var $writing_field_button_height</span><span class="syntaxkeyword">;<br /><br /></span><span class="syntaxdefault">    var $writer_name</span><span class="syntaxkeyword">;<br /><br /></span><span class="syntaxdefault">    function chat_include_display</span><span class="syntaxkeyword">()<br /></span><span class="syntaxdefault">    </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">        ?><br /></span>            <style type="text/css"><br />            #display<br />            {<br />                width: <span class="syntaxdefault"><?php echo $this</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">display_width</span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> ?></span>px;<br />                height: <span class="syntaxdefault"><?php echo $this</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">display_height</span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> ?></span>px;<br />                background-color: #B6B6B6;<br />            }<br />            </style><br />            <fieldset id="display"><br />            <div id="display"><br /><br /><br />            </div><br />            </fieldset><br />            <br /><br />        <span class="syntaxdefault"><?php<br /><br />    </span><span class="syntaxkeyword">}<br /></span><span class="syntaxdefault">    function chat_include_writing_text_field</span><span class="syntaxkeyword">()<br /></span><span class="syntaxdefault">    </span><span class="syntaxkeyword">{<br /></span><span class="syntaxdefault">        ?><br /></span>            <style type="text/css"><br />            #writingfield<br />            {<br />                height: <span class="syntaxdefault"><?php echo $this</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">writing_field_height</span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> ?></span>px;<br />                width:  <span class="syntaxdefault"><?php echo $this</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">writing_field_width</span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> ?></span>px;<br />            }<br />            #ab<br />            {<br />                height: <span class="syntaxdefault"><?php echo $this</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">writing_field_button_height</span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> ?></span>px;<br />                width:  <span class="syntaxdefault"><?php echo $this</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">writing_field_button_width</span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> ?></span>px;<br />            }<br />            </style><br />            <form id="Absenden" name="Absenden" onsubmit="return false"><br />            <input type="hidden" name="absenden_schreibername" value="<span class="syntaxdefault"><?php echo $this</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">writer_name</span><span class="syntaxkeyword">;</span><span class="syntaxdefault"> ?></span>" size="20" maxlength="50" /><br />            <textarea onclick="xajax_textwegmachen();" name="schreiben_schreibfeld" id="writingfield" rows="20" cols="20"></textarea><br />            <button onclick="xajax_schreiben(xajax.getFormValues('Absenden'));" id="ab">Absenden</button><br />            </form><br />            <div id="ben">Schreiben sie etwas in die textbox!</div><br />        <span class="syntaxdefault"><?php<br />        </span><span class="syntaxcomment">//require_once('xajax.request.php');<br /></span><span class="syntaxdefault">    </span><span class="syntaxkeyword">}<br /><br />}<br /><br /></span><span class="syntaxdefault"> ?><br /></span><!DOCTYPE html><br /><html><br /><br /><head><br />    <title>Chat</title><br /><br />    <meta charset="UTF-8"><br />    <meta name="description" content=""><br />    <meta name="author" content=""><br />    <meta name="keywords" content=""><br />    <meta name="generator" content="Webocton - Scriptly (www.scriptly.de)"><br /><br />    <span class="syntaxdefault"><?php<br />    $xajax</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">printJavaScript</span><span class="syntaxkeyword">();<br /></span><span class="syntaxdefault">    ?><br /></span></head><br /><body><br /><br /><span class="syntaxdefault"><?php<br /><br />echo $_GET</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'chatname'</span><span class="syntaxkeyword">];<br /></span><span class="syntaxdefault">$chat </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> new chat</span><span class="syntaxkeyword">();<br /><br /></span><span class="syntaxdefault">$chat</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">display_height </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">'250'</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">$chat</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">display_width </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">'500'</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">$chat</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">writing_field_height </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">'80'</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">$chat</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">writing_field_width </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">'450'</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">$chat</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">writing_field_button_height </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">'50'</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">$chat</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">writing_field_button_width </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> </span><span class="syntaxstring">'80'</span><span class="syntaxkeyword">;<br /></span><span class="syntaxdefault">$chat</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">writer_name </span><span class="syntaxkeyword">=</span><span class="syntaxdefault"> $_GET</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'chatname'</span><span class="syntaxkeyword">];<br /><br /></span><span class="syntaxdefault">$chat</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">chat_include_display</span><span class="syntaxkeyword">();<br /></span><span class="syntaxdefault">$chat</span><span class="syntaxkeyword">-></span><span class="syntaxdefault">chat_include_writing_text_field</span><span class="syntaxkeyword">();<br /></span><span class="syntaxdefault"> ?><br /></span><br /> <noscript>BITTE JAVASCRIPT AKTIVIEREN!!!</noscript>// hier weis ich nicht ob das in den head bereich kommt?<br /></body><br /></html><br /></span>


    Bitte um Hilfe!!!


    anscheinend werden die daten von den Formular nicht an die xajax function gesendet deshalb ist der Name { und Der inhalt {
    denn die function geht ja es wird ja alles angezeigt!!!


    mfg Truck007