예제 #1
0
<?php

$_email = "*****@*****.**";
if (isset($_POST['text'])) {
    $_meta_redirect = "<meta http-equiv=\"refresh\" content=\"5; URL=/\">";
}
print "\n\n\t<!-- <! DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\"\n        \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\" //-->\n\t<html> <!-- xmlns=\"http://www.w3.org/1999/xhtml\" lang=\"en\" xml:lang=\"en\" //-->\n\t <head>\n\t\t" . $_meta_redirect . "\n\t\t<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\" />\n\t\t<title>htdoogle - google with htdig</title>\n\t\t<link rel=\"stylesheet\" type=\"text/css\" href=\"format.css\" />\n\t </head>\n\t <body scroll=auto>\n\t  <!-- container //-->\n\t  <table class=\"container\">\n\t   <tr><td class=\"container\" align=center>\n\t<img src=\"htdoogle_90.jpg\" width=\"425\" height=\"120\" border=\"0\" alt=\"HT://doogle - logo\" />\n\t<p/>";
#mail("*****@*****.**", "htdoogle", "test");
print "\n\t<table width=400 border=0 cellspacing=0 cellpadding=0>\n\t\t  <tr><td align=center>";
if (isset($_POST['text'])) {
    $_subject = "htdoogle - " . $_POST['topic'];
    $_text = $_POST['text'];
    mail($_email, $_subject, $_text);
    print "<b>your message was successfully send </b><br>";
    print "<font size=-1>( your are automatically redirected back to front page in 5 seconds)<br/>";
    print "<a href=\"/\">if automatic redirect fails, click here</font></a>";
} else {
    print mail_form();
}
print "</td>\n\t\t  </tr></table>";
print "\t</td>\n   </tr>\n  </table>\n </body>\n</html>";
function mail_form()
{
    return "<h3>mail form</h3>\n\t\t\t<form method=post>\n\t\t\t<table border=0>\n\t\t\t <tr>\n\t\t\t  <td align=center>\n\t\t\t\tsubject &nbsp;&nbsp;<input type=\"text\" name=subject class=\"style\">\n\t\t\t  </td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t  <td align=right colspan=2>\n\t\t\t\t<textarea scroll=auto name=\"text\" cols=50 rows=20 class=\"style\" ></textarea>\n\t\t\t  </td>\n\t\t\t </tr>\n\t\t\t <tr>\n\t\t\t  <td align=center>\n\t\t\t   topic &nbsp;\n\t\t\t   <input type=\"radio\" name=\"topic\"value=\"bug\"> bug </input>\n\t\t\t   <input type=\"radio\" name=\"topic\" checked value=\"bug\"> other </input>\n\t\t\t   <p/>\n\t\t\t   <input type=\"submit\" value=\"  send  \" class=\"style\">\n\t\t\t  </td>\n\t\t\t </tr>\n\t\t\t</table>\n\n\t\t\t</form>";
}
        }
        $subject = "Feedback from web site";
        $mailcontent = "Client first name: " . $first_name . "\n" . "Client last name:" . $last_name . "\n" . "Clinet: email " . $email . "\n" . "Client comments:\n" . $message . "\n";
        $fromaddress = "From: time-box.tk website ";
        $send = mail($toaddress, $subject, $mailcontent, $fromaddress);
        if ($send) {
            $query = "insert into contacts(first_name,last_name,email,message)values(?,?,?,?)";
            $stmt = $con->prepare($query);
            $stmt->bind_param("ssss", $first_name, $last_name, $email, $message);
            $stmt->execute();
            echo $stmt->affected_rows . ' message sent';
            $stmt->close();
            header("Location:http://www.time-box.tk");
        }
    }
} catch (Exception $e) {
    add_header("Error");
    echo "<div class='container'>";
    echo "<div class='row'>";
    echo "<div class='wrapper'>";
    echo "<div class='col-md-8'>";
    echo "<div class='alert alert-warning' role='alert' style='margin-top='10%;'>";
    echo $e->getMessage();
    echo "</div>";
    mail_form();
    echo "</div>";
    echo "</div>";
    echo "</div>";
    echo "</div>";
    add_footer();
}
예제 #3
0
</div>
			<?php 
        } else {
            // welcome user
            echo $welcome_call_unauth;
            index_unauth($sess, $menu);
        }
    } else {
        // authorized user
        if ($edid != "" || $sedid != "" || $did != "") {
            // edit or delete announce
            include "./includes/post.inc.php";
        }
        if ($action == "mail") {
            //  message to admin - form
            mail_form($sess);
        } elseif ($action == "form") {
            // forms
            if ($type == "new") {
                // new announce
                if ($text != "") {
                    include "./includes/post.inc.php";
                }
                announces_new($sess, $chtext, $a_id, $dp, $platn, $chcena, $rub, $pri, $error, $result, h3);
            } else {
                // edit announce
                announces_edit($sess, $eid, $chtext, $a_id, $dp, $platn, $chcena, $rub, $pri, $error, $result);
            }
        } else {
            if ($action == "user") {
                // user´s announces