ارسال موضوع  ارسال پاسخ 
 
رتبه موضوع:
  • 0 رای - 0 میانگین
  • 1
  • 2
  • 3
  • 4
  • 5
مشکل در اسکریپت آپلود سنتر
نویسنده پیام
transcend آفلاین
Junior Member
*

ارسال‌ها: 23
Likes Given: 0
Likes Received: 0 in 0 posts
تاریخ عضویت: ۲۰ مهر ۱۳۸۷
ارسال: #1
مشکل در اسکریپت آپلود سنتر
سلام بر همگی شرمنده مشکلم رو اینجا بیان میکنم چون هیچ جایی مثل اینجا بچه هاش با معرفت نیست برای همین مزاحم شدم.
من از یک اسکریپت اپلود سنتر میخام استفاده کنم اما توی نصب با ارور مواجه میشم
Parse error: parse error, unexpected $end in C:\Program Files\EasyPHP 2.0b1\www\12\install.php on line 419

خب و اما سروس فایل install

کد PHP:
<?php



$step 
$_GET['step'];

if ( empty(
$step) ) {
    
$step 1;
}

switch(
$step){
default:
case 
1:
?>
        <!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>Step 1 of 2 | Installing Ultimate Regnow Affiliate by Goldorak _[NUL]</title>
        <style type="text/css" />
        html {
            background: #ccc;
            padding: 30px;
            margin: 0; 
        }
        body {  
            width: 500px;
            margin: 0 auto;
            text-align: left;
            padding: 20px;
            background: #fff;
            font-family: Arial, Helvetica, sans-serif;
            font-size: 12px;
            line-height: 19px;
        }
        h1 {
            font-family: Georgia, "Times New Roman", Times, serif;
            font-size: 20px;
            line-height: 23px;
            color: #666666;
            border-bottom: 1px solid #CCCCCC;
        }
        .ok {
            color: #339900;
            font-weight: bold;
        }
        .warn {
            color: #0066CC;
            font-weight: bold;
        }
        .error {
            color: #FF0000;
            font-weight: bold;
        }
        .warning {
            border: 1px solid #990000;
            background: #FFEEEE;
            color: #000;
            text-align: center;
            padding: 15px;
        }
        #footer_note {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: 11px;
            padding: 10px;
            border-top: 1px dotted #ccc;
            text-align: center;
            margin-top: 20px;
        }
        #footer_note a:link, #footer_note a:visited {
            color: #077307;
            text-decoration: none;
        }
        #footer_note a:hover {
            color: #114605;
            text-decoration: none;
        }
        .button {
            color: #fff;
            background: #003399;
            border: 1px solid #000000;
            padding: 3px;
            text-decoration: none;
        }
        </style>
        </head>
        
        <body>
        <img src="admin/images/logo.gif" alt="Ultimate Regnow Affiliate" /><br /><br />
        <h1>First step</h1>
<?
        $error 
0;
        echo 
"<p>Checking if <strong>config.php</strong> exists ... ";
        if( !
file_exists('config.php')) { 
            
$error 1;
            echo 
"<span class=\"error\">ERROR : The required file is not found.</span>";
        }
        else echo 
"<span class=\"ok\">[OK]</span>";
        echo 
"</p>";
        @require_once(
'config.php');
        @require_once(
'include/functions.php');
        
        echo 
"<p>Checking the database connection ... ";
        
$connection = @mysql_connect($db_host$db_user$db_pass);
        if( !
$connection )  {
            
$error 1;
            echo 
"<span class=\"error\">ERROR : ".mysql_error()."</span>";
            }
            else echo 
"<span class=\"ok\">[OK]</span>";
            echo 
"</p>";
        
        echo 
"<p>Checking for existing database ... ";
        
$db = @mysql_select_db($db_name);
        if( !
$db ) {
            echo 
"<span class=\"error\">ERROR : ".mysql_error()."</span>";
            
$error 1;
        }
        else echo 
"<span class=\"ok\">[OK]</span>";
        echo 
"</p>";
/*        
        echo "<p>Changing chmod permission for the \"admin/temp.txt\" to 0777 ... ";
            if( !@chmod('admin/temp.txt', 0777) ) {
                $error = 1;
                echo "<span class=\"error\">Couldn't CHMOD. Please do it manually.</span>";
            }
            else echo "<span class=\"ok\">[OK]</span>";
            echo "</p>";
        echo "<p>Changing chmod permission for the \"cache\" directory to 0777 ... ";
            if( !@chmod('cache', 0777) ) {
                $error = 1;
                echo "<span class=\"error\">Couldn't CHMOD. Please do it manually.</span>";
            }
            else echo "<span class=\"ok\">[OK]</span>";
            echo "</p>";
*/
            
echo "<p class=\"warn\">It's crucial that you don't forget to setup the access rights with CHMOD 777 for the following:</p>
                  - <b>/admin/temp.txt</b><br />
                  - <b>/cache</b>"
;    
        
            
$sql "SELECT id FROM ura_settings WHERE id = '0'";
            
$result = @mysql_query($sql);
            
        if( 
$result ) {    
            
$error 1;
            echo 
"<p class=\"warning\">It seems that Ultimate Regnow Affiliate is already installed!<br />To reinstall it, please empty the database first (by dropping the existing tables) !</p>";
        }
            
        if( !
$error ){
            echo 
"<p class=\"ok\">Everything seems to be fine. Let's create the database tables and fill them up.</p><br />";
            echo 
"<a href=\"install.php?step=2&start=1&pointer=0\" class=\"button\"><strong>Continue &raquo;</strong></a>";
        }
        else {
            echo 
"<center><p><a href=\"install.php\" class=\"button\"><strong>Retry</strong></a></p></center>";
        
        }
?>
    <div id="footer_note">
    Copyright 2007 Goldorak _[NUL]<a href="http://www." target="_blank" rel="nofollow">Goldorak _[NUL]</a>.<br />
    </div>
    </body>
    </html>
<?
break;

//Step 2 - start importing the database;
case 2:
        include(
'config.php');
        include(
'include/functions.php');

        function 
get_percentage($full$part){
            
$percent ceil(($part 100)/$full);
            return 
$percent;
        }

        
$connection db_connect();
        
header("Expires: Mon, 1 Jan 1999 01:01:01 GMT");
        
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");
        
header("Cache-Control: no-store, no-cache, must-revalidate");
        
header("Cache-Control: post-check=0, pre-check=0"false);
        
header("Pragma: no-cache");

        
ini_set("auto_detect_line_endings"true);
    
        
$filename      =    "ura_database.sql";
        
$linesize      =    65536;
        
$querybatch     =    300;
        
$linesbatch  =     2000;
        
$sleep          =     2000;

        
        
$comment[0]="#";
        
