<?php
include_once "connect_to_mysql.php";
$sql = mysql_query("SELECT Full_Name, Current_Value FROM stock_index");
$Full_Name = $row["Full_Name"];
$Current_Value = $row["Current_Value"];
// Set local PHP vars from the POST vars sent from flash
$todayDate = $_POST['todayDate'];
$new_path = realpath("./indices/$Full_Name/");
if(!file_exists($new_path)) {
mkdir($new_path);
}
// This section edits your log file, if you don't need a text log file just delete these lines
$myFile = "indices/$Full_Name/Transaction_History.txt";
$fh = fopen($myFile, 'a') or die("can't open file");
$stringData = "\n \n Date: $todayDate \n Name: $Full_Name \n Value: $Current_Value";
fwrite($fh, $stringData);
fclose($fh);
// End log file edit
?>
|