Livar
Now 35% cooler!
- Oct 15, 2010
- 846
- 86
Hey there, well I've been trying to make an installer, just can't get my head around what to write:
Here's my current code,
but I wan't to make it as a click of a button, but how can I make the file write function write this:
the issue is, it's to big for the fwrite, any chance i can do it in a variable or.....
Here's my current code,
PHP:
<?php
/* ----------------------------------------
* LEEXOWEB - CONTENT MANAGMENT SYSTEM
* COMPATIBLE WITH UBEREMULATOR (PHOENIX)
* ----------------------------------------
* AUTHOR: LIVAR SHEKHANI (POWAHALERT)
* AUTHOR: WWW.L-SHEKHANI.CO.UK
* -------------------------------------- */
//Security reasons
DEFINE('SECURITY', true);
//Check if the configuration actually exists
if(!file_exists('../includes/configuration.php'))
{
Header("Location: /index.php");
}
//Or define the installer
DEFINE('INSTALLER', true);
//Install function
if(isset($_POST['hotel_name']))
{
$MySQL_Host = $_POST['MySQL_Host'];
$MySQL_User = $_POST['MySQL_User'];
$MySQL_Pass = $_POST['MySQL_Pass'];
$MySQL_Data = $_POST['MySQL_Data'];
$Hotel_Url = $_POST['Hotel_Url'];
$Hotel_Name = $_POST['Hotel_Name'];
$InstallName = './includes/configuration.php';
$InstallOpen = fopen($InstallName, 'w');
fwrite($InstallOpen, 'here now');
fclose($InstallOpen);
}
?>
<html>
<head>
<title>LeexoWEB - Installer</title>
<link rel="stylesheet" href="style/style.css" type="text/css" />
</head>
<body>
<div id="Header">
<div class="Content">LeexoWEB - Installer</div>
</div>
<br>
<div id="Box">
<center><h1>Welcome!</h1>
<br>Hello there, and welcome to LeexoWEB's own installer, nice isn't it? LeexoWEB is a Content Management System which was made by <b>Livar Shekhani</b>, I have really tried to put 'effort' into this CMS, so please make the use of this System. The reason you have been redirected here is because your Configuration file does not exist, so this page will show you how to install it!
<br>
<br>Please make a new .PHP file called 'configuration' and put it into your 'includes' folder, with the contents of this:
<br>
<br>
<textarea class="paste">
/* ----------------------------------------
* LEEXOWEB - CONTENT MANAGMENT SYSTEM
* COMPATIBLE WITH UBEREMULATOR (PHOENIX)
* ----------------------------------------
* AUTHOR: LIVAR SHEKHANI (POWAHALERT)
* AUTHOR: WWW.L-SHEKHANI.CO.UK
* --------------------------------------*/
//Database variables
$Database['mysql']['hostname'] = 'HOST';
$Database['mysql']['username'] = 'USERNAME';
$Database['mysql']['password'] = 'PASSWORD';
$Database['mysql']['database'] = 'DATABASE';
//System variables
$System['host']['url'] = 'HOTEL URL';
$System['hotel']['name'] = 'HOTEL NAME';
$System['password']['secret_hash'] = 'bgdu!"**"£$%^N/,illeexoUdvdabohr%dv';
</textarea>
</div>
</body>
but I wan't to make it as a click of a button, but how can I make the file write function write this:
PHP:
/* ----------------------------------------
* LEEXOWEB - CONTENT MANAGMENT SYSTEM
* COMPATIBLE WITH UBEREMULATOR (PHOENIX)
* ----------------------------------------
* AUTHOR: LIVAR SHEKHANI (POWAHALERT)
* AUTHOR: WWW.L-SHEKHANI.CO.UK
* --------------------------------------*/
//Database variables
$Database['mysql']['hostname'] = 'HOST';
$Database['mysql']['username'] = 'USERNAME';
$Database['mysql']['password'] = 'PASSWORD';
$Database['mysql']['database'] = 'DATABASE';
//System variables
$System['host']['url'] = 'HOTEL URL';
$System['hotel']['name'] = 'HOTEL NAME';
$System['password']['secret_hash'] = 'bgdu!"**"£$%^N/,illeexoUdvdabohr%dv';