mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-02-16 02:30:51 +00:00
Added vote to site
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
<?
|
||||
include ("../core/config/main.php");
|
||||
include ("saveGraphHelpers.php");
|
||||
|
||||
$name = $_GET["name"];
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?
|
||||
include ("../core/config/main.php");
|
||||
include ("saveGraphHelpers.php");
|
||||
|
||||
$graph = file_get_contents("php://input");
|
||||
|
||||
@@ -3,8 +3,6 @@
|
||||
Function to save/open graph
|
||||
*/
|
||||
|
||||
include ("../core/config/main.php");
|
||||
|
||||
// Only latic.
|
||||
function isValidName($name)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
<?php
|
||||
|
||||
include ("../core/config/main.php");
|
||||
include ("saveGraphHelpers.php");
|
||||
|
||||
$name = $_GET["name"];
|
||||
|
||||
15
cgi-bin/vote.php
Normal file
15
cgi-bin/vote.php
Normal 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");
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user