Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8128645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T07:58:08+00:00 2026-06-06T07:58:08+00:00

OK, this is Another Project Im Working ON. Its a Chat Client. and Using

  • 0

OK, this is Another Project Im Working ON.

Its a Chat Client. and Using it For Staff

I want the server to have a staff.txt on it.

and I want the php file to do this.

Execute the php.

if The Submitted Username is Found in the staff.txt then

The Username changes to [Staff]”Username Here”

I got the search and find down.

I Cant seem to keep the username that was submitted, and just adding staff to it.

Im Adding my Source Now.

<?php
// Parameters (Leave this Alone)
 $Message = $_GET["message"];
 $Username = htmlspecialchars($_GET["username"]);
 $time = ($_GET["time"]);
 // User Banning
 $data = file_get_contents('Banned.txt');
 if(strpos($data, $Username) !== FALSE)
{
   die();
 }
 else
{

 // File Writing (Leave this Alone) 
 $File = "Chat.txt"; 
 $Handle = fopen($File, "a"); 
 fwrite($Handle, $Username);
 fwrite($Handle, ": ");
 fwrite($Handle, $Message);
  fwrite($Handle, " -:-:- ");
  fwrite($Handle, $time);
  fwrite($Handle, "\r\n");
  print "Message Sent"; 
  fclose($Handle); 
 }
?> 

I have user banning working, and i Want the Staff To Work in the same way.

Any Help would be appreciated

Trying it a different way

If ($Username=="!divider!StaffMember1")  $Username="!divider![Staff] StaffMember1"; 
If ($Username=="!divider!StaffMember2")  $Username="!divider![Staff] StaffMember2"; 

that seems to work fine in the php file thats running the php with everything else.

Is there a way to have that list in a seperate file? .txt file or .php doesnt matter.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T07:58:10+00:00Added an answer on June 6, 2026 at 7:58 am

    You can just do it like the banlist:

    <?php
     // Parameters (Leave this Alone)
     $Message = $_GET["message"];
     $Username = htmlspecialchars($_GET["username"]);
     $time = ($_GET["time"]);
    
    // check staff
     $data = file_get_contents('staff.txt');
     if(strpos($data, $Username) !== FALSE)
         $Username = '[STAFF]' . $Username;
    
    // User Banning
     $data = file_get_contents('Banned.txt');
     if(strpos($data, $Username) !== FALSE)
    {
       die();
     }
     else
    {
    
     // File Writing (Leave this Alone) 
     $File = "Chat.txt"; 
     $Handle = fopen($File, "a"); 
     fwrite($Handle, $Username);
     fwrite($Handle, ": ");
     fwrite($Handle, $Message);
      fwrite($Handle, " -:-:- ");
      fwrite($Handle, $time);
      fwrite($Handle, "\r\n");
      print "Message Sent"; 
      fclose($Handle); 
     }
    ?> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I'm working on this project, and its rather large in size. I've have
I have a file like this: This is a sentence. This is another sentence.
I have been working on a project using AMFPHP and flash. I did the
I've recently taken over a project from another consulting firm. I'm assuming this can
I'm writing bug tracking software in PHP, and today I saw this in another
I know we've done this before in another .aspx page that's using this master
I have seen code like this (actually seeing another person type it up): catch
Using Visual Studio 2008 and VB.Net: I have a working web app that uses
I am currently working on a project that uses JPA (Toplink, currently) for its
I am currently working on a project where I am using a WebBrowser control

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.