FILE 1: /home/custom-shopping-receipt.digitalprank.com/public_html/tool_config.json code JSON { "tool": { "identity": { "slug": "custom-shopping-receipt", "name": "Editable Shopping Receipts", "category": "prank", "tagline": "Create ultra-realistic custom shopping receipts in seconds!", "description": "Generate custom order receipts that look like they came from your favorite stores. Customize items, prices, logos, and more. Great for jokes or pranks!", "keywords": ["custom receipt", "shopping prank", "order confirmation", "receipt generator", "online purchase"] }, "features": { "bulk_enabled": false, "history_enabled": true, "export_enabled": true, "api_enabled": true }, "fields": [ { "id": "store_template", "type": "select", "label": "Select Store Template", "default": "generic", "options": [ { "value": "generic", "label": "GenericShop (Free)" }, { "value": "amazon", "label": "Amazon (Pro)" }, { "value": "ebay", "label": "eBay (Pro)" }, { "value": "walmart", "label": "Walmart (Pro)" }, { "value": "aliexpress", "label": "AliExpress (Pro)" }, { "value": "etsy", "label": "Etsy (Pro)" }, { "value": "custom", "label": "Custom Store (Pro)" } ], "pro_only": false, "help_text": "Choose which store receipt you want to mimic." }, { "id": "buyer_name", "type": "text", "label": "Buyer Name", "placeholder": "e.g., John Smith", "required": true, "validation": { "pattern": "^.{2,100}$", "min_length": 2, "max_length": 100 }, "pro_only": false }, { "id": "order_items", "type": "textarea", "label": "Items Purchased (one per line)", "placeholder": "e.g., Wireless Mouse - $19.99", "required": true, "pro_only": false, "help_text": "Enter each item with its price. e.g., USB Cable - $7.99" }, { "id": "order_date", "type": "date", "label": "Order Date", "required": false, "pro_only": false }, { "id": "currency", "type": "select", "label": "Currency", "default": "USD", "options": [ { "value": "USD", "label": "USD ($)" }, { "value": "EUR", "label": "Euro (€)" }, { "value": "GBP", "label": "GBP (£)" }, { "value": "JPY", "label": "JPY (¥)" }, { "value": "INR", "label": "INR (₹)" } ], "pro_only": true }, { "id": "custom_logo", "type": "file", "label": "Upload Custom Store Logo", "required": false, "pro_only": true, "help_text": "Upload a store logo to make your receipt more realistic (PNG/JPG only)." }, { "id": "receipt_format", "type": "select", "label": "Receipt Format", "default": "image", "options": [ { "value": "image", "label": "PNG Image" }, { "value": "pdf", "label": "PDF Document (Pro)" } ], "pro_only": false } ], "limits": { "tier_daily": { "free": 3, "basic": 25, "gold": 100, "ultimate": -1 }, "rate_limit_per_minute": 10, "max_concurrent_requests": 3 }, "billing": { "credit_cost": 1, "one_off_enabled": true, "one_off_price_cents": 75, "bill_on": "success" }, "ui": { "theme": { "primary_color": "#2b6cb0", "secondary_color": "#f7fafc" }, "layout": { "show_sidebar_ads": true, "form_style": "stacked", "result_display": "inline" } }, "dependencies": { "php_extensions": ["gd", "mbstring", "json"], "system_packages": ["imagemagick", "wkhtmltopdf"], "python_packages": ["jinja2", "reportlab", "pillow"], "external_apis": [], "requires_internet": false }, "database": { "tool_specific_table": "custom_receipt_history", "store_results": true, "enable_history": true, "retention_days": 60 }, "seo": { "meta_title": "Custom Shopping Receipt Generator | Prank Tool | DigitalPrank.com", "meta_description": "Generate custom shopping receipts from Amazon, Walmart, eBay and more. Realistic layouts, custom logos, and downloadable receipts for pranks and fun!", "canonical_url": "https://digitalprank.com/tools/custom-shopping-receipt", "structured_data": { "type": "WebApplication", "category": "Entertainment" } }, "help": { "quick_start": [ "Step 1: Select a store template.", "Step 2: Add your buyer name and order items.", "Step 3: Pick a date and currency.", "Step 4: Customize with logo or format (Pro).", "Step 5: Click Generate and download!" ], "faq": [ { "question": "Is this meant to fool real stores?", "answer": "Absolutely not. This tool is for pranks and jokes only. Never use it to impersonate real transactions or commit fraud." }, { "question": "Can I download as PDF?", "answer": "Yes, but only Pro users can export in PDF format. Free users can download PNG receipts." }, { "question": "Can I add multiple items?", "answer": "Yes! Just type each item and price on a new line." } ], "examples": [ { "title": "Simple Joke Receipt", "description": "A custom order for something ridiculous.", "input": { "buyer_name": "Kyle The Prankster", "order_items": "Unicorn Saddle - $2,499.99\nRainbow Seeds - $14.99", "store_template": "generic" } }, { "title": "Realistic eBay Receipt", "description": "Looks like a real eBay purchase.", "input": { "buyer_name": "Emma J.", "order_items": "Refurbished iPhone 12 - $349.00\nShipping - $12.00", "store_template": "ebay", "currency": "USD" } } ] }, "monitoring": { "track_usage": true, "track_performance": true, "error_reporting": true, "analytics_events": [ "receipt_generated", "template_selected", "pro_upgrade" ] }, "security": { "input_sanitization": true, "csrf_protection": true, "rate_limiting": true, "max_input_length": 500, "allowed_file_types": ["png", "jpg", "jpeg"] }, "version": { "schema": "3.0.0", "tool": "1.0.0", "api_version": "v1" } } } FILE 2: /home/custom-shopping-receipt.digitalprank.com/public_html/processor.php code PHP setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } catch (PDOException $e) { http_response_code(500); echo json_encode(['success' => false, 'message' => 'Database connection failed.']); exit; } // --- INITIALIZATION --- $start_time = microtime(true); $user_id = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : 0; $user_ip = $_SERVER['REMOTE_ADDR']; $response = [ 'success' => false, 'message' => 'An unknown error occurred.', 'data' => null, 'usage' => null, 'access' => null, 'features' => null, ]; // --- CSRF PROTECTION --- if (!isset($_POST['csrf_token']) || !hash_equals($_SESSION['csrf_token'], $_POST['csrf_token'])) { http_response_code(403); $response['message'] = 'Invalid CSRF token.'; logUsage($pdo, $tool_slug, $user_ip, $user_id, 'csrf_fail', [], json_encode($response), 0); echo json_encode($response); exit; } // --- USER AND USAGE CHECK --- $access = getUserAccessLevel($pdo, $user_id, $tool_slug); $response['access'] = $access; $limit = $config['limits']['tier_daily'][$access['tier']]; if (!checkDailyUsage($pdo, $tool_slug, $user_ip, $user_id, $limit)) { http_response_code(429); $response['message'] = 'You have exceeded your daily usage limit for this tool.'; logUsage($pdo, $tool_slug, $user_ip, $user_id, 'limit_exceeded', $_POST, json_encode($response), 0); echo json_encode($response); exit; } // --- INPUT PROCESSING AND VALIDATION --- $input = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING); $errors = []; // Get field overrides from the database $overrides = getToolFieldOverrides($pdo, $tool_slug); $response['features'] = $overrides; // Validate Buyer Name $buyer_name_field = $config['fields'][1]; if (empty($input['buyer_name']) || !preg_match('/' . $buyer_name_field['validation']['pattern'] . '/', $input['buyer_name'])) { $errors[] = 'Buyer Name must be between ' . $buyer_name_field['validation']['min_length'] . ' and ' . $buyer_name_field['validation']['max_length'] . ' characters.'; } // Validate Order Items if (empty($input['order_items'])) { $errors[] = 'Order items cannot be empty.'; } // Pro Feature Validations if ($access['tier'] === 'free') { if (isset($overrides['currency']) && $overrides['currency'] !== 'free' && $input['currency'] !== 'USD') { $input['currency'] = 'USD'; // Force default for free tier } if (isset($overrides['receipt_format']) && $overrides['receipt_format'] !== 'free' && $input['receipt_format'] === 'pdf') { $errors[] = 'PDF format is a Pro feature.'; } if (!empty($_FILES['custom_logo']['tmp_name']) && isset($overrides['custom_logo']) && $overrides['custom_logo'] !== 'free') { $errors[] = 'Custom logo is a Pro feature.'; } } if (!empty($errors)) { http_response_code(400); $response['message'] = implode(' ', $errors); logUsage($pdo, $tool_slug, $user_ip, $user_id, 'validation_failed', $input, json_encode($response), microtime(true) - $start_time); echo json_encode($response); exit; } // {{TOOL_PROCESSING_START}} function parse_items($items_string, $currency_symbol) { $lines = explode("\n", trim($items_string)); $items = []; $subtotal = 0.0; foreach ($lines as $line) { $line = trim($line); if (preg_match('/^(.*?)\s*-\s*' . preg_quote($currency_symbol) . '?([0-9,]+\.?[0-9]*)$/', $line, $matches)) { $name = trim($matches[1]); $price = (float)str_replace(',', '', $matches[2]); $items[] = ['name' => $name, 'price' => $price]; $subtotal += $price; } } return ['items' => $items, 'subtotal' => $subtotal]; } function get_currency_symbol($currency_code) { $symbols = ['USD' => '$', 'EUR' => '€', 'GBP' => '£', 'JPY' => '¥', 'INR' => '₹']; return $symbols[$currency_code] ?? '$'; } function generate_receipt_html($data) { $logo_src = $data['logo_path'] ? 'data:image/png;base64,' . base64_encode(file_get_contents($data['logo_path'])) : ''; $html = "
Order ID: " . rand(100000000, 999999999) . "
"; $html .= "Order Date: {$data['order_date']}
"; $html .= "Billed To: " . htmlspecialchars($data['buyer_name']) . "
"; $html .= "| Item | Price |
|---|---|
| " . htmlspecialchars($item['name']) . " | " . $data['currency_symbol'] . number_format($item['price'], 2) . " |
| Subtotal | " . $data['currency_symbol'] . number_format($data['subtotal'], 2) . " |
| Tax (8%) | " . $data['currency_symbol'] . number_format($data['tax'], 2) . " |
| Total | " . $data['currency_symbol'] . number_format($data['total'], 2) . " |
Generating your receipt, please wait...
This is a test.
"; $test_html_path = __DIR__ . '/generated/test.html'; $test_png_path = __DIR__ . '/generated/test.png'; file_put_contents($test_html_path, $test_html); $command = 'wkhtmltoimage ' . escapeshellarg($test_html_path) . ' ' . escapeshellarg($test_png_path) . ' 2>&1'; $output = shell_exec($command); if (file_exists($test_png_path) && filesize($test_png_path) > 0) { echo check_status(true, "wkhtmltoimage successfully generated a test PNG.", "wkhtmltoimage failed."); unlink($test_png_path); } else { echo check_status(false, "", "wkhtmltoimage failed to generate a test PNG. Output: " . htmlspecialchars($output)); } unlink($test_html_path); ?>Diagnostic complete.