$comment[1]="-- ";
        
        
?>
        <!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>Step 2 of 2 | Installing Ultimate Regnow Affiliate by Goldorak _[NUL]</title>
        <style type="text/css" />
        html {
            background: #ccc;
            padding: 30px;
            margin: 0; 
        }
        body {  
            width: 500px;
            margin: 0 auto;
            text-align: left;
            padding: 20px;
            background: #fff;
            font-family: Arial, Helvetica, sans-serif;
            font-size: 12px;
            line-height: 19px;
        }
        h1 {
            font-family: Georgia, "Times New Roman", Times, serif;
            font-size: 20px;
            line-height: 23px;
            color: #666666;
            border-bottom: 1px solid #CCCCCC;
        }
        .ok {
            color: #339900;
            font-weight: bold;
        }
        .error {
            color: #FF0000;
            font-weight: bold;
        }
        .loading {
            font-size: 14px;
            color: #990000;
            text-align: center;
        }
        .warning {
            border: 1px solid #990000;
            background: #FFEEEE;
            color: #000;
            text-align: center;
            padding: 15px;
        }
        #footer_note {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: 11px;
            padding: 10px;
            border-top: 1px dotted #ccc;
            text-align: center;
            margin-top: 20px;
        }
        #footer_note a:link, #footer_note a:visited {
            color: #077307;
            text-decoration: none;
        }
        #footer_note a:hover {
            color: #114605;
            text-decoration: none;
        }
        </style>
        </head>
        
        <body>
        <img src="admin/images/logo.gif" alt="Ultimate Regnow Affiliate" /><br /><br />
        <h1>Last step</h1>
        <p class="warning">Please be patient and don't close the window or STOP this page from loading! <br />This may take a while because we're importing a large database now.</p>
        <?
        
        $error 
0;

        if (!
$error && isset($filename)){ 
        
//open the .sql file
          
if ( !$file = @fopen($filename,"rt")){
            echo 
"<p class=\"error\">Cannot open <strong>".$filename."</strong>";
            if( !
file_exists($filename) )
                echo 
"<br /> It seems that the file does not exist! Please check that you've uploaded all the files.";
            echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
            
$error 1;
          }
            
          elseif ( 
fseek($file0SEEK_END)==0) {
            
$filesize ftell($file);
          }

          else{
            echo 
"<p class=\"error\">Cannot get the filesize of ".$filename;
            echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
            
$error 1;
          }
        }
          if (!
$error && isset($_REQUEST["start"]) && isset($_REQUEST["pointer"])){
            echo 
"<p class=\"loading\"><i>Please wait ...</i></p>";

          if (
$_REQUEST["pointer"] > $filesize){
//            If the script ended here, it means that the file pointer is somewhere after the end of file. 
            
$error 1;
            echo 
"<p class=\"error\">The file pointer is out of bounds.";
            echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
          }
        
          if (!
$error && (fseek($file$_REQUEST["pointer"]) != 0) ){
//            If the script ended here, it means that the file pointer could not be set at $_REQUEST["pointer"];
            
$error 1;
            echo 
"<br /><p class=\"error\">The script was killed at this line : <strong>".__LINE__."</strong></p>";
          }
        
          if (!
$error){
            
$query "";
            
$queries 0;
            
$linenumber $_REQUEST["start"];
            
$querylines 0;
            
$inparents false;

            while ((
$linenumber $_REQUEST["start"] + $linesbatch || $query!=""
               && (
$dumpline=fgets($file$linesize)) ){ 

              
$dumpline ereg_replace("\r\n$""\n"$dumpline);
              
$dumpline ereg_replace("\r$""\n"$dumpline);
              
              if ( !
$inparents ){ 
              
                
$skipline false;
                
reset($comment);
                foreach (
$comment as $comment_value)
                { if (!
$inparents && (trim($dumpline)=="" || strpos ($dumpline$comment_value) === 0))
                  { 
$skipline=true;
                    break;
                  }
                }
                if( 
$skipline ){
                  
$linenumber++;
                  continue; 
                }
              }
        
              
$dumpline_deslashed str_replace ("\\\\","",$dumpline);
        
              
$parents substr_count($dumpline_deslashed"'")-substr_count ($dumpline_deslashed"\\'");
              
              if( 
$parents%!= )
                
$inparents=!$inparents;
              
$query .= $dumpline;

              if (!
$inparents)
                
$querylines++;
              
              if ( 
$querylines $querybatch)
              {
//                If the script ended here, it means that the current query includes more than $querybatch dump lines. Possible cause : missing ";" (semicolon) after every dump line.
//                This shouldn't ever happen, but is better to be safe than sorry
                
echo "<br /><p class=\"error\">The script was killed at this line : <strong>".__LINE__."</strong></p>";
                
$error 1;
                break;
              }
        
              if (
ereg(";$",trim($dumpline)) && !$inparents)
              { if(!
mysql_query(trim($query), $connection))
                { 
                  echo 
"<p class=\"error\">There was a problem during the installation process. The reported MySQL error is : <br />";
                  echo 
mysql_error();
                  echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
                  
$error 1;
                  break;
                }
                
$queries++;
                
$query="";
                
$querylines=0;
              }
              
$linenumber++;
            }
          }
        
          if (!
$error){
              
$pointer ftell($file);
            if (!
$pointer){
//            If the script ended here, it means that it cannot read the file pointer offset.        
              
$error 1;
              
$line_of_end __LINE__;
            }
          }
        
          if ( !
$error ){
            if (
$linenumber $_REQUEST["start"]+ $linesbatch){
              echo 
"<span class=\"ok\">Great! Ultimate Regnow Affiliate is now installed.</span><br /><br />";

              echo 
"<p>Now you can <a href=\""._URL."/admin/login.php\" target=\"_blank\">login</a> as admin with <b>username</b> 'admin' and <b>password</b> 'admin'.</p><br />";
              echo 
"<p>We recommend that you go to <i>Admin Area -> Settings -> Edit Admin Details</i> and update your password.</p><br /><br />";
              echo 
"<p class=\"warning\">Also, please make sure you delete the following files : <br />
                    <strong>install.php</strong><br />
                    <strong>"
.$filename."</strong></p>";
              echo 
"</p>";
//              $error = 1;
            
}
            else
            {             
              echo 
"<script language=\"JavaScript\" type=\"text/javascript\">window.setTimeout('location.href=\"install.php?step=2&start=$linenumber&pointer=$pointer\";',500+$sleep);</script>\n";
              echo 
"<noscript>\n";
              echo 
"<p>Click <a href=\"install.php?step=2&start=$linenumber&pointer=$pointer\">continue &raquo;</a> (Please enable JavaScript to do this automatically)</p>\n";
              echo 
"</noscript>\n";
            }
          }
        }
        
        if (
$error)
            echo 
"<p class=\"error\">There was an error encountered. Please drop the old tables before restarting !<br /><a href=\"install.php\">&laquo; Go back</a></p>";
        
// close both the connection and file;
        
if ($connectionmysql_close();
        if (
$filefclose($file);

        
?>
            <div id="footer_note">
            &copy;Copyright  <?=date('Y')?> <a href="http://www." target="_blank" rel="nofollow">Goldorak _[NUL]</a>.<br />
            </div>
        </body>
        </html>
<?
break;
}
// end switch;
?>

419 میشه خط اخری اما من چیزی متوجه نشدم

ممنون
۳ آبان ۱۳۸۷ ۱۲:۳۲ عصر
یافتن تمامی ارسال‌های این کاربر Like Post نقل قول این ارسال در پاسخ
Morteza آفلاین
Posting Freak
*****

ارسال‌ها: 1,370
Likes Given: 12
Likes Received: 25 in 20 posts
تاریخ عضویت: ۶ دی ۱۳۸۶
ارسال: #2
مشکل در اسکریپت آپلود سنتر
سلام سجاد جان
کد PHP:
<?php



$step 
$_GET['step'];

if ( empty(
$step) ) {
    
$step 1;
}

switch(
$step){
default:
case 
1:
?>
        <!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>Step 1 of 2 | Installing Ultimate Regnow Affiliate by Goldorak _[NUL]</title>
        <style type="text/css" />
        html {
            background: #ccc;
            padding: 30px;
            margin: 0; 
        }
        body {  
            width: 500px;
            margin: 0 auto;
            text-align: left;
            padding: 20px;
            background: #fff;
            font-family: Arial, Helvetica, sans-serif;
            font-size: 12px;
            line-height: 19px;
        }
        h1 {
            font-family: Georgia, "Times New Roman", Times, serif;
            font-size: 20px;
            line-height: 23px;
            color: #666666;
            border-bottom: 1px solid #CCCCCC;
        }
        .ok {
            color: #339900;
            font-weight: bold;
        }
        .warn {
            color: #0066CC;
            font-weight: bold;
        }
        .error {
            color: #FF0000;
            font-weight: bold;
        }
        .warning {
            border: 1px solid #990000;
            background: #FFEEEE;
            color: #000;
            text-align: center;
            padding: 15px;
        }
        #footer_note {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: 11px;
            padding: 10px;
            border-top: 1px dotted #ccc;
            text-align: center;
            margin-top: 20px;
        }
        #footer_note a:link, #footer_note a:visited {
            color: #077307;
            text-decoration: none;
        }
        #footer_note a:hover {
            color: #114605;
            text-decoration: none;
        }
        .button {
            color: #fff;
            background: #003399;
            border: 1px solid #000000;
            padding: 3px;
            text-decoration: none;
        }
        </style>
        </head>
        
        <body>
        <img src="admin/images/logo.gif" alt="Ultimate Regnow Affiliate" /><br /><br />
        <h1>First step</h1>
