Admin Request (help)

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

    Admin Request (help)

    help me with this script... it says Parse error, unexpected T_ELSE in /home/www/mysite.com/wap/adminrequest.php on line 77... how can i fix this? hope you guys help me! thankx!!!

    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>////////////////////////////////////////MAIN PAGE
    else if($action=="adminreq")
    {
    addonline(getuid_sid($sid),"Sending admin request","");
    echo "<card id=\"main\" title=\"admin request\">";
    echo "<p align=\"center\">";
    $req = mysql_fetch_array(mysql_query("SELECT req,perm FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
    if($req[0]=="0" && $req[1]=="0")
    {
    echo "If you are interested to be an admin
    ";
    echo "Note,you can sent admin request for only one time!
    ";
    echo "<a href=\"index.php?action=adminreqpro&amp;sid=$sid\" >send admin request</a>";

    }
    else if ($req[0]=="0" && $req[1]>1)
    {
    echo "Sorry!you are an admin already!";
    }

    else
    {
    echo "Sorry!You sent admin request to the owner before!";
    }
    echo "

    <a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
    echo "</p>";
    echo "</card>";

    }

    else if($action=="adminreqpro")
    {
    addonline(getuid_sid($sid),"Sending admin request","");
    echo "<card id=\"main\" title=\"admin request\">";
    echo "<p align=\"center\">";

    $msg = "Hello Owner![br/]".getnick_uid($uid)." has sent you a request to be admin ";
    $req = mysql_query("INSERT INTO ibwf_private SET text=&#39;".$msg."&#39;, byuid=&#39;".$uid."&#39;, touid=&#39;1&#39;, unread=&#39;1&#39;, timesent=&#39;".time()."&#39;");
    $req .= mysql_query("UPDATE ibwf_users SET req=&#39;1&#39; WHERE id =&#39;".$uid."&#39;");
    if($req)
    {
    echo "your admin requst has been sent successfully to the site owner.";

    }
    else
    {
    echo "unknown mysql error!";
    }
    echo "

    <a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
    echo "</p>";
    echo "</card>";

    }
    ?>
    </wml></div>

    #2
    guys here&#39;s the here script for that please help me fix this... it says Parse error, unexpected T_ELSE in /home/www/mysite.com/wap/adminrequest.php on line 77... how can i fix this? hope you guys help me! thankx!!!
    <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'><?php
    include("config.php");
    include("core.php");
    header("Content-type: text/vnd.wap.wml");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    echo "<?xml version=\"1.0\"?>";
    echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
    ?>
    <wml>
    <?php
    $bcon = connectdb();
    $sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name=&#39;sitename&#39;"));
    $sitename = $sitename[0];

    if (!$bcon)
    {
    echo "<card id=\"main\" title=\"(ERROR!)\">";
    echo "<p align=\"center\">";
    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...";
    echo "</p>";
    echo "</card>";
    echo "</wml>";
    exit();
    }

    $brws = explode("/",$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(($action != "") && ($action!="terms"))
    {
    $uid = getuid_sid($sid);
    if((islogged($sid)==false)||($uid==0))
    {
    echo "<card id=\"main\" title=\"$sitename\">";
    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 "</card>";
    echo "</wml>";
    exit();
    }
    }
    if(isbanned($uid))
    {
    echo "<card id=\"main\" title=\"$sitename\">";
    echo "<p align=\"center\">";
    echo "<img src=\"../images/notok.gif\" alt=\"x\"/>
    ";
    echo "You are Banned

    ";
    $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid=&#39;".$uid."&#39; AND penalty=&#39;1&#39; OR uid=&#39;".$uid."&#39; AND penalty=&#39;2&#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 Left: $rmsg
    ";
    $nick = getnick_uid($banto[2]);
    echo "By: $nick
    ";
    echo "Reason: $banto[1]";
    //echo "<a href=\"index.php\">Login</a>";
    echo "</p>";
    echo "</card>";
    echo "</wml>";
    exit();
    }
    $res = mysql_query("UPDATE ibwf_users SET browserm=&#39;".$brws4."&#39;, ipadd=&#39;".$uip."&#39; WHERE id=&#39;".getuid_sid($sid)."&#39;");

    ////////////////////////////////////////MAIN PAGE
    else if($action=="adminreq")
    {
    addonline(getuid_sid($sid),"Sending admin request","");
    echo "<card id=\"main\" title=\"admin request\">";
    echo "<p align=\"center\">";
    $req = mysql_fetch_array(mysql_query("SELECT req,perm FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
    if($req[0]=="0" && $req[1]=="0")
    {
    echo "If you are interested to be an admin
    ";
    echo "Note,you can sent admin request for only one time!
    ";
    echo "<a href=\"index.php?action=adminreqpro&amp;sid=$sid\" >send admin request</a>";

    }
    else if ($req[0]=="0" && $req[1]>1)
    {
    echo "Sorry!you are an admin already!";
    }

    else
    {
    echo "Sorry!You sent admin request to the owner before!";
    }
    echo "

    <a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
    echo "</p>";
    echo "</card>";

    }

    else if($action=="adminreqpro")
    {
    addonline(getuid_sid($sid),"Sending admin request","");
    echo "<card id=\"main\" title=\"admin request\">";
    echo "<p align=\"center\">";

    $msg = "Hello Owner![br/]".getnick_uid($uid)." has sent you a request to be admin ";
    $req = mysql_query("INSERT INTO ibwf_private SET text=&#39;".$msg."&#39;, byuid=&#39;".$uid."&#39;, touid=&#39;1&#39;, unread=&#39;1&#39;, timesent=&#39;".time()."&#39;");
    $req .= mysql_query("UPDATE ibwf_users SET req=&#39;1&#39; WHERE id =&#39;".$uid."&#39;");
    if($req)
    {
    echo "your admin requst has been sent successfully to the site owner.";

    }
    else
    {
    echo "unknown mysql error!";
    }
    echo "

    <a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
    echo "Home</a>";
    echo "</p>";
    echo "</card>";

    }
    ?>
    </wml></div>

    Comment


      #3
      Code:
      <?php
      include("config.php");
      include("core.php");
      header("Content-type: text/vnd.wap.wml");
      header("Cache-Control: no-store, no-cache, must-revalidate");
      echo "<?xml version=\"1.0\"?>";
      echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\"". " \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
      ?>
      <wml>
      <?php
      $bcon = connectdb();
      $sitename = mysql_fetch_array(mysql_query("SELECT value FROM ibwf_settings WHERE name=&#39;sitename&#39;"));
      $sitename = $sitename[0];
      
      if (!$bcon)
      {
          echo "<card id=\"main\" title=\"(ERROR!)\">";
          echo "<p align=\"center\">";
          echo "<img src=\"../images/exit.gif\" alt=\"!\"/>
      ";
          echo "[b]Error! Cannot Connect To Database...[/b]
      
      ";
          echo "This error happens usually when backing up the database, please be patient...";
          echo "</p>";
          echo "</card>";
          echo "</wml>";
          exit();
      }
      
      $brws = explode("/",$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(($action != "") && ($action!="terms"))
      {
          $uid = getuid_sid($sid);
          if((islogged($sid)==false)||($uid==0))
          {
              echo "<card id=\"main\" title=\"$sitename\">";
            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 "</card>";
            echo "</wml>";
            exit();
          } 
      }
      if(isbanned($uid))
          {
            echo "<card id=\"main\" title=\"$sitename\">";
            echo "<p align=\"center\">";
            echo "<img src=\"../images/notok.gif\" alt=\"x\"/>
      ";
            echo "[b]You are Banned[/b]
      
      ";
            $banto = mysql_fetch_array(mysql_query("SELECT timeto, pnreas, exid FROM ibwf_penalties WHERE uid=&#39;".$uid."&#39; AND penalty=&#39;1&#39; OR uid=&#39;".$uid."&#39; AND penalty=&#39;2&#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 "[b]Time Left: [/b]$rmsg
      ";
            $nick = getnick_uid($banto[2]);
          echo "[b]By: [/b]$nick
      ";
          echo "[b]Reason: [/b]$banto[1]";
            //echo "<a href=\"index.php\">Login</a>";
            echo "</p>";
            echo "</card>";
            echo "</wml>";
            exit();
          }
      $res = mysql_query("UPDATE ibwf_users SET browserm=&#39;".$brws4."&#39;, ipadd=&#39;".$uip."&#39; WHERE id=&#39;".getuid_sid($sid)."&#39;");
      
      ////////////////////////////////////////MAIN PAGE
      if($action=="adminreq")
      {
        addonline(getuid_sid($sid),"Sending admin request","");
        echo "<card id=\"main\" title=\"admin request\">";
        echo "<p align=\"center\">";
        $req = mysql_fetch_array(mysql_query("SELECT req,perm FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
      if($req[0]=="0" && $req[1]=="0")
      {
       echo "If you are interested to be an admin
      ";
      echo "Note,you can sent admin request for only one time!
      ";
        echo "<a href=\"index.php?action=adminreqpro&amp;sid=$sid\">send admin request</a>";
        
        }
      else if ($req[0]=="0" && $req[1]>1)
      {
      echo "Sorry!you are an admin already!";
      }
      
      else 
      {
      echo "Sorry!You sent admin request to the owner before!";
      }
        echo "
      
      <a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
      echo "Home</a>";
        echo "</p>";
          echo "</card>";
      
      }
      
      else if($action=="adminreqpro")
      {
        addonline(getuid_sid($sid),"Sending admin request","");
        echo "<card id=\"main\" title=\"admin request\">";
        echo "<p align=\"center\">";
      
            $msg = "Hello Owner![br/]".getnick_uid($uid)." has sent you a request to be admin ";
           $req = mysql_query("INSERT INTO ibwf_private SET text=&#39;".$msg."&#39;, byuid=&#39;".$uid."&#39;, touid=&#39;1&#39;, unread=&#39;1&#39;, timesent=&#39;".time()."&#39;");
           $req .= mysql_query("UPDATE ibwf_users SET req=&#39;1&#39; WHERE id =&#39;".$uid."&#39;");
      if($req)
      {
      echo "your admin requst has been sent successfully to the site owner.";
      
      }
      else
      { 
      echo "unknown mysql error!";
      }
      echo "
      
      <a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
      echo "Home</a>";
        echo "</p>";
          echo "</card>";
      
      }
      ?>
      </wml>
      Hate romains that take codes from here and tell to all that they had made that

      Comment


        #4
        try this

        <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>///////////////////////admin request
        else if($action=="adminreq")
        {
        addonline(getuid_sid($sid),"Sending admin request","");
        echo "<card id=\"main\" title=\"admin request\">";
        echo "<p align=\"center\">";
        $req = mysql_fetch_array(mysql_query("SELECT req,perm FROM ibwf_users WHERE id=&#39;".$uid."&#39;"));
        if($req[0]=="0" && $req[1]=="0")
        {
        echo "If you are interested to be an admin
        ";
        echo "Note,you can sent admin request for only one time!
        ";
        echo "<a href=\"index.php?action=adminreqpro&amp;sid=$sid\" >send admin request</a>";

        }
        else if ($req[0]=="0" && $req[1]>1)
        {
        echo "Sorry!you are an admin already!";
        }

        else
        {
        echo "Sorry!You sent admin request to the owner before!";
        }
        echo "

        <a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
        echo "Home</a>";
        echo "</p>";
        echo "</card>";

        }

        else if($action=="adminreqpro")
        {
        addonline(getuid_sid($sid),"Sending admin request","");
        echo "<card id=\"main\" title=\"admin request\">";
        echo "<p align=\"center\">";

        $msg = "Hello Owner![br/]".getnick_uid($uid)." has sent you a request to be admin ";
        $req = mysql_query("INSERT INTO ibwf_private SET text=&#39;".$msg."&#39;, byuid=&#39;".$uid."&#39;, touid=&#39;1&#39;, unread=&#39;1&#39;, timesent=&#39;".time()."&#39;");
        $req .= mysql_query("UPDATE ibwf_users SET req=&#39;1&#39; WHERE id =&#39;".$uid."&#39;");
        if($req)
        {
        echo "your admin requst has been sent successfully to the site owner.";

        }
        else
        {
        echo "unknown mysql error!";
        }
        echo "

        <a href=\"index.php?action=main&amp;sid=$sid\"><img src=\"images/home.gif\" alt=\"*\"/>";
        echo "Home</a>";
        echo "</p>";
        echo "</card>";

        }
        </div>

        add this new sql row in ibwf_users

        <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>req tinyint( 1 ) NOT NULL DEFAULT &#39;0&#39;,</div>

        usage

        <div class='codetop'>CODE</div><div class='codemain' style='height:200px;white-space:pre;overflow:auto'>echo "<a href=\"index.php?action=adminreq&amp;sid=$sid\">se nd admin request</a>
        ";</div>
        sigpic

        WANT GOOD CHEAP HOSTING WITH 99% UPTIME? THEN PM ME FOR DETAILS!!

        Comment

        Working...
        X