So basically i need that when user registers in my Android App i will make a POST request with user Name and company Name that they wanted and i will create a html page with that data in the HTML Template. and webpage will be visible like this -> www.main-website.com/username [main-website.com is the domain that i have bought]
So what I did , is that I created a variable that stores the HTML Template with custom changes by adding php variables in-between.And then created a file.html. Check this code {and also If you know a better way to do this thing pls suggest [main idea -> userAuthenticate -> webpage created with username and company name as tags (this is protoype) ]
<!DOCTYPE HTML>
<?php
if(isset($_POST['userName']) && isset($_POST['companyName'])){
$user_name = $_POST['userName'];
$company_name = $_POST['companyName'];
}
$my_var = <<<EOD
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>template</title>
</head>
<body>
<h1>This is $user_name </h1>
<h2>My company name is $company_name </h2>
</body>
</html>
EOD;
$fp = fopen($_SERVER['DOCUMENT_ROOT'] . "/myText.php","wb");
fwrite($fp,$my_var);
fclose($fp);
?>