<?
        $error 
0;
        echo 
"<p>Checking if <strong>config.php</strong> exists ... ";
        if( !
file_exists('config.php')) { 
            
$error 1;
            echo 
"<span class=\"error\">ERROR : The required file is not found.</span>";
        }
        else echo 
"<span class=\"ok\">[OK]</span>";
        echo 
"</p>";
        @require_once(
'config.php');
        @require_once(
'include/functions.php');
        
        echo 
"<p>Checking the database connection ... ";
        
$connection = @mysql_connect($db_host$db_user$db_pass);
        if( !
$connection )  {
            
$error 1;
            echo 
"<span class=\"error\">ERROR : ".mysql_error()."</span>";
            }
            else echo 
"<span class=\"ok\">[OK]</span>";
            echo 
"</p>";
        
        echo 
"<p>Checking for existing database ... ";
        
$db = @mysql_select_db($db_name);
        if( !
$db ) {
            echo 
"<span class=\"error\">ERROR : ".mysql_error()."</span>";
            
$error 1;
        }
        else echo 
"<span class=\"ok\">[OK]</span>";
        echo 
"</p>";
/*        
        echo "<p>Changing chmod permission for the \"admin/temp.txt\" to 0777 ... ";
            if( !@chmod('admin/temp.txt', 0777) ) {
                $error = 1;
                echo "<span class=\"error\">Couldn't CHMOD. Please do it manually.</span>";
            }
            else echo "<span class=\"ok\">[OK]</span>";
            echo "</p>";
        echo "<p>Changing chmod permission for the \"cache\" directory to 0777 ... ";
            if( !@chmod('cache', 0777) ) {
                $error = 1;
                echo "<span class=\"error\">Couldn't CHMOD. Please do it manually.</span>";
            }
            else echo "<span class=\"ok\">[OK]</span>";
            echo "</p>";
*/
            
echo "<p class=\"warn\">It's crucial that you don't forget to setup the access rights with CHMOD 777 for the following:</p>
                  - <b>/admin/temp.txt</b><br />
                  - <b>/cache</b>"
;    
        
            
$sql "SELECT id FROM ura_settings WHERE id = '0'";
            
$result = @mysql_query($sql);
            
        if( 
$result ) {    
            
$error 1;
            echo 
"<p class=\"warning\">It seems that Ultimate Regnow Affiliate is already installed!<br />To reinstall it, please empty the database first (by dropping the existing tables) !</p>";
        }
            
        if( !
$error ){
            echo 
"<p class=\"ok\">Everything seems to be fine. Let's create the database tables and fill them up.</p><br />";
            echo 
"<a href=\"install.php?step=2&start=1&pointer=0\" class=\"button\"><strong>Continue &raquo;</strong></a>";
        }
        else {
            echo 
"<center><p><a href=\"install.php\" class=\"button\"><strong>Retry</strong></a></p></center>";
        
        }
?>
    <div id="footer_note">
    Copyright 2007 Goldorak _[NUL]<a href="http://www." target="_blank" rel="nofollow">Goldorak _[NUL]</a>.<br />
    </div>
    </body>
    </html>
<?
break;

//Step 2 - start importing the database;
case 2:
        include(
'config.php');
        include(
'include/functions.php');

        function 
get_percentage($full$part){
            
$percent ceil(($part 100)/$full);
            return 
$percent;
        }

        
$connection db_connect();
        
header("Expires: Mon, 1 Jan 1999 01:01:01 GMT");
        
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");
        
header("Cache-Control: no-store, no-cache, must-revalidate");
        
header("Cache-Control: post-check=0, pre-check=0"false);
        
header("Pragma: no-cache");

        
ini_set("auto_detect_line_endings"true);
    
        
$filename      =    "ura_database.sql";
        
$linesize      =    65536;
        
$querybatch     =    300;
        
$linesbatch  =     2000;
        
$sleep          =     2000;

        
        
$comment[0]="#";
        
$comment[1]="-- ";
        
        
?>
        <!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>Step 2 of 2 | Installing Ultimate Regnow Affiliate by Goldorak _[NUL]</title>
        <style type="text/css" />
        html {
            background: #ccc;
            padding: 30px;
            margin: 0; 
        }
        body {  
            width: 500px;
            margin: 0 auto;
            text-align: left;
            padding: 20px;
            background: #fff;
            font-family: Arial, Helvetica, sans-serif;
            font-size: 12px;
            line-height: 19px;
        }
        h1 {
            font-family: Georgia, "Times New Roman", Times, serif;
            font-size: 20px;
            line-height: 23px;
            color: #666666;
            border-bottom: 1px solid #CCCCCC;
        }
        .ok {
            color: #339900;
            font-weight: bold;
        }
        .error {
            color: #FF0000;
            font-weight: bold;
        }
        .loading {
            font-size: 14px;
            color: #990000;
            text-align: center;
        }
        .warning {
            border: 1px solid #990000;
            background: #FFEEEE;
            color: #000;
            text-align: center;
            padding: 15px;
        }
        #footer_note {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: 11px;
            padding: 10px;
            border-top: 1px dotted #ccc;
            text-align: center;
            margin-top: 20px;
        }
        #footer_note a:link, #footer_note a:visited {
            color: #077307;
            text-decoration: none;
        }
        #footer_note a:hover {
            color: #114605;
            text-decoration: none;
        }
        </style>
        </head>
        
        <body>
        <img src="admin/images/logo.gif" alt="Ultimate Regnow Affiliate" /><br /><br />
        <h1>Last step</h1>
        <p class="warning">Please be patient and don't close the window or STOP this page from loading! <br />This may take a while because we're importing a large database now.</p>
        <?
        
        $error 
