little error i really don't know what's wrong...

phpBB3 and MOD challenges setup by the staff to test and challenge your phpBB3 coding skills.

little error i really don't know what's wrong...

Postby silencer0 » 08 Aug 2007, 16:35

the code of my index.php page...
Spoiler:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>

<head>
<?php
include "./configuration.php";




//the beginning is of my licensing system..





# $Date: 2006-06-10 11:45:08 +0100 (Sat, 10 Jun 2006) $
# iono Licensing Integration #3 (curl) - http://www.olate.co.uk

# **************************************************************************
# User details must be added in here. This would usually be done in another
# file. See documentation for help and examples.

//$license_key = 'USER LICENSE KEY'; // License's key INCLUDED IN CONFIG.PHP
# *************************************************************************

# You do not need to edit any of the following code

// Error texts
$error_text['disabled'] = '<p><strong>License Error:</strong> Your license is disabled. Please contact your software vendor for support.</p>';
$error_text['suspended'] = '<p><strong>License Error:</strong> Your license has been suspended. Please contact your software vendor for support.</p>';
$error_text['expired'] = '<p><strong>License Error:</strong> Your license has expired. Please contact your software vendor for support.</p>';
$error_text['exceeded'] = '<p><strong>License Error:</strong> You have reached the maximum number of installs allowed. Please contact your software vendor for support.</p>';
$error_text['invalid_user'] = '<p><strong>License Error:</strong> Invalid license key. Please contact your software vendor for support.</p>';
$error_text['invalid_code'] = '<p><strong>License Error:</strong> Invalid license status code. Please contact your software vendor for support.</p>';
$error_text['invalid_hash'] = '<p><strong>License Error:</strong> Invalid communication hash. Please contact your software vendor for support.</p>';
$error_text['wrong_product'] = '<p><strong>License Error:</strong> The license key you provided is not for this product. Please contact your software vendor for support.</p>';

// Home call details
$home_url_site = 'http://y-fusion.com';
$home_url_port = 80;
$home_url_iono = '/order/remote.php';
$user_defined_string = '8807a9a5e448';

// Execution options
$comm_terminate = true;
$license_terminate = true;
$product_license_id = 1;

// Check that the $license_key provided is for this product
if (!empty($product_license_id))
{
   $key_parts = explode('-', $license_key);
   $product_id = array(substr(md5($product_license_id), 0, 8));
   
   if (!in_array($key_parts[4], $product_id))
   {
      echo $error_text['wrong_product'];
      ($license_terminate) ? exit : NULL;
   }
}

// Build request
$request = 'remote=licenses&type=3&license_key='.urlencode(base64_encode($license_key));
$request .= '&host_ip='.urlencode(base64_encode($_SERVER['SERVER_ADDR'])).'&host_name='.urlencode(base64_encode($_SERVER['SERVER_NAME']));
$request .= '&hash='.urlencode(base64_encode(md5($request)));

$request = $home_url_site.$home_url_iono.'?'.$request;

// New cURL resource
$ch = curl_init();

// Set options
curl_setopt($ch, CURLOPT_URL, $request);
curl_setopt($ch, CURLOPT_PORT, $home_url_port);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_USERAGENT, 'iono (www.olate.co.uk/iono)');

// Execute
$content = curl_exec($ch);

// Close
curl_close($ch);

if (!$content)
{
   ($comm_terminate) ? exit : NULL;
}

// Split up the content
$content = explode('-', $content);
$status = $content[0];
$hash = $content[1];

if ($hash == md5($user_defined_string.$_SERVER['SERVER_NAME']))
{
   switch ($status)
   {
      case 0: // Disabled
         echo $error_text['disabled'];
         unset($home_url_site, $home_url_iono, $user_defined_string, $request, $header, $return, $fpointer, $content, $status, $hash);
         ($license_terminate) ? exit : NULL;
         break;
      case 1: // Ok
         break;
      case 2: // Suspended
         echo $error_text['suspended'];
         unset($home_url_site, $home_url_iono, $user_defined_string, $request, $header, $return, $fpointer, $content, $status, $hash);
         ($license_terminate) ? exit : NULL;
         break;
      case 3: // Expired
         echo $error_text['expired'];
         unset($home_url_site, $home_url_iono, $user_defined_string, $request, $header, $return, $fpointer, $content, $status, $hash);
         ($license_terminate) ? exit : NULL;
         break;
      case 4: // Exceeded allowed installs
         echo $error_text['exceeded'];
         unset($home_url_site, $home_url_iono, $user_defined_string, $request, $header, $return, $fpointer, $content, $status, $hash);
         ($license_terminate) ? exit : NULL;
         break;
      case 10: // Invalid user ID or license key
         echo $error_text['invalid_user'];
         unset($home_url_site, $home_url_iono, $user_defined_string, $request, $header, $return, $fpointer, $content, $status, $hash);
         ($license_terminate) ? exit : NULL;
         break;
      default: // Invalid status code
         echo $error_text['invalid_code'];
         unset($home_url_site, $home_url_iono, $user_defined_string, $request, $header, $return, $fpointer, $content, $status, $hash);
         ($license_terminate) ? exit : NULL;
         break;
   }
}
else
{
   echo $error_text['invalid_hash'];
   unset($home_url_site, $home_url_iono, $user_defined_string, $request, $header, $return, $fpointer, $content, $status, $hash);
   ($license_terminate) ? exit : NULL;
}

