DialPHP PHP Examples

PHP client examples for the DialPHP Major BBS v10 module. Demonstrates TCP authentication, user queries, and account management.

About DialPHP

DialPHP is a TCP/IP authentication and user-management module for The Major BBS v10. It listens on a configurable port and accepts connections from external scripts, allowing PHP web applications to query and modify BBS user accounts in real time.

Each connection authenticates with a shared secret, issues one command, receives a response, then disconnects. The examples below demonstrate all supported commands.

Before using these examples, edit config.php with your BBS server address and secret. The shared secret must match the value configured in the DialPHP module options on the BBS.

Example Pages
🔒
Login Demo
Demonstrates user authentication using the AUTHUSER command. Enter BBS credentials to verify them and display basic account info. Public access — no key required.
Public →
📊
System Statistics Demo
Displays live BBS system variables — total accounts, active users, call counts, message totals, and credit statistics. Results are cached for 60 minutes to reduce BBS load.
Requires sysop privileges →
⚙️
Sysop Panel Demo
Full administrative interface covering supported DialPHP commands: user lookup, key management, credits and days, class switching, account actions, and field updates.
Requires sysop privileges →
Complete Command Reference
All 24 Supported Commands
Command Parameters Returns
User Verification
USERIDEXISTS userid YES or NO
AUTHUSER userid%%password Password is correct / Password is incorrect / No such user
HASMASTER userid YES or NO
ISSUSPENDED userid YES or NO
USERONLINE userid YES or NO
User Information
PRIMARYCLASS userid Primary class name string
CURRENTCLASS userid Current class name string
NUMBEROFCREDITS userid Credit balance as integer string
NUMBEROFDAYS userid Days remaining (0 for non-expiring classes)
LASTLOGIN userid Date in MM/DD/YYYY format
CREATIONDATE userid Date in MM/DD/YYYY format
Key Management
HASKEY keyname userid YES or NO
GIVEKEY keyname userid Key given
TAKEKEY keyname userid Key taken
Credits & Days
GIVECREDITS amount userid Ok — use negative amount to subtract
GIVEDAYS days userid Ok — use negative days to subtract; only affects expiring classes
Class Management
SWITCHCLASS classname userid Ok — user must already be a member of the target class
Account Actions
SUSPENDUSER userid Ok
UNSUSPENDUSER userid Ok
DELETEUSER userid Ok
UNDELETEUSER userid Ok
Advanced
UPDATEUSERFIELD fieldname userid%%newvalue Ok — updates a specific field in the user record
AUDITMESSAGE message text Ok — posts a message to the BBS audit trail
SYSTEMVARIABLE varnum Variable value — see variable index below
SYSTEMVARIABLE — Variable Index
Variable # Description
1Total downloads
2Total uploads
3Total messages posted
5Total user accounts
6Female accounts
7Male accounts
10Paid credits posted
11Free credits posted
12Total calls to date
13Users currently online
Protocol Notes

One command per connection. The BBS closes the TCP connection after every response. Each call to DialPHP::query() opens a fresh connection.

%% separator. AUTHUSER and UPDATEUSERFIELD use %% (double percent) to separate compound parameters rather than spaces, because userids, passwords, and field values may contain spaces.

Case insensitive. Command verbs and user IDs are case-insensitive. Passwords for AUTHUSER are case-sensitive.

Message terminator. The BBS appends two ASCII 245 bytes (0xF5 0xF5) to every outbound message to mark end-of-transmission.