0;

        if (!
$error && isset($filename)){ 
        
//open the .sql file
          
if ( !$file = @fopen($filename,"rt")){
            echo 
"<p class=\"error\">Cannot open <strong>".$filename."</strong>";
            if( !
file_exists($filename) )
                echo 
"<br /> It seems that the file does not exist! Please check that you've uploaded all the files.";
            echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
            
$error 1;
          }
            
          elseif ( 
fseek($file0SEEK_END)==0) {
            
$filesize ftell($file);
          }

          else{
            echo 
"<p class=\"error\">Cannot get the filesize of ".$filename;
            echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
            
$error 1;
          }
        }
          if (!
$error && isset($_REQUEST["start"]) && isset($_REQUEST["pointer"])){
            echo 
"<p class=\"loading\"><i>Please wait ...</i></p>";

          if (
$_REQUEST["pointer"] > $filesize){
//            If the script ended here, it means that the file pointer is somewhere after the end of file. 
            
$error 1;
            echo 
"<p class=\"error\">The file pointer is out of bounds.";
            echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
          }
        
          if (!
$error && (fseek($file$_REQUEST["pointer"]) != 0) ){
//            If the script ended here, it means that the file pointer could not be set at $_REQUEST["pointer"];
            
$error 1;
            echo 
"<br /><p class=\"error\">The script was killed at this line : <strong>".__LINE__."</strong></p>";
          }
        
          if (!
$error){
            
$query "";
            
$queries 0;
            
$linenumber $_REQUEST["start"];
            
$querylines 0;
            
$inparents false;

            while ((
$linenumber $_REQUEST["start"] + $linesbatch || $query!=""
               && (
$dumpline=fgets($file$linesize)) ){ 

              
$dumpline ereg_replace("\r\n$""\n"$dumpline);
              
$dumpline ereg_replace("\r$""\n"$dumpline);
              
              if ( !
$inparents ){ 
              
                
$skipline false;
                
reset($comment);
                foreach (
$comment as $comment_value)
                { if (!
$inparents && (trim($dumpline)=="" || strpos ($dumpline$comment_value) === 0))
                  { 
$skipline=true;
                    break;
                  }
                }
                if( 
$skipline ){
                  
$linenumber++;
                  continue; 
                }
              }
        
              
$dumpline_deslashed str_replace ("\\\\","",$dumpline);
        
              
$parents substr_count($dumpline_deslashed"'")-substr_count ($dumpline_deslashed"\\'");
              
              if( 
$parents%!= )
                
$inparents=!$inparents;
              
$query .= $dumpline;

              if (!
$inparents)
                
$querylines++;
              
              if ( 
$querylines $querybatch)
              {
//                If the script ended here, it means that the current query includes more than $querybatch dump lines. Possible cause : missing ";" (semicolon) after every dump line.
//                This shouldn't ever happen, but is better to be safe than sorry
                
echo "<br /><p class=\"error\">The script was killed at this line : <strong>".__LINE__."</strong></p>";
                
$error 1;
                break;
              }
        
              if (
ereg(";$",trim($dumpline)) && !$inparents)
              { if(!
mysql_query(trim($query), $connection))
                { 
                  echo 
"<p class=\"error\">There was a problem during the installation process. The reported MySQL error is : <br />";
                  echo 
mysql_error();
                  echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
                  
$error 1;
                  break;
                }
                
$queries++;
                
$query="";
                
$querylines=0;
              }
              
$linenumber++;
            }
          }
        
          if (!
$error){
              
$pointer ftell($file);
            if (!
$pointer){
//            If the script ended here, it means that it cannot read the file pointer offset.        
              
$error 1;
              
$line_of_end __LINE__;
            }
          }
        
          if ( !
$error ){
            if (
$linenumber $_REQUEST["start"]+ $linesbatch){
              echo 
"<span class=\"ok\">Great! Ultimate Regnow Affiliate is now installed.</span><br /><br />";

              echo 
"<p>Now you can <a href=\""._URL."/admin/login.php\" target=\"_blank\">login</a> as admin with <b>username</b> 'admin' and <b>password</b> 'admin'.</p><br />";
              echo 
"<p>We recommend that you go to <i>Admin Area -> Settings -> Edit Admin Details</i> and update your password.</p><br /><br />";
              echo 
"<p class=\"warning\">Also, please make sure you delete the following files : <br />
                    <strong>install.php</strong><br />
                    <strong>"
.$filename."</strong></p>";
              echo 
"</p>";
//              $error = 1;
            
}
            else
            {             
              echo 
"<script language=\"JavaScript\" type=\"text/javascript\">window.setTimeout('location.href=\"install.php?step=2&start=$linenumber&pointer=$pointer\";',500+$sleep);</script>\n";
              echo 
"<noscript>\n";
              echo 
"<p>Click <a href=\"install.php?step=2&start=$linenumber&pointer=$pointer\">continue &raquo;</a> (Please enable JavaScript to do this automatically)</p>\n";
              echo 
"</noscript>\n";
            }
          }
        }
        
        if (
$error) {
            echo 
"<p class=\"error\">There was an error encountered. Please drop the old tables before restarting !<br /><a href=\"install.php\">&laquo; Go back</a></p>";
        
// close both the connection and file;
        
if ($connectionmysql_close();
        if (
$filefclose($file);

        
?>
            <div id="footer_note">
            &copy;Copyright  <?=date('Y')?> <a href="http://www." target="_blank" rel="nofollow">Goldorak _[NUL]</a>.<br />
            </div>
        </body>
        </html>
<?
break;
}
// end switch;
?>
این رو تست بزن

[تصویر: ubuntu2_userbar.gif]
۳ آبان ۱۳۸۷ ۰۲:۳۸ عصر
مشاهده سایت کاربر یافتن تمامی ارسال‌های این کاربر Like Post نقل قول این ارسال در پاسخ
transcend آفلاین
Junior Member
*

ارسال‌ها: 23
Likes Given: 0
Likes Received: 0 in 0 posts
تاریخ عضویت: ۲۰ مهر ۱۳۸۷
ارسال: #3
مشکل در اسکریپت آپلود سنتر
مرتضی جان درست نشد
Parse error: parse error, unexpected $end in C:\Program Files\EasyPHP 2.0b1\www\12\install.php on line 419
میده بازم
این خود اسکریپته
Deposit Files

ممنون
۳ آبان ۱۳۸۷ ۰۶:۱۸ عصر
یافتن تمامی ارسال‌های این کاربر Like Post نقل قول این ارسال در پاسخ
Morteza آفلاین
Posting Freak
*****

ارسال‌ها: 1,370
Likes Given: 12
Likes Received: 25 in 20 posts
تاریخ عضویت: ۶ دی ۱۳۸۶
ارسال: #4
مشکل در اسکریپت آپلود سنتر
کد PHP:
<?php



$step 
$_GET['step'];

if ( empty(
$step) ) {
    
$step 1;
}

switch(
$step){
default:
case 
1:
?>
        <!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>Step 1 of 2 | Installing Ultimate Regnow Affiliate by Goldorak _[NUL]</title>
        <style type="text/css" />
        html {
            background: #ccc;
            padding: 30px;
            margin: 0; 
        }
        body {  
            width: 500px;
            margin: 0 auto;
            text-align: left;
            padding: 20px;
            background: #fff;
            font-family: Arial, Helvetica, sans-serif;
            font-size: 12px;
            line-height: 19px;
        }
        h1 {
            font-family: Georgia, "Times New Roman", Times, serif;
            font-size: 20px;
            line-height: 23px;
            color: #666666;
            border-bottom: 1px solid #CCCCCC;
        }
        .ok {
            color: #339900;
            font-weight: bold;
        }
        .warn {
            color: #0066CC;
            font-weight: bold;
        }
        .error {
            color: #FF0000;
            font-weight: bold;
        }
        .warning {
            border: 1px solid #990000;
            background: #FFEEEE;
            color: #000;
            text-align: center;
            padding: 15px;
        }
        #footer_note {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: 11px;
            padding: 10px;
            border-top: 1px dotted #ccc;
            text-align: center;
            margin-top: 20px;
        }
        #footer_note a:link, #footer_note a:visited {
            color: #077307;
            text-decoration: none;
        }
        #footer_note a:hover {
            color: #114605;
            text-decoration: none;
        }
        .button {
            color: #fff;
            background: #003399;
            border: 1px solid #000000;
            padding: 3px;
            text-decoration: none;
        }
        </style>
        </head>
        
        <body>
        <img src="admin/images/logo.gif" alt="Ultimate Regnow Affiliate" /><br /><br />
        <h1>First step</h1>
<?
        $error 
0;
        echo 
"<p>Checking if <strong>config.php</strong> exists ... ";
        if( !
file_exists('config.php')) { 
            
$error 1;
            echo 
"<span class=\"error\">ERROR : The required file is not found.</span>";
        }
        else echo 
"<span class=\"ok\">[OK]</span>";
        echo 
"</p>";
        @require_once(
'config.php');
        @require_once(
'include/functions.php');
        
        echo 
"<p>Checking the database connection ... ";
        
$connection = @mysql_connect($db_host$db_user$db_pass);
        if( !
$connection )  {
            
$error 1;
            echo 
"<span class=\"error\">ERROR : ".mysql_error()."</span>";
            }
            else echo 
"<span class=\"ok\">[OK]</span>";
            echo 
"</p>";
        
        echo 
"<p>Checking for existing database ... ";
        
$db = @mysql_select_db($db_name);
        if( !
$db ) {
            echo 
"<span class=\"error\">ERROR : ".mysql_error()."</span>";
            
$error 1;
        }
        else echo 
"<span class=\"ok\">[OK]</span>";
        echo 
"</p>";
/*        
        echo "<p>Changing chmod permission for the \"admin/temp.txt\" to 0777 ... ";
            if( !@chmod('admin/temp.txt', 0777) ) {
                $error = 1;
                echo "<span class=\"error\">Couldn't CHMOD. Please do it manually.</span>";
            }
            else echo "<span class=\"ok\">[OK]</span>";
            echo "</p>";
        echo "<p>Changing chmod permission for the \"cache\" directory to 0777 ... ";
            if( !@chmod('cache', 0777) ) {
                $error = 1;
                echo "<span class=\"error\">Couldn't CHMOD. Please do it manually.</span>";
            }
            else echo "<span class=\"ok\">[OK]</span>";
            echo "</p>";
*/
            
echo "<p class=\"warn\">It's crucial that you don't forget to setup the access rights with CHMOD 777 for the following:</p>
                  - <b>/admin/temp.txt</b><br />
                  - <b>/cache</b>"
;    
        
            
$sql "SELECT id FROM ura_settings WHERE id = '0'";
            
$result = @mysql_query($sql);
            
        if( 
$result ) {    
            
$error 1;
            echo 
"<p class=\"warning\">It seems that Ultimate Regnow Affiliate is already installed!<br />To reinstall it, please empty the database first (by dropping the existing tables) !</p>";
        }
            
        if( !
$error ){
            echo 
"<p class=\"ok\">Everything seems to be fine. Let's create the database tables and fill them up.</p><br />";
            echo 
"<a href=\"install.php?step=2&start=1&pointer=0\" class=\"button\"><strong>Continue &raquo;</strong></a>";
        }
        else {
            echo 
"<center><p><a href=\"install.php\" class=\"button\"><strong>Retry</strong></a></p></center>";
        
        }
?>
    <div id="footer_note">
    Copyright 2007 Goldorak _[NUL]<a href="http://www." target="_blank" rel="nofollow">Goldorak _[NUL]</a>.<br />
    </div>
    </body>
    </html>
<?
break;

//Step 2 - start importing the database;
case 2:
        include(
'config.php');
        include(
'include/functions.php');

        function 
get_percentage($full$part){
            
$percent ceil(($part 100)/$full);
            return 
$percent;
        }

        
$connection db_connect();
        
header("Expires: Mon, 1 Jan 1999 01:01:01 GMT");
        
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");
        
header("Cache-Control: no-store, no-cache, must-revalidate");
        
header("Cache-Control: post-check=0, pre-check=0"false);
        
header("Pragma: no-cache");

        
ini_set("auto_detect_line_endings"true);
    
        
$filename      =    "ura_database.sql";
        
$linesize      =    65536;
        
$querybatch     =    300;
        
$linesbatch  =     2000;
        
$sleep          =     2000;

        
        
$comment[0]="#";
        
$comment[1]="-- ";
        
        
?>
        <!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>Step 2 of 2 | Installing Ultimate Regnow Affiliate by Goldorak _[NUL]</title>
        <style type="text/css" />
        html {
            background: #ccc;
            padding: 30px;
            margin: 0; 
        }
        body {  
            width: 500px;
            margin: 0 auto;
            text-align: left;
            padding: 20px;
            background: #fff;
            font-family: Arial, Helvetica, sans-serif;
            font-size: 12px;
            line-height: 19px;
        }
        h1 {
            font-family: Georgia, "Times New Roman", Times, serif;
            font-size: 20px;
            line-height: 23px;
            color: #666666;
            border-bottom: 1px solid #CCCCCC;
        }
        .ok {
            color: #339900;
            font-weight: bold;
        }
        .error {
            color: #FF0000;
            font-weight: bold;
        }
        .loading {
            font-size: 14px;
            color: #990000;
            text-align: center;
        }
        .warning {
            border: 1px solid #990000;
            background: #FFEEEE;
            color: #000;
            text-align: center;
            padding: 15px;
        }
        #footer_note {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: 11px;
            padding: 10px;
            border-top: 1px dotted #ccc;
            text-align: center;
            margin-top: 20px;
        }
        #footer_note a:link, #footer_note a:visited {
            color: #077307;
            text-decoration: none;
        }
        #footer_note a:hover {
            color: #114605;
            text-decoration: none;
        }
        </style>
        </head>
        
        <body>
        <img src="admin/images/logo.gif" alt="Ultimate Regnow Affiliate" /><br /><br />
        <h1>Last step</h1>
        <p class="warning">Please be patient and don't close the window or STOP this page from loading! <br />This may take a while because we're importing a large database now.</p>
        <?
        
        $error 
