#1 (permalink)  
Old 10-07-06, 05:22 PM
Danyal Danyal is offline
Newbie Coder
 
Join Date: Oct 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Error

Hello,

My site has a error:
Quote:
Parse error: syntax error, unexpected T_STRING in /home/***/public_html/playground/maps.php on line 341
Line 341:

PHP Code:

$getopp="SELECT * from a_pokemon where Pokemon='$getuser3[Opponent]'";

$getopp2=mysql_query($getopp) or die("Could not get Pokemon from database.");
$getopp3=mysql_fetch_array($getopp2); 


Thanks,

Danyal.

Last edited by Christian; 10-08-06 at 02:21 PM. Reason: Please use [PHP] wrapper when posting PHP code.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 10-07-06, 05:39 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
Errors like this are usually caused by something missing prior to the line where the error was discovered. Post 10 or so lines before the error too.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 10-07-06, 06:41 PM
Yusayoh Yusayoh is offline
New Member
 
Join Date: Oct 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
It could also be table names and such.
I use this for errors like those:
http://www.meandeviation.com/tutoria...-syntax-check/
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 10-07-06, 06:58 PM
nova912's Avatar
nova912 nova912 is offline
Code Guru
 
Join Date: Sep 2004
Location: Traverse City, MI, USA
Posts: 821
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Yusayoh
It could also be table names and such.
I use this for errors like those:
http://www.meandeviation.com/tutoria...-syntax-check/
The script it self did not even run, it found an error with syntax, it's probably caused by not closing a tag or argument like, like...
PHP Code:

