[x]
Posted via EE Mobile

Search, ask, and monitor your questions on the go with EE Mobile. Visit Experts Exchange from your mobile device and never be out of touch again.

Question
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

5.8

correcting more errors in online game

Asked by bartonjo2 in PHP Scripting Language

Tags: game

i keep getting this error :
Parse error: parse error, unexpected T_VARIABLE in /home/virtual/site3/fst/var/www/html/game/play.php on line 430
what could be wrong, try putting it in dream weaver to see the correct lines



heres my code:

<?php

$DEBUG=FALSE;

include('connect.php');



if ($DEBUG) { $uid=1; $dwmx1234='1852uujh'; }

else { $uid=$_COOKIE['uid']; $dwmx1234=$_COOKIE['dwmx1234']; }



if (!isset($change)) $change=0;

if (isset($_GET)) {

 $change=$_GET['change'];

  $POS=$_GET['POS'];

} // _GET data retrieved





if ($POS<0) $POS = 1;

else if ($POS>100) $POS = 100;

if ($change==1) { // a $change=1 value comes from $_GET

 $change=0;

 mysql_query("UPDATE users SET pos=$POS WHERE username='$uid';", $db);

} // if change



if (($uid) AND ($dwmx1234 == "1852uujh")) {

 $result = mysql_query("SELECT username, password, email, gold, hp, strength, level, exp, pos, special, map, accuracy FROM users where username='$uid'", $db);

 $userdata = mysql_fetch_array($result);

 $username = $userdata["username"];

 $passw = $userdata["password"];

 $emaila = $userdata["email"];

 $gold = $userdata["gold"];

 $hitpoints = $userdata["hp"];

 $strength = $userdata["strength"];

 $level = $userdata["level"];

 $exp = $userdata["exp"];

 $pass = base64_encode($passw);

 $email = base64_encode($emaila);

 $special = $userdata["special"];

 SETCOOKIE("pos", $userdata["pos"]);

 $map = $userdata["map"];
 
 $acc = $userdata["accuracy"];

 $POSITION = $pos;

 $chat = "chat.php";
 $monster = "Rabid Dog";

 if ($special == admin) {

 $adminonly = "admin.php";

 $valid = "1";

 }

 else {

 $adminonly = "blank.htm";

 }

 if ($special == mute) {

 $chat = "blank.htm";

  }

 if ($map == hide) {

 $dispmap = "blank.htm";

 }

 if ($map == show) {

 $dispmap = "map.php";

 }

else {

$dispmap = "map.php";

}

if ($dispmap == map.php) {

$view = hide;

}

if ($dispmap == blank.htm) {

$view = show;

}
setcookie("MYID",$uid);
$WINID = time();
include("monster.php");
 ?>




<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>

<head>

<title>Antioch Conquest</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<meta http-equiv="Pragma" content="no-cache">

<script language="javascript">
var strength1 = <?php echo $userdata["strength"]; ?>;
var acc1 = <?php echo $userdata["accuracy"]; ?>;
var mhp = <?php echo $hp; ?>;
var mexp = <?php echo $hp; ?>;
</script>


<STYLE TYPE="text/css"><!--

A:link     {

color:#999999;

text-decoration:none;

    }

A:visited     {

color:#999999;

text-decoration:none;

    }

A:hover     {

color:#FFFFFF;

font-style:italic;

text-decoration:none;

    }

A:active     {

color:#FFFFFF;

text-decoration:none;

    }

    .ib{color:#000000;background-color:#cccccc;border:1px solid #333333;font-family:Geneva}

//--></STYLE>

<script language="JavaScript" type="text/JavaScript">

<!--

function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}

//-->

</script>

</head>

<body bgcolor="#000000" background="images/images.jpg" text="#FFFFFF" link="#999999" vlink="#CCCCCC" alink="#FFFFFF">

<table width="100%" height="130" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

   <td background="/images/top.jpg"><img src="images/corner.jpg" width="10" height="10"></td>

    <td background="images/top.jpg" bgcolor="#000000"> </td>

  <td background="/images/top.jpg" bgcolor="#000000" height="1%"><img src="images/corner.jpg" width="10" height="10"></td>

</tr>

<tr>

   <td background="images/side.jpg" bgcolor="#000000" width="1%"></td>

  <td width="610" align="center" valign="middle" bgcolor="#000000"> <div align="left">

       <table width="100%" height="110" border="0" align="center" cellpadding="0" cellspacing="0">

        <tr>

            <td width="5%">User:</td>

          <td> <?php echo "$username"; ?> &nbsp;</td>

            <td width="5%">&nbsp;</td>

            <td width="7%">Exp:</td>

          <td><?php echo "$exp"; ?></td>

          <td colspan="2">&nbsp;</td>

        </tr>

        <tr>

            <td>HP:</td>

            <td width="16%"> <?php echo "$hitpoints"; ?> </td>

          <td>&nbsp;</td>

            <td>Pos:</td>

            <td width="21%"><?php echo "$POSITION"; ?></td>

          <td colspan="2">&nbsp;</td>

        </tr>

        <tr>

           <td>Gold:</td>

            <td width="16%"> <?php echo "$gold"; ?> </td>

          <td>&nbsp;</td>

          <td>Email:</td>

            <td width="21%"><?php echo "$emaila"; ?></td>

          <td colspan="2"><a href="email.php?uemail=<?php echo "$email"; ?>">Change</a></td>

        </tr>

        <tr>

            <td>Lvl:</td>

            <td width="16%"> <?php echo "$level"; ?> </td>

          <td>&nbsp;</td>

            <td>Pass:</td>

            <td width="21%">***********</td>

          <td colspan="2"><a href="password.php?upass=<?php echo "$pass"; ?>">Change</a></td>

        </tr>

        <tr>

            <td>Str:</td>

            <td width="16%"> <?php echo "$strength"; ?> </td>

          <td>&nbsp;</td>

            <td colspan="3" align="right"> <a href="playerlist.php" target="_blank">Player

              List</a> | <a href="play.php?map=<?php echo $view; ?>">Map</a>

              | Support | <a href="logout.php?DESTROY=1">Logout</a></td>

            <td width="29%" align="right">&nbsp;</td>

        </tr>

      </table>

        <br>

    </div></td>

  <td background="images/side.jpg" bgcolor="#000000" width="1%"></td>

</tr>

<tr>

    <td background="images/top.jpg"><img src="images/corner.jpg" width="10" height="10"></td>

    <td background="images/top.jpg" bgcolor="#000000"></td>

    <td background="images/top.jpg" bgcolor="#000000"><img src="images/corner.jpg" width="10" height="10"></td>

</tr>

</table>

<br>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td background="images/top.jpg"><img src="images/corner.jpg" width="10" height="10"></td>

    <td colspan="2" background="images/top.jpg" bgcolor="#000000"> <div align="center">

    </td>

    <td background="images/top.jpg" bgcolor="#000000"><img src="images/corner.jpg" width="10" height="10"></td>

  </tr>

  <tr>

    <td width="10" background="images/side.jpg" bgcolor="#000000"></td>

    <td width="539" bgcolor="#000000">

      <div align="left">Actions: Fight a Rabid Dog <br>
        <a href="play.php?nfmode=1"><img src="images/attack.jpg" width="54" height="30"></a><br>
        <?php echo $pmessage; ?><br><?php echo $mmessage; ?><br><?php echo $pmessage1; ?><br><?php echo $mmessage1; ?></div></td>

    <td width="227" align="right" valign="top" bgcolor="#000000">

      <?php

include("$dispmap");

?>

    </td>

    <td width="10" background="images/side.jpg" bgcolor="#000000"></td>

  </tr>

  <tr>

    <td background="images/top.jpg"><img src="images/corner.jpg" width="10" height="10"></td>

    <td height="10" colspan="2" background="images/top.jpg" bgcolor="#000000"></td>

    <td background="images/top.jpg" bgcolor="#000000"><img src="images/corner.jpg" width="10" height="10"></td>

  </tr>

</table>

<p><br>

  <?php  include("$adminonly"); ?>

  <br>

  <?php //include("$chat"); ?>

<iframe src="<?php echo "chat/chat.php?WINID=$WINID&CHATID=MYCHAT&MYID=$uid"; ?>" scrolling="yes" border=0 height=300 width=450></iframe>

</p>

</body>

</html>

<?php
// begin damage calculation
if (nfmode == 1) {
$nfmode = 0;
$max = rand(0.6,0.25);
$bonus2 = rand(1.5,2.5);
$chance = rand(0.05,$max);
$bonus = $chance * $acc;
$dbonus = $bonus * $bonus2;
$damage = $dbonus + $strength;
// end player damage calculation

//start monster damage calculation
$mmax = rand(0.6,0.25);
$mbonus2 = rand(1.5,2.5);
$mchance = rand(0.05,$mmax);
$mbonus = $mchance * $hp;
$mdbonus = $mbonus * $mbonus2;
$mdamage = $mdbonus + $hp;
// end monster damage calculation

// begin probability
$pmiss = rand(0,15);
$mmiss = rand(0,14);
if ($pmiss < 4) {
$damage = 0;
$pmessage1 = "You Have missed in your attack on the $monster";
                }
else     {
if ($mmiss < 4) {
$mmessage1 = "The $monster missed in its attack";
}
else {
$attacking = $hp - $damage;
$mattacking = $hitpoints - $mdamage;
if ($attacking <= 0) {
$pmessage1 = "You Have killed the $monster";
$exp = $exp + $experience;
                     }
else {
$pmessage1 = "You did $damage damage";
}



if ($mattacking <= 0)   {
$mmessage1 = "You Have Been killed by the $monster";


                         }
else {
$mmessage1 = "The $monster did $mdamage damage";



     
          }
}
}



}

else {

echo "<body bgcolor=black><font color=white>You must first Login!</font>";

}

?>
 
Related Solutions
Keywords: correcting more errors in online game
 
Loading Advertisement...
 
[+][-]06/04/03 08:23 PM, ID: 8653956Accepted Solution

View this solution now by starting your 30-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

About this solution

Zone: PHP Scripting Language
Tags: game
Sign Up Now!
Solution Provided By: aweeks007
Participating Experts: 1
Solution Grade: C
 
[+][-]06/05/03 04:07 AM, ID: 8655976Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/05/03 04:09 AM, ID: 8655987Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/05/03 04:11 AM, ID: 8655994Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06/07/03 07:23 AM, ID: 8672557Author Comment

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 30-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20091111-EE-VQP-92