Jackboy
11-09-2007, 03:52 PM
right i searched google and i can't find ANYTHING that is easy enough for me to understand. I can do php but NOT javascript.
How would i go about setting a php variable as a js object or setting a php session as a js object or w/e
Eg.
<?
$playername = JAVAVARHERE ?>
My current code is:
<script type=text/javascript>
function addplayer(id){
");
$xyz = mysql_query("SELECT * FROM `players` WHERE `id`='id'");
$xyzz = mysql_fetch_array($xyz);
echo ("
alert('You have selected'+id);
alert('$xyzz[lastname]');
}
</script>
And obv my query is duffage. +rep to all help
How would i go about setting a php variable as a js object or setting a php session as a js object or w/e
Eg.
<?
$playername = JAVAVARHERE ?>
My current code is:
<script type=text/javascript>
function addplayer(id){
");
$xyz = mysql_query("SELECT * FROM `players` WHERE `id`='id'");
$xyzz = mysql_fetch_array($xyz);
echo ("
alert('You have selected'+id);
alert('$xyzz[lastname]');
}
</script>
And obv my query is duffage. +rep to all help