// Clean up variables for security
unset($home_url_site, $home_url_iono, $user_defined_string, $request, $header, $return, $fpointer, $content, $status, $hash);
//end licensing system code

//START OLD IP - NO LOGGING. - long and bad way, better use the easy one :p ;)
//function ip() {
//  if(getenv("HTTP_X_FORWARDED_FOR")) {
//    $IPadres = getenv("HTTP_X_FORWARDED_FOR");
//  } elseif(getenv("HTTP_CLIENT_IP")) {
//    $IPadres = getenv("HTTP_CLIENT_IP");
//  } else {
//    $IPadres = $_SERVER["REMOTE_ADDR"];
//  }
//  return $IPadres;
//}
//END OLD IP - NO LOGGING

//new IP RECORDING SYSTEM, needs php 5...
//for php 4 people we will put it compatible too :-)
if ($hasphp5) //if has php 5
{
$ip5=$_SERVER["REMOTE_ADDR"];
file_put_contents("./admin/ip+file.txt",$ip5 . "-" . $file_name); // log the ip of uploaders to ip.txt file & say it's logged.
}
else // or else...
{
$ip4=$_SERVER["REMOTE_ADDR"]; //just show like it's logged, just show his ip and say it's logged.
}
?>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<meta name="author" content=""/>
<link rel="stylesheet" type="text/css" href="style.css" media="screen"/>

<title><? //include "configuration.php" ?><?=$sitename?></title>

</head>

