Ho provato a scrivere il codice, ma non salva i risultati.
gioca.php
Codice PHP:
<head>
<title>Fluent english</title>
</head>
<body>
<?php
define('IN_PHPBB', true);
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : 'http://altutto.altervista.org/f';
$phpEx = substr(strrchr(__FILE__, '.'), 1);
include($phpbb_root_path . 'common.' . $phpEx);
// Start session management
$user->session_begin;
$auth->acl='$user->data';
$user->setup;
if ($user->data['user_id'] == ANONYMOUS)
{
login_box('', $user->lang['LOGIN']);
}
include('template.php');
include("{$phpbb_root_path}viewforum.$phpEx");
?>
</body>
template.php
Codice PHP:
<!-- INCLUDE overall_header.html -->
<h2>Fluent English</h2>
<div class="panel">
<div class="inner"><span class="corners-top"><span></span></span>
<div class="content">
<p>
<?php
$connessione = mysqli_connect('localhost', 'altutto', 'miapassword', 'my_altutto');
if (!$connessione) {
die('Connect Error (' . mysqli_connect_errno() . ') '
. mysqli_connect_error());
}
if($_POST['hello']=="ciao"){ echo 'Risposta esatta!
how are you
<form name="howareyou" action="gioca.php" method="post">
<table>
<tr>
<td>Traduzione:</td><td><input type="text" name="howareyou" id="howareyou"></text></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Conferma"></td>
</tr>
</table>
</form>';
$query = "UPDATE avphpbb SET livello_ef='2' WHERE id = data['user_id']" ;
echo 'I tuoi progressi sono stati aggiornati.';
}
else if($_POST['hello']==""){echo '';
}
else{echo 'Risposta errata! Riprova.
<form name="hello" action="gioca.php" method="post">
<table>
<tr>
<td>Traduzione:</td><td><input type="text" name="hello" id="hello"></text></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Conferma"></td>
</tr>
</table>
</form>';
}
if($_POST['howareyou']==""){echo '';
}
else if($_POST['howareyou']=="come stai"){echo 'Risposta esatta!
<form name="whatsyourname" action="gioca.php" method="post">
what is your name
<table>
<tr>
<td>Traduzione:</td><td><input type="text" name="whatsyourname" id="whatsyourname"></text></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Conferma"></td>
</tr>
</table>
</form>';
$query = "UPDATE avphpbb SET livello_ef='3' WHERE id = data['user_id']";
echo 'I tuoi progressi sono stati aggiornati.';
}
else{echo 'Risposta errata! Riprova.
how are you
<form name="howareyou" action="gioca.php" method="post">
<table>
<tr>
<td>Traduzione:</td><td><input type="text" name="howareyou" id="howareyou"></text></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Conferma"></td>
</tr>
</table>
</form>';
}
if($_POST['whatsyourname']==""){echo '';
}
else if($_POST['whatsyourname']=="come ti chiami" or $_POST['whatsyourname']=="qual è il tuo nome"){echo 'Risposta esatta!
I am happy
<form name="imhappy" action="gioca.php" method="post">
<table>
<tr>
<td>Traduzione:</td><td><input type="text" name="imhappy" id="imhappy"></text></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Conferma"></td>
</tr>
</table>
</form>';
$query = "UPDATE avphpbb SET livello_ef='4' WHERE id = data['user_id']";
echo 'I tuoi progressi sono stati aggiornati.';
}
else{echo 'Risposta errata! Riprova.
<form name="whatsyourname" action="gioca.php" method="post">
what is your name
<table>
<tr>
<td>Traduzione:</td><td><input type="text" name="whatsyourname" id="whatsyourname"></text></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="submit" value="Conferma"></td>
</tr>
</table>
</form>';
}
?>
</p>
</div>
<span class="corners-bottom"><span></span></span></div>
</div>
<!-- INCLUDE jumpbox.html -->
<!-- INCLUDE overall_footer.html -->
Cosa ho sbagliato?