Ecommerce Shopify WordPress Discussion

I wanted to create a project where user just fill the form and from that form detail subdomain automatically creates with premade WordPress site data

There will be one form where user fill their details and with their form data, one subdomain has to be automatically created and WordPress website I have created already should be installed on that subdomain automatically. How can I achieve this? I have tried wildcard domains but facing issue since I am not from coding background. Please suggest me if there is another better option available or if wildcard is good then how can I make this possible in wildcard. Here is the basic version, where subdomain get created will user request and welcome message will be shown at created subdomain Index.php <!-- /home4/hsentbbq/public_html/index.php --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Create Subdomain</title> </head> <body> <h1>Create a New Subdomain</h1> <form action="process.php" method="post"> <label for="new_subdomain">New Subdomain:</label> <input type="text" name="new_subdomain" id="new_subdomain" required> <br> <input type="submit" value="Create Subdomain"> </form> </body> </html> process.php <?php // /home4/hsentbbq/public_html/process.php // Validate form submission if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["new_subdomain"])) { // Load existing user-generated subdomains from JSON file $subdomainsJsonPath = '/home4/hsentbbq/public_html/_wildcard_.coderedge.org/subdomains.json'; $subdomains = json_decode(file_get_contents($subdomainsJsonPath), true); // Get new subdomain from the form $newSubdomain = strtolower(trim($_POST["new_subdomain"])); // Check if the subdomain already exists if (array_key_exists($newSubdomain, $subdomains)) { echo "Subdomain '$newSubdomain' already exists."; } else { // Add the new subdomain to the user-generated subdomains $fullSubdomain = $newSubdomain . '.coderedge.org'; $subdomains[$fullSubdomain] = "Welcome to $fullSubdomain!"; // Save the updated subdomains to the JSON file file_put_contents($subdomainsJsonPath, json_encode($subdomains, JSON_PRETTY_PRINT)); echo "Subdomain '$fullSubdomain' created successfully!"; } } else { echo "Invalid form submission."; } ?> wildcard.domain.com <?php // /home4/hsentbbq/public_html/_wildcard_.coderedge.org/index.php // Load user-generated subdomains from JSON file $subdomainsJsonPath = '/home4/hsentbbq/public_html/_wildcard_.coderedge.org/subdomains.json'; $subdomains = json_decode(file_get_contents($subdomainsJsonPath), true); // Get the requested subdomain from the URL $requestSubdomain = strtolower(trim($_SERVER['HTTP_HOST'])); // Validate if the requested subdomain is user-generated if (array_key_exists($requestSubdomain, $subdomains)) { // Display content for the user-generated subdomain echo $subdomains[$requestSubdomain]; } else { // Display a generic message for non-user-generated subdomains echo "Invalid subdomain. Please enter a valid subdomain."; } ?> There will be one form where user fill their details and with their form data, one subdomain has to be automatically created and WordPress website I have created already should be installed on that subdomain automatically. How can I achieve this? I have tried wildcard domains but facing issue since I am not from coding background. Please suggest me if there is another better option available or if wildcard is good then how can I make this possible in wildcard. Here is the basic version, where subdomain get created will user request and welcome message will be shown at created subdomain Index.php <!-- /home4/hsentbbq/public_html/index.php --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Create Subdomain</title> </head> <body> <h1>Create a New Subdomain</h1> <form action="process.php" method="post"> <label for="new_subdomain">New Subdomain:</label> <input type="text" name="new_subdomain" id="new_subdomain" required> <br> <input type="submit" value="Create Subdomain"> </form> </body> </html> process.php <?php // /home4/hsentbbq/public_html/process.php // Validate form submission if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST["new_subdomain"])) { // Load existing user-generated subdomains from JSON file $subdomainsJsonPath = '/home4/hsentbbq/public_html/_wildcard_.coderedge.org/subdomains.json'; $subdomains = json_decode(file_get_contents($subdomainsJsonPath), true); // Get new subdomain from the form $newSubdomain = strtolower(trim($_POST["new_subdomain"])); // Check if the subdomain already exists if (array_key_exists($newSubdomain, $subdomains)) { echo "Subdomain '$newSubdomain' already exists."; } else { // Add the new subdomain to the user-generated subdomains $fullSubdomain = $newSubdomain . '.coderedge.org'; $subdomains[$fullSubdomain] = "Welcome to $fullSubdomain!"; // Save the updated subdomains to the JSON file file_put_contents($subdomainsJsonPath, json_encode($subdomains, JSON_PRETTY_PRINT)); echo "Subdomain '$fullSubdomain' created successfully!"; } } else { echo "Invalid form submission."; } ?> wildcard.domain.com <?php // /home4/hsentbbq/public_html/_wildcard_.coderedge.org/index.php // Load user-generated subdomains from JSON file $subdomainsJsonPath = '/home4/hsentbbq/public_html/_wildcard_.coderedge.org/subdomains.json'; $subdomains = json_decode(file_get_contents($subdomainsJsonPath), true); // Get the requested subdomain from the URL $requestSubdomain = strtolower(trim($_SERVER['HTTP_HOST'])); // Validate if the requested subdomain is user-generated if (array_key_exists($requestSubdomain, $subdomains)) { // Display content for the user-generated subdomain echo $subdomains[$requestSubdomain]; } else { // Display a generic message for non-user-generated subdomains echo "Invalid subdomain. Please enter a valid subdomain."; } ?>
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.