<body>
       <?php if (!isset($installed))
      {
      echo "</br><a href='./setup/'>Click here to install the script, or else it won't work properly!</a>";
      ?>
<div id="wrapper">
<div id="container">

<div class="title">
  <h1><a href="index.php"><?=$sitename?></a></h1>

</div>

<div class="header"></div>

<div class="navigation">

   
   <a href="index.php" id="active">Home</a>
   <? if ($publishnews)
   { echo "<a href='news.php'>News</a>"; }
   else
   {
   }
   ?>
   <a href="membership.php">Membership options.</a>
      <? if ($iptab)
   {
   echo "<a href='ip.php'>Show My IP</a>";
   }
   else
   {
   }
   ?>

   <div class="clearer"></div>

</div>

<div class="main">

   <div class="content">
     <form action="" method="post" enctype="multipart/form-data">
       <p align="center">
     
       </p>
       <p align="center">
      <?php if ($attention)
      {
      echo "<code>" . $attentionmsg . "</code>";
      }
      else
      {
      }
      ?>
         <?php if (!file_exists('copyright.php'))
{
   echo 'Please upload the ORIGINAL copy of copyright.php!<br>You did not buy a copyright removal! That\'s illegal!<br><img src=./img/attention.png /><br>You did not buy a copyright removal! That\'s illegal!<br> Please upload the ORIGINAL copy of copyright.php!';
   exit;
}
else
{
} ?>
         <br />
       <? if ($ads)
      {
      echo "" . $adscode . "";
      } ?></p>
       <p align="center"><b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<img src="img/Download.png" alt="" width="93" height="93" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     <?php  if (!$site_disabled)
   {
   echo 'file : </b><input type="file" name="bestand" >
    <input type="submit" name="submit" value="Upload" />';
   }
   else
   {
   echo '</b>' . $site_disabled_reason . '';
   }
    ?><?php /* <input type="file" name="bestand" >
    <input type="submit" name="submit" value="Upload" /> */ ?>
    <b><img src="img/Download.png" alt="" width="93" height="93" /></b><br />
       <? if ($ads)
      {
      echo "" . $adscode . "";
      } ?>
       <?php if (!isset($installed))
      {
      echo "</br><a href='./setup/'>Click here to install the script, or else it won't work properly!</a>";
      ?>
       </p>
  <p align="center">
<?php

if (isset($_FILES['bestand']))
{
   $error = array();
   
   $file_name = basename($_FILES['bestand']['name']);
   if ($_FILES['bestand']['error'] || !is_uploaded_file($_FILES['bestand']['tmp_name']))
   {
      $error[] = '<img src=./img/attention.png />There was something wrong with your file. ';
   }
   else
   {
      if ($_FILES['bestand']['size'] > $maxsize)
      {
         $error[] = "Your file's size is <b>" . $_FILES['bestand']['size'] . "</b>, The max size is <b> $maxsize </b>.";
      }
      
      if (!strstr($file_name, '.') || !in_array(strtolower(array_pop(explode('.', $file_name))), array('gif', 'jpg', 'jpeg', 'png')))
      {
         $error[] = '<img src=./img/attention.png />Your file was not an image.';
      }
            
      if (file_exists("upload/{$file_name}"))
      {
         $error[] = '<img src=./img/attention.png />A file with this name already exists.';
      }
   }
   
   if (!sizeof($error) && !@move_uploaded_file($_FILES['bestand']['tmp_name'], 'upload/' . $file_name))
   {
      $error[] = '<img src=./img/attention.png />The file could not be uploaded.';
   }
   
   if (!sizeof($error))
   {
      $fileurl = "upload/{$file_name}";
      echo "Direct link to Image: <textarea name='textarea' cols='65' wrap='soft' rows='1'>$siteurl$fileurl</textarea>
      <br />html Direct link : <textarea name='textarea' cols='65' wrap='soft' rows='1'><a href='$siteurl$fileurl'>$siteurl$fileurl</a></textarea>
      ";
      //BBCODE CAUSING ERRORS, REMOVED.
      if ($hasphp5)
{
      echo '<br />Your IP has been logged (IP might now show up for some browsers - but still is logged.) : ' . $ip5;
}
else
{
      echo '<br />Your IP has been logged (IP might now show up for some browsers - but still is logged.) : ' . $ip4;
}
      echo '<br /> Preview : <br /> <img src="./upload/' . $file_name . '" />';
   }
   else
   {
      echo implode('<br />', $error);
   }
}

?>
<br>
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
          <div align="center">
 
          </div>
          <p align="center">         <?php if (!file_exists('copyright.php'))
{
   echo 'Please upload the ORIGINAL copy of copyright.php!<br>You did not buy a copyright removal! That\'s illegal!<br><img src=./img/attention.png /><br>You did not buy a copyright removal! That\'s illegal!<br> Please upload the ORIGINAL copy of copyright.php!';
   exit;
}
else
{
} ?></p>
     </form>
<p>&nbsp;</p>&nbsp;</p>
      <p>&nbsp;</p>

      <blockquote>
       <p> Supported Formats: png, jpg, gif<br />
         Max FileSize:<?=$maxfilesize?>
        
           <br />
           <? if (file_exists('copyright.php'))
         {
          include "copyright.php";
         }
         else
         {
            echo 'Please upload the ORIGINAL copy of copyright.php!<br>You did not buy a copyright removal! That\'s illegal!<br><img src=./img/attention.png /><br>You did not buy a copyright removal! That\'s illegal!<br> Please upload the ORIGINAL copy of copyright.php!';
          }
          ?><br />
          <?
if ($debug)
     {
if ($installed)
{
   echo 'Successfully installed.';
}
else
{
   echo 'Not installed right!';
}
    }
else
{
}    ?>
  &nbsp;</p>
       </blockquote>

     </div>


   <div class="footer">

      <div class="left">
         Copyright &copy; 2007 <a href='<?=$siteurl?>'><?=$sitename?></a>.
      </div>

      <div class="right">
         <a href="http://templates.arcsin.se">Website template</a> by <a href="http://arcsin.se">Arcsin</a>
      </div>

      <div class="clearer"></div>

   </div>

</div>

</div>
</div>

</body>
</html>

and the error i get :
Parse error: syntax error, unexpected $end in /home/thewod/public_html/imgu/index.php on line 401

lol by trying to find the error i had find some other errors lol but still that error... :(
i really can't find out what's wrong :(

i hope someone can help me..
Proud to be working on : - Extended Warning Mod Grin
silencer0
Ensign
Ensign
 
Posts: 84
Joined: 10 Feb 2007, 05:08
Gender: Male




phpBB Academy at StarTrekGuide
Support STG
Using PayPal Donate

Return to phpBB3 Challenges at phpBB Academy

Who is online

Users browsing this forum: No registered users and 2 guests

cron