Page 1 of 11 123 ... LastLast
Results 1 to 10 of 104

Thread: PHP Chat Room Problems

  1. #1
    Join Date
    Jul 2005
    Posts
    223
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default PHP Chat Room Problems

    Okay, I'm having problems with my chat rooms,,,

    http://japantown.awardspace.com/generalchat/chat.htm & http://japantown.awardspace.com/languagechat/chat.htm

    the first problem is after about 30 or so posts, the chat wont refresh anymore. i look at the source of the page and the bottom half gets erased somehow because the user posts take it over and push it off so it gets deleted.

    the second problem i have is that once the "Post!" button is pushed, the page is not refreshed. it still only refreshes every 15 seconds (assuming more than 30 posts aren't in the messages section). how can i make the post button also refresh?

    third problem, when a user logs in it simply says "username -", how can i make it say "username-san has logged in."

    fourth problem, there is no log off button. i would like a log off button that says "username-san has logged off." once pushed and for the user to go back to the main page /japantown.shtml

    fifth problem, the text input box doesn't follow the text if it goes out of the box length, how can i make it follow?

    sixth problem..... i cant get the forum jump menu centered between old posts and active users, how do i get it centered?

    7th problem, there is a bgsound embedded into the page, i do not want it and every time i remove it, it just comes back. how do i remove it?

    that's all the problems i don't know how to fix.

    i really appreciate your help.

    email me for each of the 9 files of the general chat if it would help you.

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    chat.php, lines 44-49:
    Code:
    $header = "<html><head>".
        "<embed src=\"sound.wav\" width=2 height=0 autostart=true loop=false> <noembed> <bgsound src=\"sound.wav\" loop=none> </noembed>\n";
        "<meta http-equiv=\"pragma\" content=\"no-cache\">".
        "<meta http-equiv=\"refresh\" CONTENT=\"15\">".
        "<meta name=\"robots\" content=\"noindex\"></head>".
        "<body bgcolor=\"#3399ff\" text=\"#ffffff\"><p>".
    That semicolon should be at the end of the string, not in the middle
    To change the number of stored posts, with regards to a question asked in the chat room itself, find "40" in chat.php:20, and set it to the desired number.
    3) is trickier, technically and culturally. If you look at the source, you'll see that the "logged-in" message is just a normal blank message. You could use something like this (chat.php:43):
    Code:
    $new_message = "<font color=\"$myfont\">$chathandle" . ($message ? " - $message" : "-san has logged in.") . "<p>\n </font>";
    Also, san might not always be appropriate.
    4) chat.php:112:
    Code:
    </form><form method="post" action="$self_post"><input type="hidden" name="logout" value="true"><input type="hidden" name="chathandle" value="$chathandle"><input type="hidden" name="myfont" value="$myfont"><input type="submit" value="Log out"></form>
    chat.php:43:
    Code:
    $new_message = "<font color=\"$myfont\">$chathandle" . ($message ? " - $message" : (isset($_POST['logout']) ? "-san has logged out." : "-san has logged in.")) . "<p>\n </font>";
    chat.php, under line 62:
    Code:
    if(isset($_POST['logout'])) header("Location: http://japantown.awardspace.com/");
    6) Looks pretty centred to me.
    7) Remove chat.php:45.
    Last edited by Twey; 05-21-2006 at 10:25 PM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2005
    Posts
    223
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default

    ummm.. yeah

    httpL//japantown.awardspace.com/generalchat/chat.htm

    i went t line 63 and deleted it, and i logged in but the bottom part went blank and it never said i logged in, so i put line 63 back and i got the error message again.

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Eh? Where did I say to delete line 63? I'm sure I never did.

    All line numbers refer to the unedited file, by the way.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Jul 2005
    Posts
    223
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default

    yeah but if you go to that chat you will see what i mean

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    If you delete line 63, then yes, things are going to screw up. That's a function declaration.
    Therefore, I suggest you don't delete line 63, and put it back.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Jul 2005
    Posts
    223
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default

    it is backkkkk... look at the error message! please

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    At a guess, I'd say you've inserted my if statement between function ... and the opening brace. Move it up a line.

    This is why the note about all line numbers applying to the unedited version.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Jul 2005
    Posts
    223
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Default

    if u go to the language chat, you will notice more problems. the background turns blue once a message is posted. each time a message is typed the old one is replaces with the new. there is still no log off button for some reason.

  10. #10
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Could you attach the current version of chat.php here please?
    There is a "log out" button, by the way. It's just that your frame is too small for it to be seen. However, it doesn't do the redirection properly. I suggest you use:
    Code:
        (isset($_POST['logout']) ? '<script type="text/javascript">'."\n".'top.location.href="japantown.awardspace.com";'."\n".'</script>' : "<meta http-equiv=\"refresh\" CONTENT=\"15\">").
    instead of:
    Code:
        "<meta http-equiv=\"refresh\" CONTENT=\"15\">".
    and remove the header() call I suggested earlier.
    Last edited by Twey; 05-22-2006 at 10:11 PM.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •