Dev.to WebDev 🛠 Dev 👁 0 📖 4 min read

Build a Simple SMM Reseller Dashboard in Plain PHP (Bangladesh Shared Hosting Friendly)

Here's a question junior devs in Dhaka ask a lot. "Bhai, how do resellers in Bangladesh run a hundred orders without losing their minds?" The honest answer? Many of them don't. They copy-paste from a panel into a notebo

Here's a question junior devs in Dhaka ask a lot. "Bhai, how do resellers in Bangladesh run a hundred orders without losing their minds?"

The honest answer? Many of them don't. They copy-paste from a panel into a notebook. Then they lose the notebook.

So let's build a small PHP reseller dashboard. Plain PHP, one SQLite file, no framework. It talks to an SMM panel through its API. Here's the whole thing, step by step.

Why PHP for this?

Because shared hosting in Bangladesh still runs PHP everywhere. Cheap cPanel plans. No Docker. No build step. You upload a folder and it works.

For a reseller who just wants a working tool by Friday, that matters more than any shiny stack.

The panel used here

The examples use SMMBooster BD, a Bangladeshi panel. It takes bKash plus a bunch of crypto pay options, which suits local resellers well. More importantly it has a proper API page aimed at resellers.

The SMMBooster BD API docs are short and clear:

  • Endpoint: https://smmbooster.bd/api/v2
  • Method: POST
  • Response: JSON
  • Every call needs your key and an action

Actions include services, add, status, refill, refill_status, cancel and balance. That's everything a small dashboard needs.

Step 1: the API client

One class. Nothing clever.

<?php
// Panel.php
class Panel
{
    private string $url = 'https://smmbooster.bd/api/v2';

    public function __construct(private string $key) {}

    public function call(string $action, array $params = []): array
    {
        $ch = curl_init($this->url);
        curl_setopt_array($ch, [
            CURLOPT_POST           => true,
            CURLOPT_POSTFIELDS     => http_build_query(
                array_merge(['key' => $this->key, 'action' => $action], $params)
            ),
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_TIMEOUT        => 30,
        ]);

        $raw = curl_exec($ch);
        if ($raw === false) {
            throw new RuntimeException('cURL: ' . curl_error($ch));
        }
        curl_close($ch);

        $data = json_decode($raw, true);
        if (isset($data['error'])) {
            throw new RuntimeException('Panel: ' . $data['error']);
        }
        return $data;
    }
}

http_build_query does the encoding for you. Don't glue strings together by hand. Links with ? and & in them will bite you.

Step 2: a tiny SQLite store

Shared hosts almost always have the SQLite extension on. One file and you're done.

<?php
// db.php
$db = new PDO('sqlite:' . __DIR__ . '/orders.sqlite');
$db->exec('CREATE TABLE IF NOT EXISTS orders (
    id INTEGER PRIMARY KEY,
    panel_order TEXT,
    customer TEXT,
    service INTEGER,
    link TEXT,
    quantity INTEGER,
    status TEXT DEFAULT "Pending",
    created_at TEXT DEFAULT CURRENT_TIMESTAMP
)');

Keep the database file outside public_html if your host allows it. Or at least block it with .htaccess. It's an easy one to forget. And a public order database is not a fun surprise.

Step 3: placing an order

<?php
require 'Panel.php';
require 'db.php';

$panel = new Panel(getenv('SMM_API_KEY'));

$res = $panel->call('add', [
    'service'  => (int) $_POST['service'],
    'link'     => trim($_POST['link']),
    'quantity' => (int) $_POST['quantity'],
]);

$stmt = $db->prepare('INSERT INTO orders (panel_order, customer, service, link, quantity)
                      VALUES (?, ?, ?, ?, ?)');
$stmt->execute([
    $res['order'], $_POST['customer'], $_POST['service'],
    $_POST['link'], $_POST['quantity'],
]);

echo "Order placed: #" . htmlspecialchars($res['order']);

Before this runs, check the quantity against the service's min and max. Pull those from the services action once a day and cache them. It saves you a pile of rejected requests.

Step 4: refresh statuses in batches

The status action takes up to 100 order IDs, comma-separated, in the orders field. So one request covers a whole batch.

<?php
$open = $db->query("SELECT id, panel_order FROM orders
                    WHERE status NOT IN ('Completed','Canceled','Refunded')")
           ->fetchAll(PDO::FETCH_ASSOC);

foreach (array_chunk($open, 100) as $chunk) {
    $ids = implode(',', array_column($chunk, 'panel_order'));
    $res = $panel->call('status', ['orders' => $ids]);

    $upd = $db->prepare('UPDATE orders SET status = ? WHERE panel_order = ?');
    foreach ($res as $orderId => $info) {
        if (isset($info['status'])) {
            $upd->execute([$info['status'], $orderId]);
        }
    }
}

Set this up as a cPanel cron job every 30 minutes. Your table stays fresh without you touching it.

Step 5: the dashboard view

Keep the UI dead simple. A list of orders with colored badges:

  • grey for Pending
  • blue for In progress
  • green for Completed
  • red for Canceled or Partial

Plus a small balance box at the top from the balance action. When the balance gets low the box turns orange. Small thing. Saves real headaches on a busy Friday night.

Things to get right early

A few honest notes:

  • Add CSRF tokens from day one. Bolting them on later is annoying.
  • Log every raw response. When an order looks odd you'll want proof of what the panel said.
  • Never auto-retry an add. Check status first. Duplicate orders cost real money. Idempotency keys in PHP and MySQL solve this properly.
  • Put the API key in the environment. Not in a PHP file inside the web root.

Is it worth building?

For a reseller doing even 20 orders a day, absolutely. It's roughly a day's work with chai breaks. Then it handles the boring parts while you focus on customers.

If you're shopping for an SMM Panel Bangladesh resellers can plug into with a clean API, start with the docs linked above. You can scan the full service list at https://smmbooster.bd/services and note the service IDs first.

One more thing. Be straight with your customers. Social media services help good content get noticed faster. They can't fix weak content. Each platform also has its own rules worth reading. Saying that out loud builds the kind of trust that brings repeat orders.

Want help with the HTML templates? Ask in the comments.

Written by MD Fozla Rabbi, SEO Specialist.

📰 Read the original article on Dev.to WebDev

Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.