Hi, I'm wondering is it possible to store a javascript variable in php? I need to store the global variable 'realCount' into my database - is the php able to recognise the javascript variable or should I change it?? Thanks
if (realCount<9)
{
var str="";
for(i=0;i<numMoves;++i)
{
if (i) str+=",";
str+=histo;
<?
$dbHost = "******";
$dbUser = "rmh2";
$dbPass = "******";
$dbDatabase = "2004_solitaire";
// Connect to DB
$li = mysql_connect($dbHost, $dbUser, $dbPass) or die("Could not connect");
mysql_select_db($dbDatabase, $li) or die ("could not select DB");
$scores_str = ""; // $scores_str is the string to append entries to
$boardtype = "English 12";
$score = realCount;
$bestscore = "7";
$names = "";
$scores_query = "insert into scores
values('$boardtype', '$score', '$bestscore', 0)";
mysql_query($scores_query);
$res = mysql_affected_rows();
// Close MySQL Connection
mysql_close($li);
?>
}