Almanacco del Calcio Toscano

Invio rosa

logo fantaeccellenza

[source]
<?php
ini_set(‘display_errors’, ‘On’);
error_reporting(E_ALL | E_STRICT);
require_once ‘fanta/database.php’;

$user_id = $_POST[‘id-utente’];
$sq = $_POST[‘squadra’];
$usr_name = $_POST[‘utente’];
$forma1 = $_POST[‘poriere1’];
$forma2 = $_POST[‘poriere2’];
$forma3 = $_POST[‘poriere3’];
$forma4 = $_POST[‘difensore1’];
$forma5 = $_POST[‘difensore2’];
$forma6 = $_POST[‘difensore3’];
$forma7 = $_POST[‘difensore4’];
$forma8 = $_POST[‘difensore5’];
$forma9 = $_POST[‘difensore6’];
$forma10 = $_POST[‘difensore7’];
$forma11 = $_POST[‘difensore8’];
$forma12 = $_POST[‘centrocampo1’];
$forma13 = $_POST[‘centrocampo2’];
$forma14 = $_POST[‘centrocampo3’];
$forma15 = $_POST[‘centrocampo4’];
$forma16 = $_POST[‘centrocampo5’];
$forma17 = $_POST[‘centrocampo6’];
$forma18 = $_POST[‘centrocampo7’];
$forma19 = $_POST[‘centrocampo8’];
$forma20 = $_POST[‘attacco1’];
$forma21 = $_POST[‘attacco2’];
$forma22 = $_POST[‘attacco3’];
$forma23 = $_POST[‘attacco4’];
$forma24 = $_POST[‘attacco5’];
$forma25 = $_POST[‘attacco6’];

$rosa = array($forma1, $forma2, $forma3, $forma4, $forma5, $forma6, $forma7, $forma8, $forma9, $forma10, $forma11, $forma12, $forma13, $forma14, $forma15, $forma16, $forma17, $forma18, $forma19, $forma20, $forma21, $forma22, $forma23, $forma24, $forma25);

//require_once ‘fanta/controllo_25.php’;

foreach($rosa as $giocatore)

{

// preparo la query
$query = “INSERT INTO rosa (id_user, nome_squadra, id_giocatore)
VALUES (‘$user_id’, ‘$sq’, ‘$giocatore’)”;

// lancio la query
$result = mysql_query($query);

//echo $user_id, ‘</h3>’, $sq, ‘</h3>’,$giocatore;
// controllo l’esito
if (!$result) {
die(“Errore nella query $query: ” . mysql_error());
}
}

// chiudo la connessione a MySQL
mysql_close();

//echo $user, $psw, $email, $recapito, $email, $sq, $fanta, $forma1, $forma2, $forma3, $forma4, $forma5, $forma6;

//echo ‘<h2> Hai inserito la tua rosa</h2>’;
echo ‘<h3 style=”text-align: center;”>’, $usr_name, ‘ Hai inserito la rosa della tua squadra ‘, $sq, ‘</h3>’;

//echo ‘<br />’, “1 “, $forma1, ‘<br />’, “2 “, $forma2, ‘<br />’, “3 “, $forma3, ‘<br />’, “4 “, $forma4, ‘<br />’, “5”, $forma5, ‘<br />’, “6”, $forma6, ‘<br />’, “7”, $forma7, ‘<br />’, “8”, $forma8, ‘<br />’, “9”, $forma9, ‘<br />’, “10”, $forma10, ‘<br />’, “11”, $forma11, ‘<br />’, “12”, $forma12, ‘<br />’, “13”, $forma13, ‘<br />’, “14”, $forma14, ‘<br />’, “15”, $forma15, ‘<br />’, “16”, $forma16, ‘<br />’, “17”, $forma17, ‘<br />’, “18”, $forma18, ‘<br />’, “19”, $forma19, ‘<br />’, “20”, $forma20, ‘<br />’, “21”, $forma21, ‘<br />’, “22”, $forma22, ‘<br />’, “23”, $forma23, ‘<br />’, “24”, $forma24, ‘<br />’, “25”, $forma25;
echo ‘<div style=”text-align: center;”>’;
echo ‘<a class=”btn btn-success” href=”https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=75″ role=”button”>Continua</a></div>’;

//header(‘Location: https://vibrant-bhaskara.185-216-75-167.plesk.page/index.php?option=com_content&view=article&id=75’);

?>
[/source]