Salva la formazione
[source]
<?php
ini_set(‘display_errors’, ‘On’);
error_reporting(E_ALL | E_STRICT);
require_once ‘fanta/utentej.php’;
if($usr_id == 0){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=81’);
}
require_once ‘fanta/database.php’;
$id_modulo = $_POST[‘modulo’];
$id_giornata = $_POST[‘giornata’];
$forma1 = $_POST[‘giocatore1’];
$forma2 = $_POST[‘giocatore2’];
$forma3 = $_POST[‘giocatore3’];
$forma4 = $_POST[‘giocatore4’];
$forma5 = $_POST[‘giocatore5’];
$forma6 = $_POST[‘giocatore6’];
$forma7 = $_POST[‘giocatore7’];
$forma8 = $_POST[‘giocatore8’];
$forma9 = $_POST[‘giocatore9’];
$forma10 = $_POST[‘giocatore10’];
$forma11 = $_POST[‘giocatore11’];
$forma12 = $_POST[‘giocatore12’];
$forma13 = $_POST[‘giocatore13’];
$forma14 = $_POST[‘giocatore14’];
$forma15 = $_POST[‘giocatore15’];
$forma16 = $_POST[‘giocatore16’];
$forma17 = $_POST[‘giocatore17’];
$forma18 = $_POST[‘giocatore18’];
$forma = array($forma1, $forma2, $forma3, $forma4, $forma5, $forma6, $forma7, $forma8, $forma9, $forma10, $forma11, $forma12, $forma13, $forma14, $forma15, $forma16, $forma17, $forma18);
if($id_modulo == 0 & $id_giornata == 0)
{
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=101’);
}
for ($con = 0; $con <= 17; ++$con) {
if ($forma[$con] == 0){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=101’);
}
}
//echo ‘controllo 0 <br/ >’;
for ($con = 1; $con <= 17; ++$con) {
if ($forma[0] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;
} //echo $forma[0], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
//echo ‘controllo 1 <br/ >’;
for ($con = 2; $con <= 17; ++$con) {
if ($forma[1] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;
}//echo $forma[1], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
//echo ‘controllo 2 <br/ >’;
for ($con = 3; $con <= 17; ++$con) {
if ($forma[2] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;
} //echo $forma[2], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
//echo ‘controllo 3 <br/ >’;
for ($con = 4; $con <= 17; ++$con) {
if ($forma[3] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘uguale3’;
} //echo $forma[3], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
//echo ‘controllo 4 <br/ >’;
for ($con = 5; $con <= 17; ++$con) {
if ($forma[4] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;
} //echo $forma[4], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
//echo ‘controllo 5 <br/ >’;
for ($con = 6; $con <= 17; ++$con) {
if ($forma[5] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’; } echo $forma[5], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
}
//echo ‘controllo 6 <br/ >’;
for ($con = 7; $con <= 17; ++$con) {
if ($forma[6] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;} echo $forma[6], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
}
//echo ‘controllo 7 <br/ >’;
for ($con = 8; $con <= 17; ++$con) {
if ($forma[7] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;} echo $forma[7], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
}
//echo ‘controllo 8 <br/ >’;
for ($con = 9; $con <= 17; ++$con) {
if ($forma[8] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;} echo $forma[8] , ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
}
//echo ‘controllo 9 <br/ >’;
for ($con = 10; $con <= 17; ++$con) {
if ($forma[9] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;} echo $forma[9], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
}
//echo ‘controllo 10 <br/ >’;
for ($con = 11; $con <= 17; ++$con) {
if ($forma[10] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;} echo $forma[10], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
}
//echo ‘controllo 11 <br/ >’;
for ($con = 12; $con <= 17; ++$con) {
if ($forma[11] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;} echo $forma[11], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
}
//echo ‘controllo 12 <br/ >’;
for ($con = 13; $con <= 17; ++$con) {
if ($forma[12] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;} echo $forma[12], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
}
//echo ‘controllo 13 <br/ >’;
for ($con = 14; $con <= 17; ++$con) {
if ($forma[13] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;} echo $forma[13], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
}
//echo ‘controllo 14 <br/ >’;
for ($con = 15; $con <= 17; ++$con) {
if ($forma[14] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;} echo $forma[14], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
}
//echo ‘controllo 15 <br/ >’;
for ($con = 16; $con <= 17; ++$con) {
if ($forma[15] == $forma[$con]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘<h2>uguale a </h2>’, $forma[$con], ‘ |<br/ >’;} echo $forma[15], ‘= ‘, $forma[$con], ‘ |<br/ >’;
}
}
//echo ‘controllo 16-17 <br/ >’;
if ($forma[16] == $forma[17]){
header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=100’);
//echo ‘uguale16-17’;} echo $forma[16], ‘= ‘, $forma[17], ‘ |<br/ >’;
}
$squadra = array($forma1, $forma2, $forma3, $forma4, $forma5, $forma6, $forma7, $forma8, $forma9, $forma10, $forma11, $forma12, $forma13, $forma14, $forma15, $forma16, $forma17, $forma18);
for ($i = 0, $n = count($squadra) ; $i < $n ; $i++)
{
if($i <= 10 ){
$ps = 1;
} else {
$ps = 2;
}
$sq = $squadra[$i];
// preparo la query
$query = “INSERT INTO squadra (id_rosa, id_giornata, id_user, id_modulo, id_pres)
VALUES (‘$sq’, ‘$id_giornata’, ‘$usr_id’, ‘$id_modulo’, ‘$ps’)”;
// lancio la query
$result = mysql_query($query);
//echo $sq, ‘-‘, $id_giornata, ‘-‘, $usr_id, ‘-‘, $id_modulo, ‘-‘, $ps, ‘<br/ >’;
// controllo l’esito
if (!$result) {
die(“Errore nella query $query: ” . mysql_error());
}
}
// chiudo la connessione a MySQL
mysql_close();
echo ‘<h3 style=”text-align: center;”>’, $usr_name, ‘ Hai inserito la tua formazione </h3>’;
echo ‘<div style=”text-align: center;”>’;
echo ‘<a class=”btn btn-success btn-lg” href=”https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=75″ role=”button”>Torna al FantaEccellenza</a>’;
echo ‘</div>’;
?>
[/source]