if(isset($var){$string
PHP was expecting a ")" so it keept searching for a ")" untill it came apon one later in the script. thus everything between the if(... and the random ")" does not make sense.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 10-07-06, 07:43 PM
Danyal Danyal is offline
Newbie Coder
 
Join Date: Oct 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Please use [PHP] wrappers when posting PHP code.

Here is the script:

The bold part is the error line.

PHP Code:

<?php

if(!isset($_GET['Using']))
{
  
$Using'Starter';
}
else
{
  
$Using=$_GET['Using'];
}
if(
$Using != Starter && $Using != Second && $Using != Third && $Using != Fourth && $Using != Fifth && $Using != Sixth)
{
$Using Starter;}

if(!isset(
$_GET['Switched']))
{
  
$Switched'0';
}
else
{
  
$Switched=$_GET['Switched'];
}

  
$get1pokemon="SELECT * from t_pokemon where ID='$getuser3[Starter]'";
  
$get1pokemon2=mysql_query($get1pokemon) or die("Could not get Pokemon from database.");
  
$get1pokemon3=mysql_fetch_array($get1pokemon2);

  
$getusingp="SELECT * from t_pokemon where ID='$getuser3[$Using]'";
  
$getusingp2=mysql_query($getusingp) or die("Could not get Pokemon from database.");
  
$getusingp3=mysql_fetch_array($getusingp2);

  
$getp="SELECT * from a_pokemon where Pokemon='$getusingp3[Pokemon]'";
  
$getp2=mysql_query($getp) or die("Could not get Pokemon from database.");
  
$getp3=mysql_fetch_array($getp2);

  
$getevolve="SELECT * from a_pokemon where Number='$getusingp3[Number]+1'";
  
$getevolve2=mysql_query($getevolve) or die("Could not get Pokemon from database.");
  
$getevolve3=mysql_fetch_array($getevolve2);

$getattack4="SELECT * from attacks where Attack='$getusingp3[Attack1]'";
  
$getattack5=mysql_query($getattack4) or die("Could not get Pokemon from database.");
  
$getattack6=mysql_fetch_array($getattack5);

$getattack7="SELECT * from attacks where Attack='$getusingp3[Attack2]'";
  
$getattack8=mysql_query($getattack7) or die("Could not get Pokemon from database.");
  
$getattack9=mysql_fetch_array($getattack8);

$getattack10="SELECT * from attacks where Attack='$getusingp3[Attack3]'";
  
$getattack11=mysql_query($getattack10) or die("Could not get Pokemon from database.");
  
$getattack12=mysql_fetch_array($getattack11);

$getattack13="SELECT * from attacks where Attack='$getusingp3[Attack4]'";
  
$getattack14=mysql_query($getattack13) or die("Could not get Pokemon from database.");
  
$getattack15=mysql_fetch_array($getattack14);

$UpdateMap="Update trainers set Map='$map', X='$x', Y='$y' where Username='$user'";
    
mysql_query($UpdateMap) or die("Could not set Map.");

@
$hp = (($get1pokemon3[HP])/$get1pokemon3[MHP])*100;
@
$hp2 100-$hp;

if(
$get2pokemon3)
{
$hp5 = (($get2pokemon3[HP])/$get2pokemon3[MHP])*100;
$hp6 100-$hp5;
}
if(
$get3pokemon3)
{
$hp7 = (($get3pokemon3[HP])/$get3pokemon3[MHP])*100;
$hp8 100-$hp7;
}
if(
$get4pokemon3)
{
$hp9 = (($get4pokemon3[HP])/$get4pokemon3[MHP])*100;
$hp10 100-$hp9;
}
if(
$get5pokemon3)
{
$hp11 = (($get5pokemon3[HP])/$get5pokemon3[MHP])*100;
$hp12 100-$hp11;
}
if(
$get6pokemon3)
{
$hp13 = (($get6pokemon3[HP])/$get6pokemon3[MHP])*100;
$hp14 100-$hp13;
}

?>
<center>
<script>

function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}
</script>

<script>

var linktext=new Array()
linktext[0]="Select An Attack<form method=\"POST\" onSubmit=\"submitonce(this)\"><table width='220' cellspacing='0' cellpadding='0' style='border-collapse:collapse'><tr><td style='border:1px solid black' valign='top' bgcolor='<?php print "$getattack6[Color]"?>' width='50%'><font face='verdana' size='1'><INPUT  TYPE=RADIO NAME=Attack VALUE=\"<?php print "$getusingp3[Attack1]"?>\" CHECKED ><?php print "$getusingp3[Attack1]"?></INPUT></td><td style='border:1px solid black' valign='top' bgcolor='<?php print "$getattack9[Color]"?>'><font face='verdana' size='1'><INPUT  TYPE=RADIO NAME=Attack VALUE=\"<?php print "$getusingp3[Attack2]"?>\"><?php print "$getusingp3[Attack2]"?></INPUT></td></tr><tr><td style='border:1px solid black' valign='top' bgcolor='<?php print "$getattack12[Color]"?>'><font face='verdana' size='1'><INPUT  TYPE=RADIO NAME=Attack VALUE=\"<?php print "$getusingp3[Attack3]"?>\"><?php print "$getusingp3[Attack3]"?></INPUT></td><td style='border:1px solid black' valign='top' bgcolor='<?php print "$getattack15[Color]"?>'><font face='verdana' size='1'><INPUT  TYPE=RADIO NAME=Attack VALUE=\"<?php print "$getusingp3[Attack4]"?>\"><?php print "$getusingp3[Attack4]"?></INPUT></td></tr></table><button type=\"submit\" name=\"attack\" value=\"attack\" class='button2'>Attack!</button></form>"

linktext[1]="Switch Pokemon<br><table width='220' cellspacing='1' cellpadding='0'><?php if($Using != Starter && $get1pokemon3[HP] > 0){print "<tr><td valign='top' width='50%' style='border:1px solid black' bgcolor='$get1pokemon3[Color]'><font face='verdana' size='1' color='$font'><b><a href='index.php?mode=maps&map=Route11&x=15&y=0&Using=Starter&Switched=1'>$get1pokemon3[Pokemon]</a><img src='images/$get1pokemon3[Gender].gif'></td><td valign='top'><font face='verdana' size='1'><b>HP:</b> $get1pokemon3[HP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp' bgcolor='steelblue'></td><td width='$hp2'></tr></table></td></tr>";} ?><?php if($Using != Second && $get2pokemon3[HP] > 0){print "<tr><td valign='top' width='50%' style='border:1px solid black' bgcolor='$get2pokemon3[Color]'><font face='verdana' size='1' color='$font'><b><a href='index.php?mode=maps&map=Route11&x=15&y=0&Using=Second&Switched=1'>$get2pokemon3[Pokemon]</a><img src='images/$get2pokemon3[Gender].gif'></td><td valign='top'><font face='verdana' size='1'><b>HP:</b> $get2pokemon3[HP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp5' bgcolor='steelblue'></td><td width='$hp6'></tr></table></td></tr>";} ?><?php if($Using != Third && $get3pokemon3[HP] > 0){print "<tr><td valign='top' width='50%' style='border:1px solid black' bgcolor='$get3pokemon3[Color]'><font face='verdana' size='1' color='$font'><b><a href='index.php?mode=maps&map=Route11&x=15&y=0&Using=Third&Switched=1'>$get3pokemon3[Pokemon]</a><img src='images/$get3pokemon3[Gender].gif'></td><td valign='top'><font face='verdana' size='1'><b>HP:</b> $get3pokemon3[HP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp7' bgcolor='steelblue'></td><td width='$hp8'></tr></table></td></tr>";} ?><?php if($Using != Fourth && $get4pokemon3[HP] > 0){print "<tr><td valign='top' width='50%' style='border:1px solid black' bgcolor='$get4pokemon3[Color]'><font face='verdana' size='1' color='$font'><b><a href='index.php?mode=maps&map=Route11&x=15&y=0&Using=Fourth&Switched=1'>$get4pokemon3[Pokemon]</a><img src='images/$get4pokemon3[Gender].gif'></td><td valign='top'><font face='verdana' size='1'><b>HP:</b> $get4pokemon3[HP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp9' bgcolor='steelblue'></td><td width='$hp10'></tr></table></td></tr>";} ?><?php if($Using != Fifth && $get5pokemon3[HP] > 0){print "<tr><td valign='top' width='50%' style='border:1px solid black' bgcolor='$get5pokemon3[Color]'><font face='verdana' size='1' color='$font'><b><a href='index.php?mode=maps&map=Route11&x=15&y=0&Using=Fifth&Switched=1'>$get5pokemon3[Pokemon]</a><img src='images/$get5pokemon3[Gender].gif'></td><td valign='top'><font face='verdana' size='1'><b>HP:</b> $get5pokemon3[HP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp11' bgcolor='steelblue'></td><td width='$hp12'></tr></table></td></tr>";} ?><?php if($Using != Sixth && $get6pokemon3[HP] > 0){print "<tr><td valign='top' width='50%' style='border:1px solid black' bgcolor='$get6pokemon3[Color]'><font face='verdana' size='1' color='$font'><b><a href='index.php?mode=maps&map=Route11&x=15&y=0&Using=Sixth&Switched=1'>$get6pokemon3[Pokemon]</a><img src='images/$get6pokemon3[Gender].gif'></td><td valign='top'><font face='verdana' size='1'><b>HP:</b> $get6pokemon3[HP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp13' bgcolor='steelblue'></td><td width='$hp14'></tr></table></td></tr>";} ?></table>"

linktext[2]="Use An Item<br><br><b>Coming Soon!</b>"

linktext[3]="Run From Battle<br><br><br><br><form method=\"POST\" onSubmit=\"submitonce(this)\"><button type=\"submit\" name=\"run\" value=\"run\" class='button2'>Escape!</button></form>"

var ns6=document.getElementById&&!document.all
var ie=document.all

function show_text(thetext, whichdiv){
if (ie) eval("document.all."+whichdiv).innerHTML=linktext[thetext]
else if (ns6) document.getElementById(whichdiv).innerHTML=linktext[thetext]
}

function resetit(whichdiv){
if (ie) eval("document.all."+whichdiv).innerHTML=''
else if (ns6) document.getElementById(whichdiv).innerHTML=''
}
</script>

<style type="text/css"><!--
.button2 {
background-color: lightgrey;
border-color: black;
border-style: solid;
border-width: 1px;
color: black;
font-size: 8pt;
font-family: verdana;
}

.select {
background-color: white;
border-color: black;
border-style: solid;
color: black;
font-size: 8pt;
font-family: verdana;
}

.table {
font: normal 9px;
font-family: verdana;
}


--></style>

<?php
if(isset($_SESSION['user']))
{

if(
$map != Daycare && $map != BerryForest && $map != Route4 && $map != 'Route4-2' && $map != Route10 && $map != 'Route10-2' && $map != Route11 && $map != Route20 && $map != Route5 && $map != Route7)
{
if(
$x 28)
{
$x 190+28;}
if(
$x 0)
{
$x 190+0;}
if(
$y 0)
{
$y 170+0;}
if(
$y 25)
{
$y 170+25;}
}
if(
$map == Daycare || $map == BerryForest || $map == Route4 || $map == 'Route4-2' || $map == Route10 || $map == 'Route10-2' || $map == Route11 || $map == Route20 || $map == Route5 || $map == Route7)
{
if(
$x 28)
{
$x 190+28;}
if(
$x 0)
{
$x 190+0;}
if(
$y 0)
{
$y 170+0;}
if(
$y 37)
{
$y 170+37;}


$left 190+($x*15);
$top 170+($y*15);

$maptoget $map;
$wildfound RAND(1,5);
if(
$map == BerryForest)
{
$wildpoke RAND(14,17);
}
if(
$map == Johto)
{
$wildpoke RAND(4,6);
}
if(
$map == Route20)
{
$wildpoke RAND(12,13);
}
if(
$map == Route10)
{
$wildpoke RAND(18,19);
}
if(
$map == Route4)
{
$wildpoke RAND(20,23);
}
if(
$map == 'Route10-2')
{
$wildpoke RAND(24,26);
}
if(
$map == 'Route4-2')
{
$wildpoke RAND(27,29);
}
if(
$map == 'Route13')
{
$wildpoke RAND(30,32);
}
if(
$map == 'Route15')
{
$wildpoke RAND(33,37);
}
if(
$map == 'Route11')
{
$wildpoke RAND(38,41);
}
if(
$map == 'Route12')
{
$wildpoke RAND(42,44);
}
if(
$map == 'Daycare')
{
$wildpoke RAND(45,53);
}
if(
$map == 'Kanto')
{
$wildpoke RAND(54,67);
}
if(
$map != Kanto && $map != Johto && $map != Route20 && $map != BerryForest && $map != Route10 && $map != Route4 && $map != 'Route10-2' && $map != 'Route4-2' && $map != 'Route13' && $map != 'Route15' && $map != 'Route11' && $map != 'Route12' && $map != 'Daycare')
{
$wildpoke RAND(7,11);
}
$wildlevel RAND(4,17);
$wildgender RAND(1,2);
if(
$wildgender=='1')
{
$genderMale;}
if(
$wildgender=='2')
{
$gender=Female;}

$geto="SELECT * from m_pokemon where ID='$wildpoke'";
  
$geto2=mysql_query($geto) or die("Could not get Pokemon from database.");
  
$geto3=mysql_fetch_array($geto2);

$geto4="SELECT * from a_pokemon where Pokemon='$geto3[Pokemon]'";
  
$geto5=mysql_query($geto4) or die("Could not get Pokemon from database.");
  
$geto6=mysql_fetch_array($geto5);

if (isset(
$_POST['Attack']) && $getuser3[Refresh] == 'Yes')
{
print 
"<center><font face='verdana' size='2'><b>Oops! For Security Reasons Refreshing Has Been Disabled!";
}
if (isset(
$_POST['evolve']) && $getuser3[Refresh] == 'Evolve')
{
print 
"<center><font face='verdana' size='2'><b>Oops! For Security Reasons Refreshing Has Been Disabled!";
}
if (isset(
$_POST['evolve']) && $getusingp3[EvolveLVL] == '0')
{
print 
"<center><font face='verdana' size='2'><b>There Has Been An Error $getusingp3[Pokemon] Does Not Evolve!";
}
if (isset(
$_POST['catch']) && $getuser3[Refresh] == 'Yes')
{
print 
"<center><font face='verdana' size='2'><b>Oops! For Security Reasons Refreshing Has Been Disabled!";
}
if (isset(
$_POST['evolve']) && $getp3[EvolveLVL] != '0' && $getusingp3[Level] >= $getp3[EvolveLVL] && $getuser3[Refresh] != 'Evolve')
{
$evolution $getp3[Evolution];

$getevo="SELECT * from a_pokemon where Pokemon='$evolution'";
  
$getevo2=mysql_query($getevo) or die("Could not get Pokemon from database.");
  
$getevo3=mysql_fetch_array($getevo2);

$NewHP = ($getevo3[BaseHP]/10)*$getusingp3[Level];

print 
"<font face='verdana' size='2'><b><center>Evolving $getusingp3[Pokemon]!</font><font face='verdana' size='1'><br><br><img src='images/Pokemon/$getusingp3[Pokemon].gif'> <img src='images/Pokemon/$getevo3[Pokemon].gif'><br><b>Congratulations!</b><br>Your $getusingp3[Pokemon] Has Evolved Into $getevo3[Pokemon]!";

$FixHP="Update t_pokemon set Pokemon='$getevo3[Pokemon]', HP='$NewHP', MHP='$NewHP' where Trainer='$user' and ID='$getusingp3[ID]'";
    
mysql_query($FixHP) or die("Could not fix HP.");

$SetRefresh="Update trainers set Refresh='Evolve' where Username='$user'";
    
mysql_query($SetRefresh) or die("Could not stop refresh.");
}
if (isset(
$_POST['catch']) && $getuser3[Refresh] == 'No')
{
[
b]$getopp="SELECT * from a_pokemon where Pokemon='$getuser3[Opponent]'";
  
$getopp2=mysql_query($getopp) or die("Could not get Pokemon from database.");
  
$getopp3=mysql_fetch_array($getopp2);[/b]

$getopp4="SELECT * from m_pokemon where Pokemon='$getuser3[Opponent]'";
  
$getopp5=mysql_query($getopp4) or die("Could not get Pokemon from database.");
  
$getopp6=mysql_fetch_array($getopp5);

$next $getuser3[OLevel]+1;
$next2 $next*$next*$next;
$OHP = ($getopp3[BaseHP]/10)*$getuser3[OLevel];
if(
$getopp6 && $getuser3[OLevel] <= 17)
{
print 
"<center><font face='verdana' size='2'><b>Catch $getuser3[Opponent]!<br><br><br></b><font face='verdana' size='1'><img src='images/Pokemon/$getuser3[Opponent].gif'><br><b>$getuser3[Opponent]!</b><br><b>Level: </b>$getuser3[OLevel]<br><b>EXP: </b>$getuser3[OEXP]<br><b>Gender: </b>$getuser3[OGender]<br><br>$getuser3[Opponent]<img src='images/$getuser3[OGender].gif'> Has Been Added To Your Box!";

$SQL ="INSERT into t_pokemon (Pokemon,Trainer,Level,NLevel,EXP,EXPN,HP,MHP,Gender,Item, Attack1, Attack2, Attack3, Attack4) values('$getuser3[Opponent]','$getuser3[Username]','$getuser3[OLevel]','$next','$getuser3[OEXP]','$next2','$OHP','$OHP','$getuser3[OGender]','None','$getopp3[Attack1]','$getopp3[Attack2]','$getopp3[Attack3]','$getopp3[Attack4]')";
    
mysql_query($SQL) or die(mysql_error());

$SetRefresh="Update trainers set Refresh='Yes' where Username='$user'";
    
mysql_query($SetRefresh) or die("Could not stop refresh.");
}
if(!
$getopp6 || $getuser3[OLevel] > 17)
{print 
"<font face='verdana' size='2'><b><center>Oops! There Was An Error Catching Pokemon!";}
}
if ((!isset(
$_POST['catch'])) && isset($_POST['Attack']) && $getuser3[Refresh] == 'No' && (!isset($_POST['evolve'])))
{
if(
$Attack == $getusingp3[Attack1])
{
$ActualAttack $getusingp3[Attack1];}
if(
$Attack == $getusingp3[Attack2])
{
$ActualAttack $getusingp3[Attack2];}
if(
$Attack == $getusingp3[Attack3])
{
$ActualAttack $getusingp3[Attack3];}
if(
$Attack == $getusingp3[Attack4])
{
$ActualAttack $getusingp3[Attack4];}
if(
$ActualAttack == '---')
{
$ActualAttack $getusingp3[Attack1];}

$getattack="SELECT * from attacks where Attack='$ActualAttack'";
  
$getattack2=mysql_query($getattack) or die("Could not get Pokemon from database.");
  
$getattack3=mysql_fetch_array($getattack2);

$getopp="SELECT * from a_pokemon where Pokemon='$getuser3[Opponent]'";
  
$getopp2=mysql_query($getopp) or die("Could not get Pokemon from database.");
  
$getopp3=mysql_fetch_array($getopp2);

$randomcritical RAND(1,5);

$damage = (((($getusingp3[Level]/10)*($getp3[BaseATK]/10))*($getattack3[Power]/10))-(($getuser3[OLevel]/10)*($geto6[BaseDEF]/10)))/2;

if(
$getattack3[Type] == $getopp3[Weakness])
{
$damage $damage*2;
}
if(
$getattack3[Type] == $getopp3[Type])
{
$damage $damage*.75;
}
if(
$damage <= '0')
{
$damage 1;}
if(
$randomcritical == '1')
{
$damage $damage*1.5;
}

$damage round($damage);

$randomattack RAND(1,4);

if(
$randomattack == 1)
{
$wildattack $getopp3[Attack1];}
if(
$randomattack == 2)
{
$wildattack $getopp3[Attack2];}
if(
$randomattack == 3)
{
$wildattack $getopp3[Attack3];}
if(
$randomattack == 4)
{
$wildattack $getopp3[Attack4];}
if(
$wildattack == '---')
{
$wildattack $getopp3[Attack1];}

$getattack4="SELECT * from attacks where Attack='$wildattack'";
  
$getattack5=mysql_query($getattack4) or die("Could not get Pokemon from database.");
  
$getattack6=mysql_fetch_array($getattack5);

$randomcritical2 RAND(1,5);

if(
$randomcritical2 != '1' && $getattack6[Type] != $getp3[Weakness])
{
$damage2 = (((($getuser3[OLevel]/10)*($getopp3[BaseATK]/10))*($getattack6[Power]/10))-(($getusingp3[Level]/10)*($getp3[BaseDEF]/10)))/2;
}
if(
$randomcritical2 == '1' && $getattack6[Type] != $getp3[Weakness])
{
$damage2 = ((((($getuser3[OLevel]/10)*($getopp3[BaseATK]/10))*($getattack6[Power]/10))-(($getusingp3[Level]/10)*($getp3[BaseDEF]/10)))*1.5)/2;
}
if(
$getattack6[Type] == $getp3[Weakness])
{
$damage2 = ((((($getuser3[OLevel]/10)*($getopp3[BaseATK]/10))*($getattack6[Power]/10))-(($getusingp3[Level]/10)*($getp3[BaseDEF]/10)))*2)/2;
}
if(
$getattack6[Type] == $getp3[Type] && $getattack6[Type] != $getp3[Weakness])
{
$damage2 = ((((($getuser3[OLevel]/10)*($getopp3[BaseATK]/10))*($getattack6[Power]/10))-(($getusingp3[Level]/10)*($getp3[BaseDEF]/10)))*.75)/2;
}
if(
$damage2 <= '0')
{
$damage2 1;}

$damage2 round($damage2);

$dmg $getusingp3[HP]-$damage2;
$dmg2 $getuser3[OHP]-$damage;

$hp = (($getusingp3[HP]-$damage2)/$getusingp3[MHP])*100;
$hp2 100-$hp;
$exp $getusingp3[EXPN]-(($getusingp3[Level]*$getusingp3[Level])*$getusingp3[Level]);
$exp2 $getusingp3[EXP]-(($getusingp3[Level]*$getusingp3[Level])*$getusingp3[Level]);
$exp3 = ($exp2/$exp)*100;
$exp4 100-$exp3;
$color1 $getp3[Color];

$hp3 = (($getuser3[OHP]-$damage)/$getuser3[OMHP])*100;
$hp4 100-$hp3;

if((!isset(
$_POST['catch'])) && $getusingp3[HP]-$damage2 <= '0' && $getuser3[OHP]-$damage <= '0')
{
print 
"<center><font face='verdana' size='2'><b>The Battle Is A Draw!</b></font><br><br><img src='images/Trainers/$getuser3[Team].png'><img src='images/Pokemon/$getusingp3[Pokemon].gif'><br><font face='verdana' size='1'><b>$getuser3[Username] And $getusingp3[Pokemon] Have Tied The Battle!<br></b>No Money Or EXP Points Have Been Awarded!<br><br>";

$NewHP $getusingp3[Level]*($getp3[BaseHP]/10);

$FixHP="Update t_pokemon set HP='$NewHP', MHP='$NewHP' where Trainer='$user' and Pokemon='$getusingp3[Pokemon]'";
    
mysql_query($FixHP) or die("Could not fix HP.");

$SetRefresh="Update trainers set Refresh='Yes' where Username='$user'";
    
mysql_query($SetRefresh) or die("Could not stop refresh.");

}
if((!isset(
$_POST['catch'])) && $getusingp3[HP]-$damage2 <= '0' && $getuser3[OHP]-$damage '0')
{
print 
"<center><font face='verdana' size='2'><b>You Have Lost!</b></font><br><br><img src='images/Trainers/$getuser3[Team].png'><img src='images/Pokemon/$getusingp3[Pokemon].gif'><br><font face='verdana' size='1'><b>$getuser3[Username] And $getusingp3[Pokemon] Have Lost The Battle!<br></b>No Money Or EXP Points Have Been Awarded!<br><br>";

$NewHP $getusingp3[Level]*($getp3[BaseHP]/10);

$FixHP="Update t_pokemon set HP='$NewHP', MHP='$NewHP' where Trainer='$user' and Pokemon='$getusingp3[Pokemon]'";
    
mysql_query($FixHP) or die("Could not fix HP.");

$SetRefresh="Update trainers set Refresh='Yes' where Username='$user'";
    
mysql_query($SetRefresh) or die("Could not stop refresh.");

}
if((!isset(
$_POST['catch'])) && $getusingp3[HP]-$damage2 '0' && $getuser3[OHP]-$damage <= '0')
{
$money = ($getuser3[OLevel]*1.75);
$expgained = ($getuser3[OLevel]*$getopp3[BaseHP])/7;

$money2 $getuser3[Money]+$money;
$expgained2 $getusingp3[EXP]+$expgained;

print 
"<center><font face='verdana' size='2'><b>Congratulations!</b></font><br><br><img src='images/Trainers/$getuser3[Team].png'><img src='images/Pokemon/$getusingp3[Pokemon].gif'><br><font face='verdana' size='1'><b>$getuser3[Username] And $getusingp3[Pokemon] Have Won The Battle!<br></b>You Have Won $";
echo 
round($money);
print 
"!<br>And $getusingp3[Pokemon] Gained ";
echo 
round($expgained);
print 
" EXP Points!<br><br>";

if(
$expgained2 >= $getusingp3[EXPN])
{
$nextlevel = ($getusingp3[NLevel]+1)*($getusingp3[NLevel]+1)*($getusingp3[NLevel]+1);
$NewHP = ($getusingp3[Level]+1)*($getp3[BaseHP]/10);
$NewMHP = ($getusingp3[NLevel]+1)*($getp3[BaseHP]/10);
$nextlevel1 $getusingp3[Level]+1;
$nextlevel2 $getusingp3[NLevel]+1;
print 
"<font face='verdana' size='1' color='$font'><b>$getusingp3[Pokemon] Has Gained A Level!</b>";

$LevelUP="Update t_pokemon set Level='$nextlevel1', NLevel='$nextlevel2', EXPN='$nextlevel', HP='$NewHP', MHP='$NewHP' where Trainer='$user' and ID='$getusingp3[ID]'";
    
mysql_query($LevelUP) or die("Could not Level UP.");

if(
$nextlevel1 >= $getp3[EvolveLVL] && $getp3[EvolveLVL] != '0')
{
print 
"<br><font face='verdana' size='1'><b>$getusingp3[Pokemon] Is Ready To Evolve!<br></b> 
<form method=\"POST\" onSubmit=\"submitonce(this)\"><input type='hidden' name='evolve' value='
$getusingp3[Pokemon]'><button type=\"submit\" name=\"evolve\" value=\"evolve\" class='button2'>Evolve $getusingp3[Pokemon]!</button></form>";
}
}

$SetEXP="Update t_pokemon set EXP='$expgained2' where Trainer='$user' and ID='$getusingp3[ID]'";
    
mysql_query($SetEXP) or die("Could not award EXP.");

$SetMoney="Update trainers set Money='$money2' where Username='$user'";
    
mysql_query($SetMoney) or die("Could not award Money.");

$NewHP $getusingp3[Level]*($getp3[BaseHP]/10);

$FixHP="Update t_pokemon set HP='$NewHP', MHP='$NewHP' where Trainer='$user' and Pokemon='$getusingp3[Pokemon]'";
    
mysql_query($FixHP) or die("Could not fix HP.");

$SetRefresh="Update trainers set Refresh='Yes' where Username='$user'";
    
mysql_query($SetRefresh) or die("Could not stop refresh.");
}
if((!isset(
$_POST['catch'])) && $getusingp3[HP]-$damage2 '0' && $getuser3[OHP]-$damage '0')
{
$getname="SELECT * from t_pokemon where Trainer='$getuser3[Username]' and Pokemon='$getuser3[Opponent]'";
  
$getname2=mysql_query($getname) or die("Could not select new pokemon.");
  
$getname3=mysql_fetch_array($getname2);

print 
"<center>
<table width='465' cellspacing='.5' cellpadding='1' border='0' class='table'><tr><td>
<table width='230' style='border:1px solid black' bgcolor='
$getopp3[Color]' cellspacing='1' cellpadding='1'><tr><td width='155'><table><tr><td colspan='3' bgcolor='White' style='border:1px solid black' width='155'";
if(
$getname3)
{print 
"background='images/Caught.PNG'";}
print 
"><font face='verdana' size='1'>$getuser3[Opponent]<img src='images/$getuser3[OGender].gif'></td></tr><tr><td colspan='1'><font face='verdana' size='1' color='black'><b> HP:</b> ";
if(
$getuser3[OHP]-$damage 0)
{
echo 
round($getuser3[OHP]-$damage); 
}
if(
$getuser3[OHP]-$damage <= 0)
{print 
"FNT";}
if(
$getuser3[OHP]-$damage <= 0)
{print 
"FNT";}
if(
$getuser3[OHP]-$damage >= ($getuser3[OMHP]/2))
{
$color steelblue;}
if(
$getuser3[OHP]-$damage >= ($getuser3[OMHP]*.25) && $getuser3[OHP]-$damage < ($getuser3[OMHP]/2))
{
$color gold;}
if(
$getuser3[OHP]-$damage >= && $getuser3[OHP]-$damage < ($getuser3[OMHP]*.25))
{
$color red;}
print 
"<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp3' bgcolor='$color'></td><td width='$hp4'></tr></table><b> EXP:</b> $getuser3[OEXP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='5' bgcolor='white'><tr><td width='0' bgcolor='magenta'></td><td width='100'></td></tr></table></td><td valign='top' width='100%'><font face='verdana' size='1' color='black'><b>LV:</b>$getuser3[OLevel]<br><center><img src='images/$getopp3[Type].png' title='Pokemon's Type'></td></tr></table></td><td width='65' height='100%'><center><img src='images/Pokemon/$getuser3[Opponent].gif'></td></tr></table>
</td><td rowspan='2' valign='top' width='220' height='100%'><font face='verdana' size='1'><center><b>"
?>
<a href onMouseover="show_text(0,'div1')">ATTACK</a>
|<a href onMouseover="show_text(1,'div1')">SWITCH</a>|<a href onMouseover="show_text(2,'div1')">ITEM</a>|<a href onMouseover="show_text(3,'div1')">RUN</a></b><br>
<span id="div1" style="vertical-align: top;">Continue Battle</span>

<?php
print "</td></tr><tr><td>
<table width='230' style='border:1px solid black' bgcolor='
$color1' cellspacing='1' cellpadding='1'><tr><td width='65' height='100%'><center><img src='images/Pokemon/$getusingp3[Pokemon].gif'></td><td width='155'><table><tr><td colspan='3' bgcolor='white' style='border:1px solid black'><font face='verdana' size='1' color='black'>$getusingp3[Pokemon]<img src='images/$getusingp3[Gender].gif'></td></tr><tr><td colspan='1'><font face='verdana' size='1' color='black'><b> HP:</b> "
if(
$getusingp3[HP]-$damage2 0)
{
echo 
round($getusingp3[HP]-$damage2); 
}
if(
$getusingp3[HP]-$damage2 <= 0)
{print 
"FNT";} 
if(
$getusingp3[HP]-$damage2 >= ($getusingp3[MHP]/2))
{
$color2 steelblue;}
if(
$getusingp3[HP]-$damage2 >= ($getusingp3[MHP]*.25) && $getusingp3[HP]-$damage2 < ($getusingp3[MHP]/2))
{
$color2 gold;}
if(
$getusingp3[HP]-$damage2 >= && $getusingp3[HP]-$damage2 < ($getusingp3[MHP]*.25))
{
$color2 red;}
print 
"<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp' bgcolor='$color2'></td><td width='$hp2'></tr></table><b> EXP:</b> $getusingp3[EXP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='5' bgcolor='white'><tr><td width='$exp3' bgcolor='magenta'></td><td width='$exp4'></td></tr></table></td><td valign='top' width='100%'><font face='verdana' size='1' color='black'><b>LV:</b>$getusingp3[Level]<br><center><img src='images/$getp3[Type].png' title='Pokemon's Type'></td></tr></table></tr></td></table></tr></td><tr><td colspan='2'><table cellspacing='0' cellpadding='0' width='100%' border='0'><tr><td width='100%' style='border:1px solid black' valign='top' colspan='2'><font face='verdana' size='1'><b><center>Attack Statistics<br></b>Your $getusingp3[Pokemon] Attacked With <b>$ActualAttack</b> And Did ";
echo 
round($damage);
print 
" HP Damage!<br>";
if(
$getattack3[Type] == $getopp3[Type] && $getattack3[Type] != $getopp3[Weakness])
{print 
"<font face='verdana' size='1' color='darkblue'><b>It's Not Very Effective!</b></font><br>";}
if(
$getattack3[Type] == $getopp3[Weakness])
{print 
"<font face='verdana' size='1' color='darkgreen'><b>It's Super Effective!</b></font><br>";}
if(
$randomcritical == '1')
{print 
"<font face='verdana' size='1' color='darkred'><b>A Critical Hit!</b></font><br>";}
print 
"<font face='verdana' size='1'>$getuser3[Opponent] Attacked With <b>$wildattack</b> And Did ";
echo 
round($damage2);
print 
" HP Damage!<br>";
if(
$getattack6[Type] == $getp3[Type] && $getattack6[Type] != $getp3[Weakness])
{print 
"<font face='verdana' size='1' color='darkblue'><b>It's Not Very Effective!</b></font><br>";}
if(
$getattack6[Type] == $getp3[Weakness])
{print 
"<font face='verdana' size='1' color='darkgreen'><b>It's Super Effective!</b></font><br>";}
if(
$randomcritical2 == '1')
{print 
"<font face='verdana' size='1' color='darkred'><b>A Critical Hit!</b></font><br>";}
print 
"</td></tr></table></tr></td></table><br><br>";
if(
$getuser3[OHP]-$damage <= $getuser3[OMHP]*.25 && $getuser3[OHP]-$damage 0)
{print 
"<form method='POST'><button type='submit' name='catch' value='catch' class='button2'><input type='hidden' value='$getuser3[Opponent]' name='opponent'></input>Catch $getuser3[Opponent]!</button></form>";}
print 
"<br><br><font face='verdana' size='1'></b></b>Copyright - PPA Battle System Version 2.0 BETA";

$dmg$getusingp3[HP]-$damage2;
$dmg2$getuser3[OHP]-$damage;

$SetUHP="Update t_pokemon set HP='$dmg' where Trainer='$user' and Pokemon='$getusingp3[Pokemon]'";
    
mysql_query($SetUHP) or die("Could not deal damage2.");

$SetOHP="Update trainers set OHP='$dmg2' where Username='$user'";
    
mysql_query($SetOHP) or die("Could not deal damage.");
}
}
if((!isset(
$_POST['catch'])) && (!isset($_POST['Attack'])) && (!isset($_POST['evolve'])) && $Switched == 1)
{
if(
$getuser3[OHP] >= ($getuser3[OMHP]/2))
{
$color steelblue;}
if(
$getuser3[OHP] >= ($getuser3[OMHP]*.25) && $getuser3[OHP] < ($getuser3[OMHP]/2))
{
$color gold;}
if(
$getuser3[OHP] >= && $getuser3[OHP] < ($getuser3[OMHP]*.25))
{
$color red;}

if(
$getusingp3[HP] >= ($getusingp3[MHP]/2))
{
$color2 steelblue;}
if(
$getusingp3[HP] >= ($getusingp3[MHP]*.25) && $getusingp3[HP] < ($getusingp3[MHP]/2))
{
$color2 gold;}
if(
$getusingp3[HP] >= && $getusingp3[HP] < ($getusingp3[MHP]*.25))
{
$color2 red;}

$getopp="SELECT * from a_pokemon where Pokemon='$getuser3[Opponent]'";
  
$getopp2=mysql_query($getopp) or die("Could not get Pokemon from database.");
  
$getopp3=mysql_fetch_array($getopp2);

$SetRefresh="Update trainers set Refresh='No' where Username='$user'";
    
mysql_query($SetRefresh) or die("Could not stop refresh.");

$getattack="SELECT * from attacks where Attack='$getp3[Attack1]'";
  
$getattack2=mysql_query($getattack) or die("Could not get Pokemon from database.");
  
$getattack3=mysql_fetch_array($getattack2);

$exp $getusingp3[EXPN]-(($getusingp3[Level]*$getusingp3[Level])*$getusingp3[Level]);
$exp2 $getusingp3[EXP]-(($getusingp3[Level]*$getusingp3[Level])*$getusingp3[Level]);
$exp3 = ($exp2/$exp)*100;
$exp4 100-$exp3;
$color1 $getp3[Color];
$NewHP $getusingp3[Level]*($getp3[BaseHP]/10);


$hp3 = ($getuser3[OHP]/$getuser3[OMHP])*100;
$hp4 100-$hp3;

print 
"<center><font face='verdana' size='1'>
<table width='465' cellspacing='.5' cellpadding='1' border='0' class='table'><tr><td>
<table width='230' style='border:1px solid black' bgcolor='
$getopp3[Color]' cellspacing='1' cellpadding='1'><tr><td width='155'><table><tr><td colspan='3' bgcolor='White' style='border:1px solid black' width='155'><font face='verdana' size='1'>$getuser3[Opponent]<img src='images/$getuser3[OGender].gif'></td></tr><tr><td colspan='1'><font face='verdana' size='1' color='black'><b> HP:</b> ";
echo 
round($getuser3[OHP]); print "<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp3' bgcolor='$color'></td><td width='$hp4'></tr></table><b> EXP:</b> $getuser6[OEXP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='5' bgcolor='white'><tr><td width='0' bgcolor='magenta'></td><td width='100'></td></tr></table></td><td valign='top' width='100%'><font face='verdana' size='1' color='black'><b>LV:</b>$getuser3[OLevel]<br><center><img src='images/$getopp3[Type].png' title='Pokemon's Type'></td></tr></table></td><td width='65' height='100%'><center><img src='images/Pokemon/$getuser3[Opponent].gif'></td></tr></table>
</td><td rowspan='2' valign='top' width='220'><font face='verdana' size='1'><center><b>"
?>

<a href onMouseover="show_text(0,'div1')">ATTACK</a>|<a href onMouseover="show_text(1,'div1')">SWITCH</a>|<a href onMouseover="show_text(2,'div1')">ITEM</a>|<a href onMouseover="show_text(3,'div1')">RUN</a>
</b><br>
<span id="div1">Continue Battle</span>

<?php
print "</td></tr><tr><td>
<table width='230' style='border:1px solid black' bgcolor='
$color1' cellspacing='1' cellpadding='1'><tr><td width='65' height='100%'><center><img src='images/Pokemon/$getusingp3[Pokemon].gif'></td><td width='155'><table><tr><td colspan='3' bgcolor='white' style='border:1px solid black'><font face='verdana' size='1' color='black'>$getusingp3[Pokemon]<img src='images/$getusingp3[Gender].gif'></td></tr><tr><td colspan='1'><font face='verdana' size='1' color='black'><b> HP:</b> "; echo round($getusingp3[HP]); print "<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='100' bgcolor='$color2'></td><td width='0'></tr></table><b> EXP:</b> $getusingp3[EXP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='5' bgcolor='white'><tr><td width='$exp3' bgcolor='magenta'></td><td width='$exp4'></td></tr></table></td><td valign='top' width='100%'><font face='verdana' size='1' color='black'><b>LV:</b>$getusingp3[Level]<br><center><img src='images/$getp3[Type].png' title='Pokemon's Type'></td></tr></table></tr></td></table></tr></td><tr><td colspan='2'><table cellspacing='0' cellpadding='0' width='100%' border='0'><tr><td width='100%' style='border:1px solid black' valign='top' colspan='2'><font face='verdana' size='1'><b><center>Attack Statistics<br></b></td></tr></table></tr></td></table>
<br><br><font face='verdana' size='1'></b></b><br><br>Copyright - PPA Battle System Version 2.0 BETA"
;
}
if(
$wildfound=='1' && (!isset($_POST['Attack'])) && (!isset($_POST['catch'])) && (!isset($_POST['evolve'])) && $Using == Starter && $switched != 1)
{
$SetRefresh="Update trainers set Refresh='No' where Username='$user'";
    
mysql_query($SetRefresh) or die("Could not stop refresh.");

$getattack="SELECT * from attacks where Attack='$getp3[Attack1]'";
  
$getattack2=mysql_query($getattack) or die("Could not get Pokemon from database.");
  
$getattack3=mysql_fetch_array($getattack2);

$exp $getusingp3[EXPN]-(($getusingp3[Level]*$getusingp3[Level])*$getusingp3[Level]);
$exp2 $getusingp3[EXP]-(($getusingp3[Level]*$getusingp3[Level])*$getusingp3[Level]);
$exp3 = ($exp2/$exp)*100;
$exp4 100-$exp3;
$color1 $getp3[Color];
$NewHP $getusingp3[Level]*($getp3[BaseHP]/10);

$OHP = ($geto6[BaseHP]/10)*$wildlevel;
$OEXP $wildlevel*$wildlevel*$wildlevel;

$FixHP="Update t_pokemon set HP='$NewHP', MHP='$NewHP' where Trainer='$user' and Pokemon='$getpokemon3[Pokemon]'";
    
mysql_query($FixHP) or die("Could not fix HP.");

$SetOpponent="Update trainers set OLevel='$wildlevel', OEXP='$OEXP', OGender='$gender', Opponent='$geto3[Pokemon]', OHP='$OHP', OMHP='$OHP' where Username='$user'";
    
mysql_query($SetOpponent) or die("Could not set up opponent.");

$hp = ($getusingp3[HP]/$getusingp3[MHP])*100;
$hp2 100-$hp;

$hp3 = ($OHP/$OHP)*100;
$hp4 100-$hp3;

$getwildopp="SELECT * from t_pokemon where Trainer='$getuser3[Username]' and Pokemon='$geto3[Pokemon]'";
  
$getwildopp2=mysql_query($getwildopp) or die("Could not select new pokemon.");
  
$getwildopp3=mysql_fetch_array($getwildopp2);

print 
"<center><font face='verdana' size='1'><b>Wild $geto3[Pokemon] Attacked!</b>
<table width='465' cellspacing='.5' cellpadding='1' border='0' class='table'><tr><td>
<table width='230' style='border:1px solid black' bgcolor='
$geto6[Color]' cellspacing='1' cellpadding='1'><tr><td width='155'><table><tr><td colspan='3' bgcolor='White' style='border:1px solid black' width='155'";
if(
$getwildopp3)
{print 
"background='images/Caught.PNG'";}
print 
"><font face='verdana' size='1'>$geto3[Pokemon]<img src='images/$gender.gif'></td></tr><tr><td colspan='1'><font face='verdana' size='1' color='black'><b> HP:</b> ";
echo 
round($OHP);  print "<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp3' bgcolor='steelblue'></td><td width='$hp4'></tr></table><b> EXP:</b> $OEXP<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='5' bgcolor='white'><tr><td width='0' bgcolor='magenta'></td><td width='100'></td></tr></table></td><td valign='top' width='100%'><font face='verdana' size='1' color='black'><b>LV:</b>$wildlevel<br><center><img src='images/$geto6[Type].png' title='Pokemon's Type'></td></tr></table></td><td width='65' height='100%'><center><img src='images/Pokemon/$geto3[Pokemon].gif'></td></tr></table>
</td><td rowspan='2' valign='top' width='220'><font face='verdana' size='1'><center><b>"
?>

<a href onMouseover="show_text(0,'div1')">ATTACK</a>|<a href onMouseover="show_text(1,'div1')">SWITCH</a>|<a href onMouseover="show_text(2,'div1')">ITEM</a>|<a href onMouseover="show_text(3,'div1')">RUN</a>
</b><br>
<span id="div1">Begin Battle</span>

<?php
print "</td></tr><tr><td>
<table width='230' style='border:1px solid black' bgcolor='
$color1' cellspacing='1' cellpadding='1'><tr><td width='65' height='100%'><center><img src='images/Pokemon/$getusingp3[Pokemon].gif'></td><td width='155'><table><tr><td colspan='3' bgcolor='white' style='border:1px solid black'><font face='verdana' size='1' color='black'>$getusingp3[Pokemon]<img src='images/$getusingp3[Gender].gif'></td></tr><tr><td colspan='1'><font face='verdana' size='1' color='black'><b> HP:</b> "; echo round($getusingp3[HP]);  print "<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='7' bgcolor='white'><tr><td width='$hp' bgcolor='steelblue'></td><td width='$hp2'></tr></table><b> EXP:</b> $getusingp3[EXP]<br><table width='100' style='border:1px solid black' cellspacing='0' cellpadding='0' height='5' bgcolor='white'><tr><td width='$exp3' bgcolor='magenta'></td><td width='$exp4'></td></tr></table></td><td valign='top' width='100%'><font face='verdana' size='1' color='black'><b>LV:</b>$getusingp3[Level]<br><center><img src='images/$getp3[Type].png' title='Pokemon's Type'></td></tr></table></tr></td></table></tr></td><tr><td colspan='2'><table cellspacing='0' cellpadding='0' width='100%' border='0'><tr><td width='100%' style='border:1px solid black' valign='top' colspan='2'><font face='verdana' size='1'><b><center>Attack Statistics<br></b></td></tr></table></tr></td></table>
<br><br><font face='verdana' size='1'></b></b><br><br>Copyright - PPA Battle System Version 2.0 BETA"
;
}
if(
$wildfound != '1' && (!isset($_POST['Attack'])) && (!isset($_POST['catch'])) && (!isset($_POST['evolve'])) && $switched != && (!isset($_GET['Using'])))
{
$NewHP $getpokemon3[Level]*($getp3[BaseHP]/10);

$FixHP="Update t_pokemon set HP='$NewHP', MHP='$NewHP' where Trainer='$user' and Pokemon='$getpokemon3[Pokemon]'";
    
mysql_query($FixHP) or die("Could not fix HP.");

$recent=date("U")-300;

$getonmap="SELECT COUNT(*) from trainers where Map='$map' AND lasttime>'$recent'";
      
$getonmap2=mysql_query($getonmap) or die("Could not get trainers on map,");
      
$getonmap3=mysql_result($getonmap2,0);

print 
"<center><font face='verdana' size='1'><b>You Are Exploring $map! | There Are $getonmap3 Trainers Exploring $map<br><table><tr><td background='images/Maps/$map.PNG' ";
if(
$map != Daycare && $map != BerryForest && $map != Route4 && $map != 'Route4-2' && $map != Route10 && $map != 'Route10-2' && $map != Route11 && $map != Route20 && $map != Route5 && $map != Route7)
{
print 
"height='398' width='434'";
}
if(
$map == Daycare || $map == BerryForest || $map == Route4 || $map == 'Route4-2' || $map == Route10 || $map == 'Route10-2' || $map == Route11 || $map == Route20 || $map == Route5 || $map == Route7)
{
print 
"height='599' width='434'";
}
print 
" valign='top' style='border:1px solid black'><b><font face='verdana' size='1'>.";

if(!isset(
$_GET['Show']))
{
  
$Show'Yes';
}
else
{
  
$Show=$_GET['Show'];
}

if(
$Show == Yes || $Show == '')
{
$recent=date("U")-300;

   
$getranks="SELECT * from trainers where Map='$map' AND Username!='$getuser3[Username]' AND lasttime>'$recent' order by userID ASC";
   
$getranks2=mysql_query($getranks) or die("Could not get box Pokemon.");  
   while(
$getranks3=mysql_fetch_array($getranks2)) 
     {

$left2=190+$getranks3[X]*15;
$down2=170+$getranks3[Y]*15;

print 
"<div style='position:absolute; left:$left2; top:$down2; width:18; height:23;";
if(
$getranks3[status] > '0')
{print 
"border:1px solid black; background-color:darkorange;";}
print 
"'><center><font face='verdana' size='1'><a href='index.php?mode=View&Name=$getranks3[Username]'><img src='images/Trainers/Small/$getranks3[Team].gif' title='$getranks3[Username]' border='0'></a></div>";

if(
$left == $left2 && $top == $down2)
{
print 
"<div style='position:absolute; left:320; top:210; width:200; height:12; border:1px solid black; background-color:white;'><center><font face='verdana' size='1'><a href='index.php?mode=Battle&battle=$getranks3[Starter]'>Battle $getranks3[Username]!</a></div>";
}
}
}
print 
"<div style='position:absolute; left:$left; top:$top; width:18; height:23; border:1px solid black; background-color:gold;'><center><font face='verdana' size='1'><img src='images/Trainers/Small/$getuser3[Team].gif' title='$getuser3[Username]'></div>";
print 
"</td></tr></table><font face='verdana' size='1'><b>Show Other Trainers<br></b><a href='index.php?mode=maps&map=$map&x=$x&y=$y&Show=Yes'>On</a>(Default) | <a href='index.php?mode=maps&map=$map&x=$x&y=$y&Show=No'>Off</a>";
}
}
if(!isset(
$_SESSION['user']))
{
print 
"<center><font face='verdana' size='2'><b>You Must Be Logged In To View The Maps!";
}
?>

Last edited by Christian; 10-08-06 at 02:22 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 10-07-06, 09:38 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
Firstly, I wish you would edit this post and use the PHP code wrappers.

Secondly, I don't see any include/require files, so I am assuming that you are not using any constants. Therefore, there are a lot of other errors, some of which might be causing the error in question.

I recommend putting the following line in after your opening <?php tag -
PHP Code:

error_reporting(E_ALL); 

For the constant values which should probably be quoted strings, I see a lot of code like the following -
PHP Code:

if($Using != Starter && $Using != Second && $Using != Third && $Using != Fourth && $Using != Fifth && $Using != Sixth
Unless you have defined constants - Starter, Second, Third, ... this line (and everywhere else in the code) should be like this -
PHP Code:

if($Using != 'Starter' && $Using != 'Second' && $Using != 'Third' && $Using != 'Fourth' && $Using != 'Fifth' && $Using != 'Sixth'
I don't see anything specific elsewhere in the file that would cause the error listed, but start by checking and correcting any errors reported with the above... Even if just a notice error is issued, this is logged and causes a small speed penalty when your code is executed.

Edit: I executed your code and I don't get a parse error. Hmm...

I notice a couple of other things that you need to address -

You are referencing a $_SESSION variable but are not starting a session. While it is possible that your PHP installation is setup to automatically start a session, this is unlikely.

There is no code to connect to a mysql server and select a database. While it is possible you have opened a persistent connection to the mysql server elsewhere, you still need to select a database prior to executing a query.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???

Last edited by mab; 10-07-06 at 10:19 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 10-08-06, 01:01 PM
Danyal Danyal is offline
Newbie Coder
 
Join Date: Oct 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
I did fix it, thanks. But now I got another error(In another file):

Parse error: syntax error, unexpected T_LNUMBER, expecting T_VARIABLE or '$' in /home/***/public_html/playground/BattleTower.php on line 421
PHP Code:

if($getuser3[Opponent] == 'Nosepass' && $getuser3[BattleTowers] == '0');

{
print 
"Good Job! You won the battle!";
if(
$getuser3[BattleTowers] == '0');
{
$
0D="Update trainers set BattleTowers='1' where Username='$user'";
    
mysql_query($0D) or die("Contact Nackel OR Danyal");
}
$NewHP $getusingp3[Level]*($getp3[BaseHP]/10);

$FixHP="Update t_pokemon set HP='$NewHP' where Trainer='$user' and Pokemon='$getusingp3[Pokemon]'";
    
mysql_query($FixHP) or die("Could not fix HP.");


Is that right? If not, could you debug it?

Last edited by Danyal; 10-08-06 at 01:59 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 10-08-06, 02:25 PM
Christian's Avatar
Christian Christian is offline
Community VIP
 
Join Date: Mar 2005
Location: ProgrammingTalk
Posts: 2,449
Thanks: 0
Thanked 6 Times in 5 Posts
Quote:
Originally Posted by mab
Firstly, I wish you would edit this post and use the PHP code wrappers.
Done. For future reference, just report the post and request the change.
__________________
:: ImperialBB :: New version in the works! :: http://www.imperialbb.com ::

:: Have a question about the board? The Rules? An Infraction/Warning? :: Contact Form ::
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 10-08-06, 04:03 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
Is that the same code you originally posted?

Anyway, the 0D looks like it starts with the number zero. From the PHP manual -
Quote:
Variable names follow the same rules as other labels in PHP. A valid variable name starts with a letter or underscore, followed by any number of letters, numbers, or underscores.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 10-08-06, 08:20 PM
Danyal Danyal is offline
Newbie Coder
 
Join Date: Oct 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
I fixed it, thanks! =).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Internal Server Error jarradyuhas Perl 1 11-14-05 09:41 PM
ASP upload prob minority ASP 1 06-27-05 09:35 AM
Error: 500 Can't connect to ppm.ActiveState.com:80 (connect: Unknown error) padmanaban_bala Perl 2 05-03-05 06:00 PM
parse error... help? kappler0 PHP 2 01-21-04 04:57 AM
[php error] parse error | fatal error xeoHosting PHP 1 01-03-04 09:12 PM


All times are GMT -5. The time now is 02:55 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.