Gallery Uploader Error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Gallery Uploader Error

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
    include("config.php");
    include("core.php");
    connectdb();
    echo &#39;<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html"/>
    <meta http-equiv="Cache-Control" content="no-cache" forua="true"/>&#39;;
    $bcon = connectdb();
    if (!$bcon)
    {
    echo &#39;<title>ERROR</title></head>
    <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080">&#39;;
    echo "<img src=\"images/exit.gif\" alt=\"*\"/>
    ";
    echo "ERROR! cannot connect to database

    ";
    echo "This error happens usually when backing up the database, please be patient, The site will be up any minute

    ";
    echo "you can temperoray be in this site <a href=\"http://chatheaven.wen.ru\">$site_name</a> while $site_name is offline
    ";
    echo "THANK YOU VERY MUCH";
    echo "</p>";
    echo "</html>";
    echo "</body>";
    exit();
    }
    $brws = explode(" ",$_SERVER[HTTP_USER_AGENT] );
    $ubr = $brws[0];
    $uip = getip();
    $action = $_GET["action"];
    $sid = $_GET["sid"];
    $page = $_GET["page"];
    $who = $_GET["who"];


    $uid = getuid_sid($sid);

    cleardata();

    if(isipbanned($uip,$ubr))
    {
    if(!isshield(getuid_sid($sid)))
    {
    echo &#39;<title>IP Banned</title></head>
    <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080">&#39;;
    echo "<img src=\"images/notok.gif\" alt=\"x\"/>
    ";
    echo "This IP address is blocked
    ";
    echo "
    ";
    echo "How ever we grant a shield against IP-Ban for our great users, you can try to see if you are shielded by trying to log-in, if you kept coming to this page that means you are not shielded, so come back when the ip-ban period is over

    ";
    $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE penalty=&#39;2&#39; AND ipadd=&#39;".$uip."&#39; AND browserm=&#39;".$ubr."&#39; LIMIT 1 "));
    //echo mysql_error();
    $remain = $banto[0] - time();
    $rmsg = gettimemsg($remain);
    echo " IP: $rmsg

    ";

    echo "</p>";
    echo "</body>";
    echo "</html>";
    exit();
    }
    }
    if(($action != "") && ($action!="terms"))
    {
    $uid = getuid_sid($sid);
    if((islogged($sid)==false)||($uid==0))
    {
    echo &#39;<title>Uploader</title></head>
    <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080">&#39;;
    echo "<p align=\"center\">";
    echo "You are not logged in
    ";
    echo "Or Your session has been expired

    ";
    echo "<a href=\"index.php\">Login</a>

    ";
    echo "</p>";
    echo "</body>";
    echo "</html>";
    exit();
    }



    }
    //echo isbanned($uid);
    if(isbanned($uid))
    {
    echo &#39;<title>Banned</title></head>
    <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080">&#39;;
    echo "<p align=\"center\">";
    echo "<img src=\"images/notok.gif\" alt=\"x\"/>
    ";
    echo "You are Banned
    ";
    $banto = mysql_fetch_array(mysql_query("SELECT timeto FROM ibwf_penalties WHERE uid=&#39;".$uid."&#39; AND penalty=&#39;1&#39;"));
    $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));

    $remain = $banto[0]- time();
    $rmsg = gettimemsg($remain);
    echo "Time to finish your penalty: $rmsg

    ";
    echo "Ban Reason: $banres[0]";
    //echo "<a href=\"index.php\">Login</a>";
    echo "</p>";
    echo "</body>";
    echo "</html>";
    exit();
    }

    $res = mysql_query("UPDATE ibwf_users SET browserm=&#39;".$ubr."&#39;, ipadd=&#39;".$uip."&#39; WHERE id=&#39;".getuid_sid($sid)."&#39;");
    echo &#39;<title>Uploader</title></head>
    <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080">
    &#39;;

    $nick = getnick_sid($sid);
    echo "Welcome $nick
    ";
    //get file name
    if ($upload="upload"&&$file_name){
    if (!eregi("\.(jpeg|jpg)$",$file_name)){
    print "Unsuported File extention!!!";
    }else{
    $superdat_name = preg_replace(
    &#39;/[^a-zA-Z0-9\.\$\%\&#39;\`\-\@\{\}\~\!\#\(\)\&\_\^]/&#39;
    ,&#39;&#39;,str_replace(array(&#39; &#39;,&#39;%20&#39;),array(&#39;_&#39;,&#39;_&#39; ),$file_name));
    if(strlen($file_name)>53){ print "File Name to long!!!";
    }else{
    if (empty($file)) {
    print "No input file specified!!!";
    }else{
    $pics = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM gallery where uid=&#39;".$uid."&#39;"));
    $cpic = $pics[0]+1;
    $rev = strrev ($file_name);
    $exp = explode (".", $rev);
    $true = strrev ($exp[0]);
    $trueext = strtolower ($true);
    $picn = $nick$cpic.$trueext;
    //rename and copy file name
    copy("$superdat", "gallery/$picn") or
    die("Couldn&#39;t copy file.");

    //add new file name to database
    $adds=mysql_query("INSERT INTO gallery SET file=&#39;".$picn."&#39;,uid=&#39;".$uid."&#39;");
    if ($adds) {

    echo "pic added $picn
    ";

    } else {

    echo "Please try again
    ";
    }

    echo "file has been successfully uploaded";
    }
    }
    }
    }
    ?>
    <form align="left" action="upload.php&amp;sid=$sid" method="post" ENCTYPE="multipart/form-data">
    File:
    <input type="file" name="file" size="30"/>

    <input type="submit" value="Upload!"/>

    Home

    Script by:<font color="red">Tommie©</font>
    </form>
    </body>
    </html></div>
    I cant find the error on this page can some one pls help me to fix it because I want users to uploud the own pics
    it gives me this error
    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>Parse error: syntax error, unexpected T_VARIABLE in /home/chath/public_html/upload.php on line 127</div>
    I dont know wicth line to look in.

    #2
    can u saw me a demo bro??? then i can help u where d error is
    get cheap web hosting ever AdzeHost
    ===================
    get free hosting for life time hostwebswap not allowed
    ===================
    get free cpanel web hosting free cpanel hostingwap are allowed
    ===================

    ===================

    Comment


      #3
      can u show me a demo bro??? then i can help u where d error is
      get cheap web hosting ever AdzeHost
      ===================
      get free hosting for life time hostwebswap not allowed
      ===================
      get free cpanel web hosting free cpanel hostingwap are allowed
      ===================

      ===================

      Comment


        #4
        dont worry I will use PHP DESIGNER it counts the lines so I can find the error that way.

        Comment


          #5
          it line 128 I changed it form <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$picn = $nick$cpic.$trueext;</div> to<div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>$picn = "$nick$cpic.$trueext";</div> now it works

          Comment


            #6
            all error and bugs are fixed thanks 2 PHP DESIGNER I found the errors really fast and fixed them my gallery script is up and running now users can upload there own pics.

            Comment

            Working...
            X