Jump to content

[SOLVED] Parse error: syntax error, unexpected T_STRING...


newbtophp

Recommended Posts

Im getting this error when accessing index.php:

 

Parse error: syntax error, unexpected T_STRING in /home/gamer/public_html/index.php on line 4

 

This is the snippet which gives the error:

 

<?php
php

define('CRACK_ROOT', dirname(__FILE__ ? __FILE__: getenv('SCRIPT_FILENAME'))); //Line 4

define('LOCKED_ROOT', CRACK_ROOT . ' / www / ');

define('CRACK_FILE', CRACK_ROOT . ' / crack.php');


require_once CRACK_ROOT . ' / header.php';



if($ action == 'www_php')
(/* Empty the SESSION */ $ _SESSION['Key']= ''; 

 

Can anyone please help?  :)

Link to comment
Share on other sites

Hmmm.. thanks for that, now i get another error:

 

Parse error: syntax error, unexpected T_STRING, expecting T_VARIABLE or '$' in /home/gamer/public_html/index.php on line 10

 

  if ($ action == 'www_php') //Line 10
      ( /  * Empty the SESSION *  / $ _SESSION['Key'] = '';
  $ _SESSION['Next'] = false;
  $ _SESSION['Zlib'] = false;
  $ _SESSION['Session_key'] = '';
  
  if ($ www_php_size >  = 1024 * 1024)

Link to comment
Share on other sites

Thanks again, but ooopsie another error:

 

Parse error: syntax error, unexpected '/' in /home/gamer/public_html/index.php on line 11

 

  if ($action == 'www_php')
      ( /  * Empty the SESSION *  / $_SESSION['Key'] = ''; //Line 11
  $_SESSION['Next'] = false;
  $_SESSION['Zlib'] = false;
  $_SESSION['Session_key'] = '';

  if ($www_php_size >= 1024 * 1024)

Link to comment
Share on other sites

  if ($action == 'www_php')
     {
/* Empty the SESSION */ $_SESSION['Key'] = ''; //Line 11
  $_SESSION['Next'] = false;
  $_SESSION['Zlib'] = false;
  $_SESSION['Session_key'] = '';

 

Along with the comments, you need to open statements with { instead of (

Link to comment
Share on other sites

Thanks alot MadTechie, ShadeSlayer, KingPhilip!!!. I've replaced apropriately, all ( with { and ) with }.

 

Yet another error:

 

Parse error: syntax error, unexpected ';' in /home/gamer/public_html/index.php on line 29

 

Heres the code:

 

  if (!file_exists($SessionKeyRoot)) {
      (mkdir($SessionKeyRoot, 0777); //Line 29
  }

Link to comment
Share on other sites

Cheers all for the awesome help.

 

I've got another error (i so need to learn how to debug errors).

 

Warning: copy() [function.copy]: Filename cannot be empty in /home/gamer/public_html/run.php on line 37
File upload failed!

 

 $SessionKeyRoot=LOCKED_ROOT.$_SESSION['Session_key'];
  if (!file_exists($SessionKeyRoot))
      mkdir($SessionKeyRoot,0777);
  }
  $www_name=strtolower($locked_file_name);
  $www_copy=copy($locked_file,$SessionKeyRoot.'/'.$www_name.'.dat'); //Line 37
  if (!$www_copy) {
      echo $www_name."File upload failed!";
  exit;
  }
  unlink($locked_file);
  
  $fp = fopen($SessionKeyRoot.'/'.$www_name.'.dat', "rb");
  $Skip1 = fgets($fp, 10000);
  $Skip2 = fgets($fp, 100000);
  $Skip3 = fgets($fp, 100000);
  $www_key_data = fread($fp, 5000000);
  fclose($fp);

Link to comment
Share on other sites

Can you just post the file here? I'll go through it and fix all of the problems for you.

 

<?php
  
  define('CRACK_ROOT',dirname(__FILE__ ? __FILE__ : getenv('SCRIPT_FILENAME')));
  define('LOCKED_ROOT',CRACK_ROOT.'/www/');
  define('CRACK_FILE',CRACK_ROOT.'/select.php');
  
  require_once CRACK_ROOT.'/header.php';
  
  /* Decryption function */ 
  function www_dec_int($www_decint_code,$www_calc_key) {
  if ($www_calc_key == "") {
   // 
  }
  else {
  $www_calc_key=base64_encode($www_calc_key);
  $www_k1=substr($www_calc_key, 0, 1);
  $www_k2 =substr($www_calc_key, 1, 1);
  $www_k3=substr($www_calc_key, 2, 1);
  $www_decint_code=str_replace("$", "$www_k1", $www_decint_code);
  $www_decint_code=str_replace("(", "$www_k2", $www_decint_code);
  $www_decint_code=str_replace(")", "$www_k3", $www_decint_code);
  }
  $www_decint_code=base64_decode($www_decint_code);
  return $www_decint_code;
  }
  if ($action=='decode')
  if ($locked_file_size>=1024*1024) {
  echo "files more than 1MB!";
  exit;
  }
  else {
  $SessionKeyRoot=LOCKED_ROOT.$_SESSION['Session_key'];
  if (!file_exists($SessionKeyRoot))
      mkdir($SessionKeyRoot,0777);
  }
  $www_name=strtolower($locked_file_name);
  $www_copy=copy($locked_file,$SessionKeyRoot.'/'.$www_name.'.dat');
  if (!$www_copy) {
      echo $www_name."File upload failed!";
  exit;
  }
  unlink($locked_file);
  
  /* Decrypt */ 
  $fp = fopen($SessionKeyRoot.'/'.$www_name.'.dat', "rb");
  $Skip1 = fgets($fp, 10000);
  $Skip2 = fgets($fp, 100000);
  $Skip3 = fgets($fp, 100000);
  $www_key_data = fread($fp, 5000000);
  fclose($fp);
  
  /* For decompression */ 
  if ($_SESSION['zlib']) $www_key_data=gzinflate(base64_decode($www_key_data));
  
  header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
  header('Last-Modified:' . gmdate('D, d MYH: i: s') . ' GMT ');
  header('Cache-Control: private');
  header('Pragma: no-cache');
  header('Content-Encoding: none');
  header('Content-Type: application/x-php'); 

  echo www_dec_int($www_key_data,$_SESSION['key']); {
  exit;
}
if (!$_SESSION['next']) {
exit('Access Denied');
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<title></title>
<script language="JavaScript" type="text/javascript">
function CheckForm(form) {
var locked_file=form.locked_file.value;
if (locked_file=="") {
alert ("Please select a file!");
return false;
}
}
</script>
</head>

<body>
<div> <pre>
Have successfully obtain signature.
</pre> </div>
<form name="Decoder" method="post" enctype="multipart/form-data" action="<?=$_SERVER["PHP_SELF"]?>" onSubmit="return CheckForm(this);">
Please upload </div>
<input Type="file" name="locked_file" />
<input type="hidden" name="action" value="decode" />
<br />
<input type="submit" name="Submit" value="Decode"/>
</form>
</body>
</html>

 

Thanks

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.