Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/00/10396400/html/create.php on line 34
Line 34 Of Create.php:
PHP Code:
$query = "select * from Players where last_ip = '".$_SERVER['REMOTE_ADDR']."' and pstatus = 0";
That error message is now gone from my debugging page..
Now I am getting a similar error replicating after trying to make a character
Code:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/00/10396400/html/create.php on line 155
Lines 154 - 157:
PHP Code:
$query2="Insert into Players Values (null,'$newpl','$newpw','$maili','',1,1,$zone,$newChannel,0,0,0,0,0,0,0,$fire_bonus,$cold_bonus,$air_bonus,$arcane_bonus,$sword_bonus,$axe_bonus,$staff_bonus,$mace_bonus,$armor_bonus,1,now(),cr',now(),1,1,1,1,'".$_SERVER['REMOTE_ADDR']."',0,0,0,'$newlogin')"; mysql_query($query2); $userid = mysql_insert_id();
That error message is now gone from my debugging page..
Now I am getting a similar error replicating after trying to make a character
Code:
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/content/00/10396400/html/create.php on line 155
Lines 154 - 157:
PHP Code:
$query2="Insert into Players Values
(null,'$newpl','$newpw','$maili','',1,1,$zone,$newChannel,0,0,0,0,0,0,0,$fire_bonus,$cold_bonus,$air_bonus,$arcane_bonus,$sword_bonus,$axe_bonus,$staff_bonus,$mace_bonus,$armor_bonus,1,now(),cr',now(),1,1,1,1,'".$_SERVER['REMOTE_ADDR']."',0,0,0,'$newlogin')";
You have a newline in there at the end of the $query2 line.
PHP doesn't normally mind this but for some reason it's picking a fault with yours.
HOWEVER, this error typically means it is actually the line above. Some editors are a bit strange with their line numbering, so check the line above the first like you've quoted, make sure there is a ; at the end.
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value.
// only allow 3 not activated chars / ip $query = "select * from Players where last_ip = '0.0.0.0' and pstatus=0"; $result = mysql_query($query); if ($result==true and mysql_num_rows($result)>4) { $doContinue = false; ep2(90); } verify with reserved $query="Select Name as N from Reservation where Name='$newpl'"; $result=mysql_query($query); if (($doContinue) && ($result==TRUE and mysql_num_rows($result)==1 )) { $query="select * from Reservation where Name = '$newpl' and Login = '$newlogin'"; $result=mysql_query($query); if ($result==TRUE and mysql_num_rows($result)== 0 ) { // the name is in the reserved table BUT the login is incorrect $doContinue = false; ep2(74); } }
$query="Select Login as L from Reservation where Login='$newlogin'"; $result=mysql_query($query); if (($doContinue) && ($result==TRUE and mysql_num_rows($result)==1 )) { $query="select * from Reservation where Name = '$newpl' and Login = '$newlogin'"; $result=mysql_query($query); if ($result==TRUE and mysql_num_rows($result)== 0 ) { // the name is in the reserved table BUT the login is incorrect $doContinue = false; ep2(75); } }
// verify with existing players $query="Select name as N from Players where name='$newpl'"; $result=mysql_query($query); if (($doContinue) && ($result==TRUE and mysql_num_rows($result)==1 )) { $doContinue = false; ep2(22); } $query="Select login as L from Players where login='$newlogin'"; $result=mysql_query($query); if (($doContinue)&&($result==TRUE and mysql_num_rows($result)==1)) { $doContinue = false; ep2(73); }
// verify with mod names $query="select name as N from Players where channels in (10,11,12,20)"; $result=mysql_query($query); $num=mysql_num_rows($result); $i=0; while ($i < $num) { if ($doContinue) { $modname=mysql_result($result,$i,"N"); $pos = strpos($newpl, $modname); if ($pos===false) { $pos = strpos($newpl, str_replace(" ","",$modname)); if ($pos!==false) { $doContinue = false; ep2(89); } } else { $doContinue = false; ep2(89); } } $i++; }
// verify with players from previous round $query="select * from Reservation where Name = '$newpl'"; $result=mysql_query($query); if (($doContinue)&&($result==TRUE and mysql_num_rows($result)==1 )) { // there is a player with these details in the reservation table, let's now verify the rest extract(mysql_fetch_array($result),EXTR_PREFIX_ALL,"tgt"); if (($tgt_Password == $newpw) && ($tgt_Login == $newlogin)) { $doContinue = true; $newChannel=$tgt_Channels; // for mods if ($newChannel==10) { $newLevel = 25; $newGold = 1000; $stopSales = 0; } // for archies if ($newChannel==20) { $newLevel = 100; $newGold = 1000000; $newOrb = 41210000; $newOrbEquip = 3; $stopSales = 0; } } else { $doContinue = false; ep2(74); } }
if ($doContinue){ if($newpw==$newpw2) { if(strlen($newpw)>3) { if($rn2 < 0 || $rn2 > 8) { $rn2=0; } $query="Select * From Races where rid=$rn2"; $stats=mysql_query($query); extract(mysql_fetch_array($stats)); $rt=$rn2+100*min($gn2,1); $zone=$rn2;
$newpl = better_ucwords($newpl);
$query2="Insert into Players Values (null,'$newpl','$newpw','$maili','',1,1,$zone,$newChannel,0,0,0,0,0,0,0,$fire_bonus,$cold_bonus,$air_bonus,$arcane_bonus,$sword_bonus,$axe_bonus,$staff_bonus,$mace_bonus,$armor_bonus,1,now(),'cr',now(),1,1,1,1,'"last_ip = ‘0.0.0.0’" and pstatus=0"; mysql_query($query2); $userid = mysql_insert_id();
$query4="Insert into Stats Values ($userid,'$newpl',0,$rt,$r_str,$r_dex,$r_vit,$r_ntl,$r_wis,$r_vit,0,$newGold,0,1,$newLevel,0,0,1,0,0,now(),'',0,now(),now(),0,$stopSales,0,1080,$statusType,0)"; mysql_query($query4);
$query3="Insert into Inventory Values ($userid,'$newpl',1000000,5000000,$newOrb,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0,$newOrbEquip,0,0)"; mysql_query($query3);
// send email in the background $query5="select UNIX_TIMESTAMP(ax_time) as ax_time from Players where Id = $userid"; $result=mysql_query($query5); extract(mysql_fetch_array($result),EXTR_PREFIX_ALL,"tgt");
$link="http://www.shimlar.org/validate.php?u=$userid&nr=$tgt_ax_time"; $subject = "Shimlar validation mail for character $newpl"; $message = "To validate your character, click $link or copy it to your browser.\r\n". "Your login details after validation are $newlogin - $newpw.\r\n" . "Do NOT reply to this message.\r\n" . "\r\n" . "Lord A"; $headers = "From: admin@shimlar.org\r\n" . "X-Mailer: PHP/" . phpversion() . "\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=utf-8\r\n" . "Content-Transfer-Encoding: 8bit\r\n\r\n"; mail($maili, $subject, $message, $headers);
You have an extra ` (backtick) on line 28, line 43 looks like it is supposed to be a comment but it's just "hanging out" and you have a malformed SQL insert statement on line 154. It isn't clear what you were trying to do with the insert statement on 154 so the corrected version below may not be what you want on that line.
// only allow 3 not activated chars / ip
$query = "select * from Players where last_ip = '0.0.0.0' and pstatus=0";
$result = mysql_query($query);
if ($result==true and mysql_num_rows($result)>4) {
$doContinue = false;
ep2(90);
}
// verify with reserved
$query="Select Name as N from Reservation where Name='$newpl'";
$result=mysql_query($query);
if (($doContinue) && ($result==TRUE and mysql_num_rows($result)==1 )) {
$query="select * from Reservation where Name = '$newpl' and Login = '$newlogin'";
$result=mysql_query($query);
if ($result==TRUE and mysql_num_rows($result)== 0 ) {
// the name is in the reserved table BUT the login is incorrect
$doContinue = false;
ep2(74);
}
}
$query="Select Login as L from Reservation where Login='$newlogin'";
$result=mysql_query($query);
if (($doContinue) && ($result==TRUE and mysql_num_rows($result)==1 )) {
$query="select * from Reservation where Name = '$newpl' and Login = '$newlogin'";
$result=mysql_query($query);
if ($result==TRUE and mysql_num_rows($result)== 0 ) {
// the name is in the reserved table BUT the login is incorrect
$doContinue = false;
ep2(75);
}
}
// verify with existing players
$query="Select name as N from Players where name='$newpl'";
$result=mysql_query($query);
if (($doContinue) && ($result==TRUE and mysql_num_rows($result)==1 )) {
$doContinue = false;
ep2(22);
}
$query="Select login as L from Players where login='$newlogin'";
$result=mysql_query($query);
if (($doContinue)&&($result==TRUE and mysql_num_rows($result)==1)) {
$doContinue = false;
ep2(73);
}
// verify with mod names
$query="select name as N from Players where channels in (10,11,12,20)";
$result=mysql_query($query);
$num=mysql_num_rows($result);
$i=0;
while ($i < $num)
{
if ($doContinue)
{
$modname=mysql_result($result,$i,"N");
$pos = strpos($newpl, $modname);
if ($pos===false)
{
$pos = strpos($newpl, str_replace(" ","",$modname));
if ($pos!==false)
{
$doContinue = false;
ep2(89);
}
} else {
$doContinue = false;
ep2(89);
}
}
$i++;
}
// verify with players from previous round
$query="select * from Reservation where Name = '$newpl'";
$result=mysql_query($query);
if (($doContinue)&&($result==TRUE and mysql_num_rows($result)==1 )) {
// there is a player with these details in the reservation table, let's now verify the rest
extract(mysql_fetch_array($result),EXTR_PREFIX_ALL,"tgt");
if (($tgt_Password == $newpw) && ($tgt_Login == $newlogin)) {
$doContinue = true;
$newChannel=$tgt_Channels;
// for mods
if ($newChannel==10)
{
$newLevel = 25;
$newGold = 1000;
$stopSales = 0;
}
// for archies
if ($newChannel==20)
{
$newLevel = 100;
$newGold = 1000000;
$newOrb = 41210000;
$newOrbEquip = 3;
$stopSales = 0;
}
} else {
$doContinue = false;
ep2(74);
}
}
if ($doContinue){
if($newpw==$newpw2) {
if(strlen($newpw)>3) {
if($rn2 < 0 || $rn2 > 8) {
$rn2=0;
}
$query="Select * From Races where rid=$rn2";
$stats=mysql_query($query);
extract(mysql_fetch_array($stats));
$rt=$rn2+100*min($gn2,1);
$zone=$rn2;
$newpl = better_ucwords($newpl);
$query2="Insert into Players Values (null,'$newpl','$newpw','$maili','',1,1,$zone,$newChannel,0,0,0,0,0,0,0,$fire_bonus,$cold_bonus,$air_bonus,$arcane_bonus,$sword_bonus,$axe_bonus,$staff_bonus,$mace_bonus,$armor_bonus,1,now(),'cr',now(),1,1,1,1,'last_ip = ‘0.0.0.0’ and pstatus=0";
mysql_query($query2);
$userid = mysql_insert_id();
$query4="Insert into Stats Values
($userid,'$newpl',0,$rt,$r_str,$r_dex,$r_vit,$r_ntl,$r_wis,$r_vit,0,$newGold,0,1,$newLevel,0,0,1,0,0,now(),'',0,now(),now(),0,$stopSales,0,1080,$statusType,0)";
mysql_query($query4);
$query3="Insert into Inventory Values
($userid,'$newpl',1000000,5000000,$newOrb,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,0,0,$newOrbEquip,0,0)";
mysql_query($query3);
// send email in the background
$query5="select UNIX_TIMESTAMP(ax_time) as ax_time from Players where Id = $userid";
$result=mysql_query($query5);
extract(mysql_fetch_array($result),EXTR_PREFIX_ALL,"tgt");
$link="http://www.shimlar.org/validate.php?u=$userid&nr=$tgt_ax_time";
$subject = "Shimlar validation mail for character $newpl";
$message = "To validate your character, click $link or copy it to your browser.\r\n".
"Your login details after validation are $newlogin - $newpw.\r\n" .
"Do NOT reply to this message.\r\n" .
"\r\n" .
"Lord A";
$headers = "From: admin@shimlar.org\r\n" .
"X-Mailer: PHP/" . phpversion() . "\r\n" .
"MIME-Version: 1.0\r\n" .
"Content-Type: text/html; charset=utf-8\r\n" .
"Content-Transfer-Encoding: 8bit\r\n\r\n";
mail($maili, $subject, $message, $headers);