chat nie wyświetla tekstu

0

witam ,chciałem umieścić na mojej stronce zwykły chat w php,umieściłem można na niego wchodzić ale nie wyświetla się to co się w nim napisze ,mimo ,że prawa dostępu ustawiłem na 777 dla wszystkich plików,są to zwykłe chaty zapisane w php bez użycia baz danych,może wina jest serwera ,może ja coś źle robie?
chaty nazywają się BWChat i Easychat
link do stronki:
[url]http://ced.servehttp.com/~kopylowskip[/url]

jaka może być przyczyna ,że chat'y nie chodzą??

Piotr

0

a jak to ma działać nie rozumiem - bo ja tam widzę jedną statyczną stronkę z rozszerzeniem html i z formularzem z akcją na ten sam dokument - no chyba że na serwerze masz ustawione parsowanie dokumentów html jako php to wtedy pokaż kod

0

stronka była napisana najpierw w html,później zmieniłem rozszerzenie na php i dodałem odnośniki do innych dokumentów w php,chatów i formularzy,o parsowaniu nie mam zielonego pojęcia ,jakbyś mógł bardziej łopatologicznie co mam pokazać i co mam źle zrobione;)
formularze starałem sie zrobić według opisów dołączonych ale jak widać nic z tego nie wyszło

0

znaczy chat to odnośnik do zwykłej strony html bez rozszerzenia i wstawek php
a chat3 to pokaż kod jak to wygląda

0

chat2 składa się z 6 plików zrobionych według tego wzoru:( w google można go znaleźć jako BWchat),
############## file 1 index.htm #################

<html> <head> <title>index</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <frameset cols="100,*" frameborder="NO" border="0" framespacing="0"> <frame name="leftFrame" scrolling="NO" noresize="noresize" src="left.php"> <frameset rows="120,*" frameborder="NO" border="0" framespacing="0"> <frame name="topFrame" scrolling="NO" noresize="noresize" src="chat.php"> <frameset rows="5,*" frameborder="NO" border="0" framespacing="0" cols="*"> <frame name="topFrame1" scrolling="NO" noresize="noresize" src="refresh.php"> <frame name="mainFrame" src="messages.htm"> </frameset> </frameset> </frameset> <noframes> <body bgcolor="#FFFFFF" text="#000000"> This page requires a web browser with frames support </body> </noframes> </html> ############# end file1 index.htm ###########

############# file2 chat.php #############

<html> <head> <title>Chat</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000"> <? // if name is not entered, present the form again if(!$chatname) { print_form(); exit; }; // do not post a message unless there is a message if(!$message) { print_form_nameset(); exit; }; // set up timestamp for messages $time = date("H:i d/m"); // read in messages file into an array $message_array = file("messages.htm"); // get the last 10 messages for display for ($counter = 1; $counter < 10; $counter++) { $old_messages .= $message_array[$counter]; } // read in history file into an array $history_array = file("history.htm"); // get the last 100 messages for display for ($counter = 1; $counter < 500; $counter++) { $old_history .= $history_array[$counter]; } // prepare the format of the new message $chatname = htmlspecialchars($chatname); $message = htmlspecialchars($message); $new_message = "$time <> $chatname ::: $message

\n"; // set up some variables -header and footer for the messages page $header = "<html><head>". "<meta http-equiv="\&quot;pragma\&quot;" content="\&quot;no-cache\&quot;">". "<meta name="\&quot;robots\&quot;" content="\&quot;noindex\&quot;"></head>". "<body bgcolor="\&quot;#000000\&quot;" text="\&quot;#ffffff\&quot;">

\n"; //"<meta http-equiv="\&quot;refresh\&quot;" content="\&quot;8\&quot;">". $footer = "". "BWChat © 2002</body></html>"; // write the new message file $open_file = fopen("messages.htm", "w"); fputs($open_file, $header); fputs($open_file, stripslashes($new_message)); fputs($open_file, $old_messages); fputs($open_file, $footer); fclose($open_file); // write the history file $open_file = fopen("history.htm", "w"); fputs($open_file, $header); fputs($open_file, stripslashes($new_message)); fputs($open_file, $old_history); fputs($open_file, $footer); fclose($open_file); print_form_nameset(); function print_form() { global $chatname; global $PHP_SELF; echo <<form1 <p="&lt;p"> <font size="-1"> <form name="chat" method="post" action="$PHP_SELF"> ChatName : <input type="text" name="chatname" size="30" value="$chatname">
Message : <input type="text" name="message" size="80">
<input type="submit" value="Post Message">
</form> </span> FORM1; } function print_form_nameset() { global $chatname; global $PHP_SELF; echo <<form2 <p="&lt;p"> <font size="-1"> <form name="chat" method="post" action="$PHP_SELF"> ChatName : $chatname
<input type="hidden" name="chatname" value="$chatname"> Message : <input type="text" name="message" size="80">
<input type="submit" value="Post Message">
</form> </span> FORM2; } ?> </body> </html> ############### end file 2 chat.php ###############

############# file 3 refresh.php #############

<? $path_parts = pathinfo("$PHP_SELF"); $tail_URL = $path_parts["dirname"]; $head_URL = $HTTP_SERVER_VARS["SERVER_NAME"]; $mybase = "http://$head_URL"."$tail_URL"; $lastmsg = fileatime("messages.htm"); $now = time(); if( $now -8 < $lastmsg) need_to_update_messages(); do_nothing(); function need_to_update_messages() { global $mybase; echo <<update <html="&lt;html"> <head> <meta http-equiv="refresh" content="8"> <meta http-equiv="pragma" content="no-cache"> </head> <body bgcolor="#FFFFFF" text="#000000"> <script language="javascript"> parent.frames["mainFrame"].location.href = "$mybase/messages.htm"; </script> $mybase </body> </html> UPDATE; exit; } function do_nothing() { echo <<noupdate <html="&lt;html"> <head> <meta http-equiv="refresh" content="8"> <meta http-equiv="pragma" content="no-cache"> </head> <body> </body> </html> NOUPDATE; exit; } ?>

####################### end of file 3 refresh.php #################

########## file 4 left.php ######################

<html> <head> <title>History</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> </head> <body bgcolor="#FFFFFF" text="#000000">

 

 

History

  </body> </html> ################## end of file 4 left.php ########

         1. file 5 README ##################

#Readme for BWChaT

  1. BWChaT Author Bob PHILLIPS [email protected]
  2. (c) 26th September, 2002
  3. Version 1.1
  4. This software is distributed as freeware. Please give me credit for this and any derived works.
  5. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND

This chat is based on the tutorial at http://www.phpbuilder.com/columns/mhall20000621.php3

Is is designed to be very lightweight, with minimal requirements for use.

You just need a UNIX-Based PHP enabled web server, and a web browser that supports JAVA.

All files are commented and should be easy to modify.

I do not intend to add any functionality, it is designed to be very simple, yet functional.

Files contained in the chat

README
chat.php
history.htm
index.htm
left.php
messages.htm
refresh.php


INSTALL

Put the above files in a directory called BWChat/

Make sure the web server is able to write to the history.htm and messages.htm files

(touch history.htm messages.htm ; chmod 777 history.htm messages.htm)

point your web browser to this directory and it will work!

Bob

end file 5 README
</body> </html>

1 użytkowników online, w tym zalogowanych: 0, gości: 1