hola a todos de antemanos muy buenas tardes amigos del forosdelweb queria pasar por aqui a comentarles sobre mi siguiente problema en mi pagina web,
Parse error: syntax error, unexpected '}' in C:\AppServ\www\includes\secondjob.php on line 129
Este es mi error al intentar acceder a este script
Aqui les dejo el codigo php del script
<?php
switch ($logeado) {
case 0:
?> <!-- not logged in -->
<font size="+1">ERROR</font><br />
You are not logged in, please log in and try again!
<?
break;
case 1:
if ($_POST['action'] == 'submitted')
{
mssql_select_db("Tantra",$link);
$weaA = mssql_query("SELECT * FROM TantraBackup00 WHERE UserID='".$_SESSION['username']."'");
$rowA = mssql_fetch_row($weaA);
$userid=$_SESSION['username'];
$cnum = $_POST['Character'];
if ($cnum == 1) { $Character = $rowA['Name1']; }
if ($cnum == 2) { $Character = $rowA['Name2']; }
if ($cnum == 3) { $Character = $rowA['Name3']; }
$Initial=substr($userid,0,1);
$nombre_archivo = $AccDir."\\".$Initial."\\".$userid.".TAD";
$f = @fopen($nombre_archivo,"r+") or die("$nombre_archivo");
// Search for Character's tribe
if ($cnum == 1){
$rowtt = 5;
$rowgg = "char1job";
@fseek($f, 116, SEEK_SET);
$trb1 = @fread($f,1) or die("Error");
if($trb1 == ''){$tribe1 = 'Naga'; $job1="Satya"; $job2="Banar";}
elseif($trb1 == ''){$tribe1 = 'Kinnara'; $job1="Satya"; $job2="Banar";}
elseif($trb1 == ''){$tribe1 = 'Asura'; $job1="Druka"; $job2="Karya";}
elseif($trb1 == ''){$tribe1 = 'Rakshasa'; $job1="Druka"; $job2="Karya";}
elseif($trb1 == ''){$tribe1 = 'Yaksa'; $job1="Nakayuda"; $job2="Vidya";}
elseif($trb1 == ' '){$tribe1 = 'Gandarva'; $job1="Nakayuda"; $job2="Vidya";}
elseif($trb1 == '@'){$tribe1 = 'Deva'; $job1="Avikara"; $job2="Samabat";}
else {$tribe1 = 'Garuda'; $job1="Avikara"; $job2="Samabat";}
}
if ($cnum == 2){
$rowtt = 6;
$rowgg = "char2job";
@fseek($f, 1804, SEEK_SET);
$trb1 = @fread($f,1) or die("Error");
if($trb1 == ''){$tribe1 = 'Naga'; $job1="Satya"; $job2="Banar";}
elseif($trb1 == ''){$tribe1 = 'Kinnara'; $job1="Satya"; $job2="Banar";}
elseif($trb1 == ''){$tribe1 = 'Asura'; $job1="Druka"; $job2="Karya";}
elseif($trb1 == ''){$tribe1 = 'Rakshasa'; $job1="Druka"; $job2="Karya";}
elseif($trb1 == ''){$tribe1 = 'Yaksa'; $job1="Nakayuda"; $job2="Vidya";}
elseif($trb1 == ' '){$tribe1 = 'Gandarva'; $job1="Nakayuda"; $job2="Vidya";}
elseif($trb1 == '@'){$tribe1 = 'Deva'; $job1="Avikara"; $job2="Samabat";}
else {$tribe1 = 'Garuda'; $job1="Avikara"; $job2="Samabat";}
}
if ($cnum == 3){
$rowgg = "char3job";
$rowtt = 7;
@fseek($f, 3492, SEEK_SET);
$trb1 = @fread($f,1) or die("Error");
if($trb1 == ''){$tribe1 = 'Naga'; $job1="Satya"; $job2="Banar";}
elseif($trb1 == ''){$tribe1 = 'Kinnara'; $job1="Satya"; $job2="Banar";}
elseif($trb1 == ''){$tribe1 = 'Asura'; $job1="Druka"; $job2="Karya";}
elseif($trb1 == ''){$tribe1 = 'Rakshasa'; $job1="Druka"; $job2="Karya";}
elseif($trb1 == ''){$tribe1 = 'Yaksa'; $job1="Nakayuda"; $job2="Vidya";}
elseif($trb1 == ' '){$tribe1 = 'Gandarva'; $job1="Nakayuda"; $job2="Vidya";}
elseif($trb1 == '@'){$tribe1 = 'Deva'; $job1="Avikara"; $job2="Samabat";}
else {$tribe1 = 'Garuda'; $job1="Avikara"; $job2="Samabat";}
}
$error = "";
function AllOK()
{
$error .= "There was a problem selecting your character! Please report this to the administrator and try again later!<br>
CODE: <b>".dechex($userid)."/".dechex($Character)."/".dechex($Initial)."/".dechex($nombre_archivo)."/".dechex($cnum)."</b></b><br><br> <a href=javascript:history.go(-1)>Go Back</a><br>";
return 0;
}
return 1;
}
if (!AllOK())
{
$result = $error;
}
else
{
if ($cnum == 1) { $Character = $rowA['Name1']; }
if ($cnum == 2) { $Character = $rowA['Name2']; }
if ($cnum == 3) { $Character = $rowA['Name3']; }
$userid=$_SESSION['username'];
mssql_select_db("Tantra",$link);
$weaA = mssql_query("SELECT * FROM TantraBackup00 WHERE UserID='$userid'");
$rowA = mssql_fetch_row($weaA);
$result = "You have successfully selected the character: <b>".$Character."</b>";
}
echo "$result <br>";
echo "".$Character." belongs to the ".$tribe1." tribe, please chose between one the following jobs!<br><br>"; ?>
<form METHOD="Post">
<SELECT name="job">
<OPTION VALUE="<? echo $job1 ?>"><? echo $job1 ?></option>
<OPTION VALUE="<? echo $job2 ?>"><? echo $job2 ?></option>
</SELECT>
<input value=" " type="submit" name="submit" style="height: 20px; width: 100px; background-image:url(file:///C|/Documents and Settings/Administrador/Escritorio/Respaldo KS/www/includes/images/change.png); border:0;" class="submit">
<input type="hidden" name="cnum" value="<? echo $cnum ?>">
<input type="hidden" name="Character" value="<? echo $Character ?>">
<input type="hidden" name="tribe" value="<? echo $tribe1 ?>">
<input type="hidden" name="final" value="ok">
</form><br /><br /><hr /><br /><br />
<?php
}
if ($job == 'Satya') {echo @ftell($f); @fseek($f, $seek1, SEEK_SET); @fwrite($f,$lvl,1) or die("Error"); @fseek($f, $seek2, SEEK_SET); @fwrite($f,'',1) or die("Error");
$itemgift = (int)(8750);}
if ($job == 'Banar') {echo @ftell($f); @fseek($f, $seek1, SEEK_SET); @fwrite($f,$lvl,1) or die("Error"); @fseek($f, $seek2, SEEK_SET); @fwrite($f,'',1) or die("Error"); @fseek($f, $seek3, SEEK_SET); @fwrite($f,'',1) or die("Error");
$itemgift = (int)(8750);}
if ($job == 'Druka') {echo @ftell($f); @fseek($f, $seek1, SEEK_SET); @fwrite($f,$lvl,1) or die("Error"); @fseek($f, $seek2, SEEK_SET); @fwrite($f,'',1) or die("Error"); @fseek($f, $seek3, SEEK_SET); @fwrite($f,'',1) or die("Error");
$itemgift = (int)(8751);}
if ($job == 'Karya') {echo @ftell($f); @fseek($f, $seek1, SEEK_SET); @fwrite($f,$lvl,1) or die("Error"); @fseek($f, $seek2, SEEK_SET); @fwrite($f,'',1) or die("Error"); @fseek($f, $seek3, SEEK_SET); @fwrite($f,'',1) or die("Error");
$itemgift = (int)(8751);}
if ($job == 'Nakayuda') {echo @ftell($f); @fseek($f, $seek1, SEEK_SET); @fwrite($f,$lvl,1) or die("Error"); @fseek($f, $seek2, SEEK_SET); @fwrite($f,'',1) or die("Error"); @fseek($f, $seek3, SEEK_SET); @fwrite($f,'',1) or die("Error");
$itemgift = (int)(8752);}
if ($job == 'Vidya') {echo @ftell($f); @fseek($f, $seek1, SEEK_SET); @fwrite($f,$lvl,1) or die("Error"); @fseek($f, $seek2, SEEK_SET); @fwrite($f,'',1) or die("Error"); @fseek($f, $seek3, SEEK_SET); @fwrite($f,'',1) or die("Error");
$itemgift = (int)(8752);}
if ($job == 'Avikara') {echo @ftell($f); @fseek($f, $seek1, SEEK_SET); @fwrite($f,$lvl,1) or die("Error"); @fseek($f, $seek2, SEEK_SET); @fwrite($f,'',1) or die("Error"); @fseek($f, $seek3, SEEK_SET); @fwrite($f,'',1) or die("Error");
$itemgift = (int)(8753);}
if ($job == 'Samabat') {echo @ftell($f); @fseek($f, $seek1, SEEK_SET); @fwrite($f,$lvl,1) or die("Error"); @fseek($f, $seek2, SEEK_SET); @fwrite($f,'',1) or die("Error"); @fseek($f, $seek3, SEEK_SET); @fwrite($f,'',1) or die("Error");
$itemgift = (int)(8753);}
echo "Your job has been updated to: ".$job."";
mssql_select_db("Tantra",$link);
mssql_query('INSERT INTO TantraItem (World, Account, ItemIndex, ItemCount) VALUES ("0", "'.$userid.'", "'.$itemgift.'", "1")'); }
else {echo "It seems like you have already updated your character's job once!";}
}
else
{
mssql_select_db("Tantra",$link);
$weaA = mssql_query("SELECT * FROM TantraBackup00 WHERE UserID='" . $_SESSION['username'] . "'");
$rowA = mssql_fetch_row($weaA); ?>
<p>You can now use the website to change your character's job just with a couple of clicks!<br />
<b>Notice that you will only be able to pick your second job once for every character.</b><br /><i>If you somehow got the wrong job, delete your character and ask for help in the forums!.<br />
</p>
<form METHOD="Post">
<SELECT name="Character">
<?php if($rowA[11] != ' '){ echo "<OPTION VALUE='1'>$rowA[11]</option>";} ?>
<?php if($rowA[12] != ' '){ echo "<OPTION VALUE='2'>$rowA[12]</option>";} ?>
<?php if($rowA[13] != ' '){ echo "<OPTION VALUE='3'>$rowA[13]</option>";} ?></SELECT>
<input value=" " type="submit" name="submit" style="height: 20px; width: 100px; background-image:url(file:///C|/Documents and Settings/Administrador/Escritorio/WOT/www/includes/images/change.png); border:0;" class="submit">
<input type="hidden" name="action" value="submitted">
</form>
<?php
}
break;
case 2:
?>
<font size="+2">ERROR</font><br /><br />
You are not logged in, please log in and try again!
<?php
break;
}
?>
y este el codigo del error de la linea 129
mssql_query('INSERT INTO TantraItem (World, Account, ItemIndex, ItemCount) VALUES ("0", "'.$userid.'", "'.$itemgift.'", "1")'); }
Espero y me puedan ayudar muchas gracias a todos los del forosdelweb saludos os agradesco a los que me puedan ayudar sobre este caso gracias.