0;

        if (!
$error && isset($filename)){ 
        
//open the .sql file
          
if ( !$file = @fopen($filename,"rt")){
            echo 
"<p class=\"error\">Cannot open <strong>".$filename."</strong>";
            if( !
file_exists($filename) )
                echo 
"<br /> It seems that the file does not exist! Please check that you've uploaded all the files.";
            echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
            
$error 1;
          }
            
          elseif ( 
fseek($file0SEEK_END)==0) {
            
$filesize ftell($file);
          }

          else{
            echo 
"<p class=\"error\">Cannot get the filesize of ".$filename;
            echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
            
$error 1;
          }
        }
          if (!
$error && isset($_REQUEST["start"]) && isset($_REQUEST["pointer"])){
            echo 
"<p class=\"loading\"><i>Please wait ...</i></p>";

          if (
$_REQUEST["pointer"] > $filesize){
//            If the script ended here, it means that the file pointer is somewhere after the end of file. 
            
$error 1;
            echo 
"<p class=\"error\">The file pointer is out of bounds.";
            echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
          }
        
          if (!
$error && (fseek($file$_REQUEST["pointer"]) != 0) ){
//            If the script ended here, it means that the file pointer could not be set at $_REQUEST["pointer"];
            
$error 1;
            echo 
"<br /><p class=\"error\">The script was killed at this line : <strong>".__LINE__."</strong></p>";
          }
        
          if (!
$error){
            
$query "";
            
$queries 0;
            
$linenumber $_REQUEST["start"];
            
$querylines 0;
            
$inparents false;

            while ((
$linenumber $_REQUEST["start"] + $linesbatch || $query!=""
               && (
$dumpline=fgets($file$linesize)) ){ 

              
$dumpline ereg_replace("\r\n$""\n"$dumpline);
              
$dumpline ereg_replace("\r$""\n"$dumpline);
              
              if ( !
$inparents ){ 
              
                
$skipline false;
                
reset($comment);
                foreach (
$comment as $comment_value)
                { if (!
$inparents && (trim($dumpline)=="" || strpos ($dumpline$comment_value) === 0))
                  { 
$skipline=true;
                    break;
                  }
                }
                if( 
$skipline ){
                  
$linenumber++;
                  continue; 
                }
              }
        
              
$dumpline_deslashed str_replace ("\\\\","",$dumpline);
        
              
$parents substr_count($dumpline_deslashed"'")-substr_count ($dumpline_deslashed"\\'");
              
              if( 
$parents%!= )
                
$inparents=!$inparents;
              
$query .= $dumpline;

              if (!
$inparents)
                
$querylines++;
              
              if ( 
$querylines $querybatch)
              {
//                If the script ended here, it means that the current query includes more than $querybatch dump lines. Possible cause : missing ";" (semicolon) after every dump line.
//                This shouldn't ever happen, but is better to be safe than sorry
                
echo "<br /><p class=\"error\">The script was killed at this line : <strong>".__LINE__."</strong></p>";
                
$error 1;
                break;
              }
        
              if (
ereg(";$",trim($dumpline)) && !$inparents)
              { if(!
mysql_query(trim($query), $connection))
                { 
                  echo 
"<p class=\"error\">There was a problem during the installation process. The reported MySQL error is : <br />";
                  echo 
mysql_error();
                  echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
                  
$error 1;
                  break;
                }
                
$queries++;
                
$query="";
                
$querylines=0;
              }
              
$linenumber++;
            }
          }
        
          if (!
$error){
              
$pointer ftell($file);
            if (!
$pointer){
//            If the script ended here, it means that it cannot read the file pointer offset.        
              
$error 1;
              
$line_of_end __LINE__;
            }
          }
        
          if ( !
$error ){
            if (
$linenumber $_REQUEST["start"]+ $linesbatch){
              echo 
"<span class=\"ok\">Great! Ultimate Regnow Affiliate is now installed.</span><br /><br />";

              echo 
"<p>Now you can <a href=\""._URL."/admin/login.php\" target=\"_blank\">login</a> as admin with <b>username</b> 'admin' and <b>password</b> 'admin'.</p><br />";
              echo 
"<p>We recommend that you go to <i>Admin Area -> Settings -> Edit Admin Details</i> and update your password.</p><br /><br />";
              echo 
"<p class=\"warning\">Also, please make sure you delete the following files : <br />
                    <strong>install.php</strong><br />
                    <strong>"
.$filename."</strong></p>";
              echo 
"</p>";
//              $error = 1;
            
}
            else
            {             
              echo 
"<script language=\"JavaScript\" type=\"text/javascript\">window.setTimeout('location.href=\"install.php?step=2&start=$linenumber&pointer=$pointer\";',500+$sleep);</script>\n";
              echo 
"<noscript>\n";
              echo 
"<p>Click <a href=\"install.php?step=2&start=$linenumber&pointer=$pointer\">continue &raquo;</a> (Please enable JavaScript to do this automatically)</p>\n";
              echo 
"</noscript>\n";
            }
          }
        }
        
        if (
$error) {
            echo 
"<p class=\"error\">There was an error encountered. Please drop the old tables before restarting !<br /><a href=\"install.php\">&laquo; Go back</a></p>";
        
// close both the connection and file;
        
if ($connectionmysql_close();
        if (
$filefclose($file);

        
?>
            <div id="footer_note">
            &copy;Copyright  <?=date('Y');?> <a href="http://www." target="_blank" rel="nofollow">Goldorak _[NUL]</a>.<br />
            </div>
        </body>
        </html>
<?
break;
}
// end switch;
?>
حالا چی ؟

[تصویر: ubuntu2_userbar.gif]
۳ آبان ۱۳۸۷ ۰۶:۳۹ عصر
مشاهده سایت کاربر یافتن تمامی ارسال‌های این کاربر Like Post نقل قول این ارسال در پاسخ
parazitt آفلاین
Senior Member
****

ارسال‌ها: 296
Likes Given: 0
Likes Received: 0 in 0 posts
تاریخ عضویت: ۲۱ تیر ۱۳۸۷
ارسال: #5
مشکل در اسکریپت آپلود سنتر
من به مرتضی گفتم ولی مثل اینکه به شما نگفته:
روی لوکال هاست بعضی از توابع سروری اجرا نمی شوند که اسکریپت های آپلود جز این توابع هستند
حتما باید روی سرور تست کنی اگه عمل نکرد دوباره بپرس.

(آخرین تغییر در این ارسال: ۳ آبان ۱۳۸۷ ۱۰:۵۹ عصر توسط yasin308.)
۳ آبان ۱۳۸۷ ۰۶:۴۴ عصر
مشاهده سایت کاربر یافتن تمامی ارسال‌های این کاربر Like Post نقل قول این ارسال در پاسخ
Saleh آفلاین
صالح
MT LEGEND

ارسال‌ها: 2,228
Likes Given: 1
Likes Received: 1 in 1 posts
تاریخ عضویت: ۱۱ دی ۱۳۴۸
ارسال: #6
مشکل در اسکریپت آپلود سنتر
کد PHP:
<?php



$step 
$_GET['step'];

if ( empty(
$step) ) {
    
$step 1;
}

switch(
$step){
default:
case 
1:
?>
        <!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>Step 1 of 2 | Installing Ultimate Regnow Affiliate by Goldorak _[NUL]</title>
        <style type="text/css" />
        html {
            background: #ccc;
            padding: 30px;
            margin: 0; 
        }
        body {  
            width: 500px;
            margin: 0 auto;
            text-align: left;
            padding: 20px;
            background: #fff;
            font-family: Arial, Helvetica, sans-serif;
            font-size: 12px;
            line-height: 19px;
        }
        h1 {
            font-family: Georgia, "Times New Roman", Times, serif;
            font-size: 20px;
            line-height: 23px;
            color: #666666;
            border-bottom: 1px solid #CCCCCC;
        }
        .ok {
            color: #339900;
            font-weight: bold;
        }
        .warn {
            color: #0066CC;
            font-weight: bold;
        }
        .error {
            color: #FF0000;
            font-weight: bold;
        }
        .warning {
            border: 1px solid #990000;
            background: #FFEEEE;
            color: #000;
            text-align: center;
            padding: 15px;
        }
        #footer_note {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: 11px;
            padding: 10px;
            border-top: 1px dotted #ccc;
            text-align: center;
            margin-top: 20px;
        }
        #footer_note a:link, #footer_note a:visited {
            color: #077307;
            text-decoration: none;
        }
        #footer_note a:hover {
            color: #114605;
            text-decoration: none;
        }
        .button {
            color: #fff;
            background: #003399;
            border: 1px solid #000000;
            padding: 3px;
            text-decoration: none;
        }
        </style>
        </head>
        
        <body>
        <img src="admin/images/logo.gif" alt="Ultimate Regnow Affiliate" /><br /><br />
        <h1>First step</h1>
<?
        $error 
0;
        echo 
"<p>Checking if <strong>config.php</strong> exists ... ";
        if( !
file_exists('config.php')) { 
            
$error 1;
            echo 
"<span class=\"error\">ERROR : The required file is not found.</span>";
        }
        else echo 
"<span class=\"ok\">[OK]</span>";
        echo 
"</p>";
        @require_once(
'config.php');
        @require_once(
'include/functions.php');
        
        echo 
"<p>Checking the database connection ... ";
        
$connection = @mysql_connect($db_host$db_user$db_pass);
        if( !
$connection )  {
            
$error 1;
            echo 
"<span class=\"error\">ERROR : ".mysql_error()."</span>";
            }
            else echo 
"<span class=\"ok\">[OK]</span>";
            echo 
"</p>";
        
        echo 
"<p>Checking for existing database ... ";
        
$db = @mysql_select_db($db_name);
        if( !
$db ) {
            echo 
"<span class=\"error\">ERROR : ".mysql_error()."</span>";
            
$error 1;
        }
        else echo 
"<span class=\"ok\">[OK]</span>";
        echo 
"</p>";
/*        
        echo "<p>Changing chmod permission for the \"admin/temp.txt\" to 0777 ... ";
            if( !@chmod('admin/temp.txt', 0777) ) {
                $error = 1;
                echo "<span class=\"error\">Couldn't CHMOD. Please do it manually.</span>";
            }
            else echo "<span class=\"ok\">[OK]</span>";
            echo "</p>";
        echo "<p>Changing chmod permission for the \"cache\" directory to 0777 ... ";
            if( !@chmod('cache', 0777) ) {
                $error = 1;
                echo "<span class=\"error\">Couldn't CHMOD. Please do it manually.</span>";
            }
            else echo "<span class=\"ok\">[OK]</span>";
            echo "</p>";
*/
            
echo "<p class=\"warn\">It's crucial that you don't forget to setup the access rights with CHMOD 777 for the following:</p>
                  - <b>/admin/temp.txt</b><br />
                  - <b>/cache</b>"
;    
        
            
$sql "SELECT id FROM ura_settings WHERE id = '0'";
            
$result = @mysql_query($sql);
            
        if( 
$result ) {    
            
$error 1;
            echo 
"<p class=\"warning\">It seems that Ultimate Regnow Affiliate is already installed!<br />To reinstall it, please empty the database first (by dropping the existing tables) !</p>";
        }
            
        if( !
$error ){
            echo 
"<p class=\"ok\">Everything seems to be fine. Let's create the database tables and fill them up.</p><br />";
            echo 
"<a href=\"install.php?step=2&start=1&pointer=0\" class=\"button\"><strong>Continue &raquo;</strong></a>";
        }
        else {
            echo 
"<center><p><a href=\"install.php\" class=\"button\"><strong>Retry</strong></a></p></center>";
        
        }
?>
    <div id="footer_note">
    Copyright 2007 Goldorak _[NUL]<a href="http://www." target="_blank" rel="nofollow">Goldorak _[NUL]</a>.<br />
    </div>
    </body>
    </html>
<?
break;

//Step 2 - start importing the database;
case 2:
        include(
'config.php');
        include(
'include/functions.php');

        function 
get_percentage($full$part){
            
$percent ceil(($part 100)/$full);
            return 
$percent;
        }

        
$connection db_connect();
        
header("Expires: Mon, 1 Jan 1999 01:01:01 GMT");
        
header("Last-Modified: " gmdate("D, d M Y H:i:s") . " GMT");
        
header("Cache-Control: no-store, no-cache, must-revalidate");
        
header("Cache-Control: post-check=0, pre-check=0"false);
        
header("Pragma: no-cache");

        
ini_set("auto_detect_line_endings"true);
    
        
$filename      =    "ura_database.sql";
        
$linesize      =    65536;
        
$querybatch     =    300;
        
$linesbatch  =     2000;
        
$sleep          =     2000;

        
        
$comment[0]="#";
        
$comment[1]="-- ";
        
        
?>
        <!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>Step 2 of 2 | Installing Ultimate Regnow Affiliate by Goldorak _[NUL]</title>
        <style type="text/css" />
        html {
            background: #ccc;
            padding: 30px;
            margin: 0; 
        }
        body {  
            width: 500px;
            margin: 0 auto;
            text-align: left;
            padding: 20px;
            background: #fff;
            font-family: Arial, Helvetica, sans-serif;
            font-size: 12px;
            line-height: 19px;
        }
        h1 {
            font-family: Georgia, "Times New Roman", Times, serif;
            font-size: 20px;
            line-height: 23px;
            color: #666666;
            border-bottom: 1px solid #CCCCCC;
        }
        .ok {
            color: #339900;
            font-weight: bold;
        }
        .error {
            color: #FF0000;
            font-weight: bold;
        }
        .loading {
            font-size: 14px;
            color: #990000;
            text-align: center;
        }
        .warning {
            border: 1px solid #990000;
            background: #FFEEEE;
            color: #000;
            text-align: center;
            padding: 15px;
        }
        #footer_note {
            font-family: Verdana, Arial, Helvetica, sans-serif;
            font-size: 11px;
            padding: 10px;
            border-top: 1px dotted #ccc;
            text-align: center;
            margin-top: 20px;
        }
        #footer_note a:link, #footer_note a:visited {
            color: #077307;
            text-decoration: none;
        }
        #footer_note a:hover {
            color: #114605;
            text-decoration: none;
        }
        </style>
        </head>
        
        <body>
        <img src="admin/images/logo.gif" alt="Ultimate Regnow Affiliate" /><br /><br />
        <h1>Last step</h1>
        <p class="warning">Please be patient and don't close the window or STOP this page from loading! <br />This may take a while because we're importing a large database now.</p>
        <?
        
        $error 
