|
<?
function creaImmagini()
{
for ($i=0;$i<=250;$i++)
{
if ($i!=0)
}
}
?>
<html>
<head>
<title>Configurazione sondaggi</title>
</head>
<body style="background: black; color: white">
<div style="position: absolute; margin: 0 auto">
<form method="post" action="" style="position: relative; margin: 0 auto; border: solid red 3px; padding: 5px">
Nome DataBase : <input type="text" name="dbname" value="" /><br /><br />
Host* : <input type="text" name="host" value="localhost" style="margin-left: 64px"/><br /><br />
Utente : <input type="text" name="user" value="" style="margin-left: 60px"/><br /><br />
Password : <input type="password" name="pass" value="" style="margin-left: 40px"/><br /><br />
<input type="submit" value="C O N F I G U R A" name="config" style="border: groove blue; font-weight: bold; width: 258px;" /><br />
<?
if (isset($_POST['config']))
{
$HostName = $_POST['host'];
$dbPass = $_POST['pass'];
$dbUser = $_POST['user'];
$dbName = $_POST['dbname'];
echo '--- Connessione al database in corso --- <br />';
if ($db == false) die ("<span style='color:red'><strong>Impossibile connettersi al database</strong></span>");
mysql_select_db($dbName,$db) or die ("<span style='color:red'><strong>Impossibile selezionare database</strong></span>");
echo '<strong>Connessione al database avvenuta con successo</strong><br />';
echo '---Creazione delle tabelle in corso---<br />';
$query = "CREATE TABLE `sondaggi` (
`id` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`titolo` VARCHAR( 255 ) NOT NULL ,
`voci` TEXT NOT NULL ,
`dataCreazione` INT NOT NULL,
`votazione` TEXT NOT NULL
)";
if ($result)
{
echo '<strong>Tabella '.addslashes('sondaggi').' creata con successo</strong><br />';
creaImmagini();
$codice = "<? \r \$dbName = '$dbName'; \r \$HostName = '$HostName'; \r \$dbUser = '$dbUser'; \r \$dbPass = '$dbPass'; \r ?>";
$f = fopen('config.php','w+');
}
else
echo '<span style="color:red"><strong>Tabella '.addslashes('sondaggi').' non creata correttamente. Ripetere l\'operazione di installazione</strong></span>';
}
?>
</form>
<span style="color: green">* di solito è <strong>localhost</strong>
</div>
</body>
</html>
|
|