Porównaj commity

...

4 Commity

Autor SHA1 Wiadomość Data
to3k eef178c475
Added database export to CSV 2022-11-29 13:56:36 +01:00
to3k 042377d0d5
Add files via upload 2022-11-29 13:53:57 +01:00
to3k c0553bdcd3
Update contact.php 2022-11-29 08:44:08 +01:00
to3k 1cd6f1795a
Update bug_report.php 2022-11-29 08:43:22 +01:00
4 zmienionych plików z 45 dodań i 16 usunięć

Wyświetl plik

@ -23,10 +23,9 @@
if(addslashes(strip_tags($_POST['form_address'])) != "" AND addslashes(strip_tags($_POST['form_name'])) != "" AND addslashes(strip_tags($_POST['form_message'])) != "")
{
$email = addslashes(strip_tags($_POST['form_address']));
$email = filter_var($email, FILTER_SANITIZE_EMAIL);
$check = '/^[a-zA-Z0-9.\-_]+@[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,4}$/';
if(preg_match($check, $email))
if (filter_var($email, FILTER_VALIDATE_EMAIL))
{
if($_SESSION['captcha'] != addslashes(strip_tags($_POST['user_code'])))
{
@ -39,7 +38,7 @@
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
</head>
<body>
<b>Submitter's address:</b> ".addslashes(strip_tags($_POST['form_address']))."<br>
<b>Submitter's address:</b> ".$email."<br>
<b>Submitter's name:</b> ".addslashes(strip_tags($_POST['form_name']))."<br>
<b>IP:</b> ".addslashes(strip_tags($_POST['ip']))."<br>
<b>Problem with:</b> ".addslashes(strip_tags($_POST['form_case']))."<br>
@ -49,7 +48,7 @@
</html>";
$subject="Bug report from Twittodon.com ".date('d-m-Y H:i');
$header = "MIME-Version: 1.0r\n"."Content-type: text/html; charset=utf-8\n";
$header .= "From: ".addslashes(strip_tags($_POST['form_address']))."\n";
$header .= "From: ".$email."\n";
$address = "support@twittodon.com";
mail($address, $subject, $message, $header);
@ -344,4 +343,4 @@
</div>
</body>
</html>
</html>

Wyświetl plik

@ -11,10 +11,9 @@
if(addslashes(strip_tags($_POST['form_address'])) != "" AND addslashes(strip_tags($_POST['form_name'])) != "" AND addslashes(strip_tags($_POST['form_message'])) != "")
{
$email = addslashes(strip_tags($_POST['form_address']));
$email = filter_var($email, FILTER_SANITIZE_EMAIL);
$check = '/^[a-zA-Z0-9.\-_]+@[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,4}$/';
if(preg_match($check, $email))
if (filter_var($email, FILTER_VALIDATE_EMAIL))
{
if($_SESSION['captcha'] != addslashes(strip_tags($_POST['user_code'])))
{
@ -27,7 +26,7 @@
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
</head>
<body>
<b>Submitter's address:</b> ".addslashes(strip_tags($_POST['form_address']))."<br>
<b>Submitter's address:</b> ".$email."<br>
<b>Submitter's name:</b> ".addslashes(strip_tags($_POST['form_name']))."<br>
<b>IP:</b> ".addslashes(strip_tags($_POST['ip']))."<br>
<b>Message:</b><br>
@ -36,7 +35,7 @@
</html>";
$subject="Message from Twittodon.com ".date('d-m-Y H:i');
$header = "MIME-Version: 1.0r\n"."Content-type: text/html; charset=utf-8\n";
$header .= "From: ".addslashes(strip_tags($_POST['form_address']))."\n";
$header .= "From: ".$email."\n";
$address = "contact@twittodon.com";
mail($address, $subject, $message, $header);
@ -330,4 +329,4 @@
</div>
</body>
</html>
</html>

24
download.php 100644
Wyświetl plik

@ -0,0 +1,24 @@
<?php
$filename = 'Twittodon_com_db.csv';
$export_data = unserialize($_POST['export_data']);
// file creation
$file = fopen($filename,"w");
foreach ($export_data as $line){
fputcsv($file,$line);
}
fclose($file);
// download
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=".$filename);
header("Content-Type: application/csv; ");
readfile($filename);
// deleting file
unlink($filename);
exit();
?>

Wyświetl plik

@ -252,7 +252,8 @@
</thead>
<tbody>
<?php
while($fromdb = mysqli_fetch_row($result))
$export_arr = array();
while($fromdb = mysqli_fetch_row($result))
{
//$fromdb[0] - id
//$fromdb[1] - twitter_login
@ -273,12 +274,18 @@
echo "<td style=\"white-space: normal\"><a href=\"".$mastodon_link."\" target=\"_blank\">".$fromdb[3]."</a><br>".$fromdb[7]."</highlight_purple></td>";
echo "<td style=\"white-space: nowrap\">".$fromdb[9]."</td>";
echo "</tr>";
$export_arr[] = array($fromdb[1],$fromdb[3],$fromdb[9]);
}
$serialize_export_arr = serialize($export_arr);
?>
</tbody>
</table>
<br><br>
<br>
<form method="post" action="download.php">
<textarea name="export_data" style="display: none;"><?php echo $serialize_export_arr; ?></textarea>
<button type="submit" name="Export">Download entire table as a CSV file</button>
</form>
<br>
<label>
<center>
<table style="font-size: 12px;">
@ -337,4 +344,4 @@
</script>
</body>
</html>
</html>