Added vote to site

This commit is contained in:
Unick Soft
2017-07-28 00:17:42 +03:00
parent a64fff2dd9
commit ab0d155367
23 changed files with 199 additions and 9 deletions

View File

@@ -1,4 +1,5 @@
<?
include ("../core/config/main.php");
include ("saveGraphHelpers.php");
$name = $_GET["name"];

View File

@@ -1,4 +1,5 @@
<?
include ("../core/config/main.php");
include ("saveGraphHelpers.php");
$graph = file_get_contents("php://input");

View File

@@ -3,8 +3,6 @@
Function to save/open graph
*/
include ("../core/config/main.php");
// Only latic.
function isValidName($name)
{

View File

@@ -1,4 +1,6 @@
<?php
include ("../core/config/main.php");
include ("saveGraphHelpers.php");
$name = $_GET["name"];

15
cgi-bin/vote.php Normal file
View File

@@ -0,0 +1,15 @@
<?
include ("../core/config/main.php");
if (!isset($_COOKIE["vote0"]))
{
$index = $_GET["index"];
setcookie("vote0", "true", time() + 3600 * 24 * 90, '/'); // 3 month
$file = fopen("../" . $g_config['vote'], "a");
fprintf($file, "%d\n", $index);
fclose($file);
echo ("OK");
}
?>