Okay so I am not sure how I would do this but I have a inventory script going and I am not sure how to put javascript into php.
Any help?
<?php
include("../../connect.php");
if(!isset($_COOKIE['player_id']))
die('Please login.<br><a href=../../index.php>Go back</a>.');
$Player=$_COOKIE['player_id'];
$Query="SELECT * from Users where ID='$Player'";
$Query2=mysql_query($Query) or die("Could not get user stats.");
$User=mysql_fetch_array($Query2);
if($_COOKIE['password'] !=md5($User['Password']))
die('Your Password doesnt seem right for this account. <a href=../../index.php>go back</a>');
?>
<script type="text/javascript">
function unequip()
{
<?php $new= ?>document.getElementById("item")
<?php mysql_query("UPDATE `Inventory` SET Equipped='No' WHERE Name='$new'"); ?>
}
function equip()
{
<?php $new= ?>document.getElementById("item")
<?php mysql_query("UPDATE `Inventory` SET Equipped='Yes' WHERE Name='$new'"); ?>
}
</script>
<?php
$Truvo=mysql_query("SELECT * FROM `Inventory` WHERE Owner='$Player' ORDER BY Equipped LIMIT 15") or die("The inventory died!");
$colors=Mysql_query("SELECT Equipped From Inventory WHERE Owner='$Player'");
if($colors=="Yes"){
$color=CC0000;
$equip=unequip();
}else{
$color=FFFFFF;
$equip=equip();
}
while($Item=mysql_fetch_array($Truvo)){
print"<input type=\"text\" name=\"item\" ondblclick=\"".$equip."\" value=\"".$Item['Name']."\" style=\"background-color: ".$color.";\" readonly>";
}
?>
error:
Parse error: syntax error, unexpected ';' in /home/riseofim/public_html/riseofimmortals.com/Main/inventory.php on line 15