Admin Request (help)

Started on the old forum in November 2008 · view the original in the archive · old links redirect here

3 replies · 646 views · started 18 years ago · 1 min read

3 participants
globetel Newbie · 6 posts #1

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!!!

CODE////////////////////////////////////////MAIN PAGE else if($action=="adminreq") { addonline(getuid_sid($sid),"Sending admin request",""); echo "<card id="main" title="admin request">"; echo " "; $req = mysql_fetch_array(mysql_query("SELECT req,perm FROM ibwf_users WHERE id='".$uid."'")); 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&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&sid=$sid"><img src="images/home.gif" alt="*"/>"; echo "Home</a>"; echo " "; echo "</card>";

}

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

  $msg = "Hello Owner![br/]".getnick_uid($uid)." has sent you a request to be admin ";
 $req = mysql_query("INSERT INTO ibwf_private SET text='".$msg."', byuid='".$uid."', touid='1', unread='1', timesent='".time()."'");
 $req .= mysql_query("UPDATE ibwf_users SET req='1' WHERE id ='".$uid."'");

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&sid=$sid"><img src="images/home.gif" alt="*"/>"; echo "Home</a>"; echo " "; echo "</card>";

} ?> </wml>

globetel Newbie · 6 posts #2

guys here'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!!! 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='sitename'")); $sitename = $sitename[0]; if (!$bcon) { echo "<card id=\"main\" title=\"(ERROR!)\">"; echo " "; 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 " "; 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 " "; echo "You are not logged in "; echo "Or Your session has been expired "; echo "<a href=\"index.php\">Login</a>"; echo " "; echo "</card>"; echo "</wml>"; exit(); } } if(isbanned($uid)) { echo "<card id=\"main\" title=\"$sitename\">"; echo " "; 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='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'")); $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'")); $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 " "; echo "</card>"; echo "</wml>"; exit(); } $res = mysql_query("UPDATE ibwf_users SET browserm='".$brws4."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'"); ////////////////////////////////////////MAIN PAGE else if($action=="adminreq") { addonline(getuid_sid($sid),"Sending admin request",""); echo "<card id=\"main\" title=\"admin request\">"; echo " "; $req = mysql_fetch_array(mysql_query("SELECT req,perm FROM ibwf_users WHERE id='".$uid."'")); 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 " "; echo "</card>"; } else if($action=="adminreqpro") { addonline(getuid_sid($sid),"Sending admin request",""); echo "<card id=\"main\" title=\"admin request\">"; echo " "; $msg = "Hello Owner![br/]".getnick_uid($uid)." has sent you a request to be admin "; $req = mysql_query("INSERT INTO ibwf_private SET text='".$msg."', byuid='".$uid."', touid='1', unread='1', timesent='".time()."'"); $req .= mysql_query("UPDATE ibwf_users SET req='1' WHERE id ='".$uid."'"); 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 " "; echo "</card>"; } ?> </wml>
ionutxp Developer · 137 posts #3
<?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='sitename'"));
$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='".$uid."' AND penalty='1' OR uid='".$uid."' AND penalty='2'"));
    $banres = mysql_fetch_array(mysql_query("SELECT lastpnreas FROM ibwf_users WHERE id='".$uid."'"));
      $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='".$brws4."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'");

////////////////////////////////////////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='".$uid."'"));
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&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&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='".$msg."', byuid='".$uid."', touid='1', unread='1', timesent='".time()."'");
     $req .= mysql_query("UPDATE ibwf_users SET req='1' WHERE id ='".$uid."'");
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&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 External image (may be gone)

thunderwap Developer · 169 posts #4

try this

CODE///////////////////////admin request else if($action=="adminreq") { addonline(getuid_sid($sid),"Sending admin request",""); echo "<card id="main" title="admin request">"; echo " "; $req = mysql_fetch_array(mysql_query("SELECT req,perm FROM ibwf_users WHERE id='".$uid."'")); 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&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&sid=$sid"><img src="images/home.gif" alt="*"/>"; echo "Home</a>"; echo " "; echo "</card>";

}

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

  $msg = "Hello Owner![br/]".getnick_uid($uid)." has sent you a request to be admin ";
 $req = mysql_query("INSERT INTO ibwf_private SET text='".$msg."', byuid='".$uid."', touid='1', unread='1', timesent='".time()."'");
 $req .= mysql_query("UPDATE ibwf_users SET req='1' WHERE id ='".$uid."'");

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&sid=$sid"><img src="images/home.gif" alt="*"/>"; echo "Home</a>"; echo " "; echo "</card>";

}

add this new sql row in ibwf_users

CODEreq tinyint( 1 ) NOT NULL DEFAULT '0',

usage

CODEecho "<a href="index.php?action=adminreq&sid=$sid">send admin request</a> ";

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

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close