0;

        if (!
$error && isset($filename)){ 
        
//open the .sql file
          
if ( !$file = @fopen($filename,"rt")){
            echo 
"<p class=\"error\">Cannot open <strong>".$filename."</strong>";
            if( !
file_exists($filename) )
                echo 
"<br /> It seems that the file does not exist! Please check that you've uploaded all the files.";
            echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
            
$error 1;
          }
            
          elseif ( 
fseek($file0SEEK_END)==0) {
            
$filesize ftell($file);
          }

          else{
            echo 
"<p class=\"error\">Cannot get the filesize of ".$filename;
            echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
            
$error 1;
          }
        }
          if (!
$error && isset($_REQUEST["start"]) && isset($_REQUEST["pointer"])){
            echo 
"<p class=\"loading\"><i>Please wait ...</i></p>";

          if (
$_REQUEST["pointer"] > $filesize){
//            If the script ended here, it means that the file pointer is somewhere after the end of file. 
            
$error 1;
            echo 
"<p class=\"error\">The file pointer is out of bounds.";
            echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
          }
        
          if (!
$error && (fseek($file$_REQUEST["pointer"]) != 0) ){
//            If the script ended here, it means that the file pointer could not be set at $_REQUEST["pointer"];
            
$error 1;
            echo 
"<br /><p class=\"error\">The script was killed at this line : <strong>".__LINE__."</strong></p>";
          }
        
          if (!
$error){
            
$query "";
            
$queries 0;
            
$linenumber $_REQUEST["start"];
            
$querylines 0;
            
$inparents false;

            while ((
$linenumber $_REQUEST["start"] + $linesbatch || $query!=""
               && (
$dumpline=fgets($file$linesize)) ){ 

              
$dumpline ereg_replace("\r\n$""\n"$dumpline);
              
$dumpline ereg_replace("\r$""\n"$dumpline);
              
              if ( !
$inparents ){ 
              
                
$skipline false;
                
reset($comment);
                foreach (
$comment as $comment_value)
                { if (!
$inparents && (trim($dumpline)=="" || strpos ($dumpline$comment_value) === 0))
                  { 
$skipline=true;
                    break;
                  }
                }
                if( 
$skipline ){
                  
$linenumber++;
                  continue; 
                }
              }
        
              
$dumpline_deslashed str_replace ("\\\\","",$dumpline);
        
              
$parents substr_count($dumpline_deslashed"'")-substr_count ($dumpline_deslashed"\\'");
              
              if( 
$parents%!= )
                
$inparents=!$inparents;
              
$query .= $dumpline;

              if (!
$inparents)
                
$querylines++;
              
              if ( 
$querylines $querybatch)
              {
//                If the script ended here, it means that the current query includes more than $querybatch dump lines. Possible cause : missing ";" (semicolon) after every dump line.
//                This shouldn't ever happen, but is better to be safe than sorry
                
echo "<br /><p class=\"error\">The script was killed at this line : <strong>".__LINE__."</strong></p>";
                
$error 1;
                break;
              }
        
              if (
ereg(";$",trim($dumpline)) && !$inparents)
              { if(!
mysql_query(trim($query), $connection))
                { 
                  echo 
"<p class=\"error\">There was a problem during the installation process. The reported MySQL error is : <br />";
                  echo 
mysql_error();
                  echo 
"<br />The script was killed at this line : <strong>".__LINE__."</strong></p>";
                  
$error 1;
                  break;
                }
                
$queries++;
                
$query="";
                
$querylines=0;
              }
              
$linenumber++;
            }
          }
        
          if (!
$error){
              
$pointer ftell($file);
            if (!
$pointer){
//            If the script ended here, it means that it cannot read the file pointer offset.        
              
$error 1;
              
$line_of_end __LINE__;
            }
          }
        
          if ( !
$error ){
            if (
$linenumber $_REQUEST["start"]+ $linesbatch){
              echo 
"<span class=\"ok\">Great! Ultimate Regnow Affiliate is now installed.</span><br /><br />";

              echo 
"<p>Now you can <a href=\""._URL."/admin/login.php\" target=\"_blank\">login</a> as admin with <b>username</b> 'admin' and <b>password</b> 'admin'.</p><br />";
              echo 
"<p>We recommend that you go to <i>Admin Area -> Settings -> Edit Admin Details</i> and update your password.</p><br /><br />";
              echo 
"<p class=\"warning\">Also, please make sure you delete the following files : <br />
                    <strong>install.php</strong><br />
                    <strong>"
.$filename."</strong></p>";
              echo 
"</p>";
//              $error = 1;
            
}
            else
            {             
              echo 
"<script language=\"JavaScript\" type=\"text/javascript\">window.setTimeout('location.href=\"install.php?step=2&start=$linenumber&pointer=$pointer\";',500+$sleep);</script>\n";
              echo 
"<noscript>\n";
              echo 
"<p>Click <a href=\"install.php?step=2&start=$linenumber&pointer=$pointer\">continue &raquo;</a> (Please enable JavaScript to do this automatically)</p>\n";
              echo 
"</noscript>\n";
            }
          }
        }
        
        if (
$error) {
            echo 
"<p class=\"error\">There was an error encountered. Please drop the old tables before restarting !<br /><a href=\"install.php\">&laquo; Go back</a></p>";
        
// close both the connection and file;
        
if ($connectionmysql_close();
        if (
$filefclose($file);

        
?>
            <div id="footer_note">
            &copy;Copyright  <?=date('Y');?> <a href="http://www." target="_blank" rel="nofollow">Goldorak _[NUL]</a>.<br />
            </div>
        </body>
        </html>
<?
break;
}
}
// end switch;
?>

۳ آبان ۱۳۸۷ ۰۸:۲۰ عصر
مشاهده سایت کاربر یافتن تمامی ارسال‌های این کاربر Like Post نقل قول این ارسال در پاسخ
Morteza آفلاین
Posting Freak
*****

ارسال‌ها: 1,370
Likes Given: 12
Likes Received: 25 in 20 posts
تاریخ عضویت: ۶ دی ۱۳۸۶
ارسال: #7
مشکل در اسکریپت آپلود سنتر
هر کی جرات داره رو حرف صالح حرف بزنه :دی
یه این اسکریپت یه سری اشکالاتی داشت که صالح هم اون ها رو اصلاح کرده
یه سری ; و } و کارکتر های مختلف رو طرف جا انداخته !

[تصویر: ubuntu2_userbar.gif]
۳ آبان ۱۳۸۷ ۰۸:۲۲ عصر
مشاهده سایت کاربر یافتن تمامی ارسال‌های این کاربر Like Post نقل قول این ارسال در پاسخ
Saleh آفلاین
صالح
MT LEGEND

ارسال‌ها: 2,228
Likes Given: 1
Likes Received: 1 in 1 posts
تاریخ عضویت: ۱۱ دی ۱۳۴۸
ارسال: #8
مشکل در اسکریپت آپلود سنتر
بیخیال بابا ولی کثیف ترین کدنویسی بود که دیده بودم.

۴ آبان ۱۳۸۷ ۱۲:۵۹ صبح
مشاهده سایت کاربر یافتن تمامی ارسال‌های این کاربر Like Post نقل قول این ارسال در پاسخ
A R A S H آفلاین
آرش کمانگیر
*****

ارسال‌ها: 1,741
Likes Given: 16
Likes Received: 26 in 19 posts
تاریخ عضویت: ۲۳ آذر ۱۳۸۶
ارسال: #9
مشکل در اسکریپت آپلود سنتر
شايد جاش نباشه اما من يه اسكريپت آپلود سنتر رايگان ميخوام كه بشه انواع فرمت ها رو روش آپلود كرد.
البته انگليسي باشه.

۴ آبان ۱۳۸۷ ۱۱:۰۳ عصر
مشاهده سایت کاربر یافتن تمامی ارسال‌های این کاربر Like Post نقل قول این ارسال در پاسخ
a.elyasi آفلاین
Super Moderator
******

ارسال‌ها: 1,555
Likes Given: 14
Likes Received: 19 in 8 posts
تاریخ عضویت: ۱۸ اسفند ۱۳۸۵
ارسال: #10
مشکل در اسکریپت آپلود سنتر
A R A S H نوشته شده:شايد جاش نباشه اما من يه اسكريپت آپلود سنتر رايگان ميخوام كه بشه انواع فرمت ها رو روش آپلود كرد.
البته انگليسي باشه.
تویه هات اسکریپت سرچ کن نزدیک به n تا واست میاره!

سکوتم از رضایت نیست دلم اهل شکایت نیست ...
۵ آبان ۱۳۸۷ ۰۱:۲۹ صبح
یافتن تمامی ارسال‌های این کاربر Like Post نقل قول این ارسال در پاسخ
ارسال موضوع  ارسال پاسخ 


پرش در انجمن: