Example #1
0
<?php

include "inc.php";
if (check_login() === true) {
    database("open");
    if (isset($_POST["sito"])) {
        $url = no_http(htmlspecialchars($_POST["sito"]));
        $nome = htmlspecialchars($_POST["nome"]);
        $luogo = htmlspecialchars($_POST["luogo"]);
        $email = htmlspecialchars($_POST["email"]);
        $persona = htmlspecialchars($_POST["persona"]);
        $telefono = $_POST["telefono"];
        if (!is_numeric($telefono)) {
            $telefono = "0000000000";
        }
        $primo = date('Y-m-d');
        $responso = "Inviato";
        $query = mysql_query("INSERT INTO dati (id, sito, nome, luogo, email, persona, telefono, primo, responso) VALUES (NULL, '" . $url . "', '" . $nome . "', '" . $luogo . "', '" . $email . "', '" . $persona . "', '" . $telefono . "', '" . $primo . "', '" . $responso . "')");
        if ($query) {
            $query = mysql_query("SELECT * FROM dati ORDER BY id DESC");
            $row = mysql_fetch_assoc($query);
            $id = $row["id"];
            $url = $row["sito"];
            $nome = $row["nome"];
            $luogo = $row["luogo"];
            $email = $row["email"];
            $persona = $row["persona"];
            $telefono = $row["telefono"];
            $primo = $row["primo"];
            $responso = $row["responso"];
            $class_responso = strtolower($responso);
Example #2
0
<?php

include "inc.php";
database("open");
$query = mysql_query("SELECT * FROM dati ORDER BY id DESC");
//print_r($query);
while ($row = mysql_fetch_assoc($query)) {
    $sito = no_http($row["sito"]);
    $responso = strtolower($row["responso"]);
    ?>

                <tr class="rigaDati <?php 
    echo $responso;
    ?>
" id="id-<?php 
    echo $row["id"];
    ?>
">
                    <th scope="row"><?php 
    echo $row["id"];
    ?>
</th> <td><a href="http://<?php 
    echo $sito;
    ?>
" title="<?php 
    echo $row["nome"];
    ?>
"><?php 
    echo $sito;
    ?>
</a></td> <td><?php