Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Other Programming › PHP Programming › [PHP] Custom SB command not working?

[PHP] Custom SB command not working?

Posts 1–6 of 6 · Page 1 of 1
XM
xMrSiiNz
[PHP] Custom SB command not working?
I can't get this to work, if someone could help me it'd be much appreciated. I'd rather not show the whole code.

Code:
                  elseif (preg_match("#^(/rename\s+?)#i", $message, $matches) && $db->isAdmin()) {
			$rename = $db->sanitize(trim(str_replace($matches[0], "", $message)));
			$selectuser = $con->query("SELECT * FROM users WHERE username='$rename'");
			$checkuser = $con->query("SELECT * FROM users WHERE username='$matches[0]'");
			if(!$selectuser or !$checkuser)
			{
				echo $con->mysql_error();
			}
			else
			{
				if($selectuser && !$checkuser)
				{
					$con->query("UPDATE users SET Username='$matches[0]' WHERE Username='$rename'");
					$message = ' has changed the user '.$user.'\'s username to '.$matches[0].'.';
				}
				else
				{
					$message = 'The username you have entered is invalid or already taken.';
				}
			}
                 }
#1 · 12y ago
abuckau907
abuckau907
What is it doing, or, not doing?

maybe the "or" on line 5 should be "||"
#2 · edited 12y ago · 12y ago
XM
xMrSiiNz
Quote Originally Posted by abuckau907 View Post
What is it doing, or, not doing?

maybe the "or" on line 5 should be "||"
It's not doing anything, not even throwing a error. You can use "or".
#3 · 12y ago
abuckau907
abuckau907
You're not giving me much to go off of...

elseif (preg_match("#^(/rename\s+?)#i", $message, $matches) && $db->isAdmin()) {
echo "Path1 taken <br />";
$rename = $db->sanitize(trim(str_replace($matches[0], "", $message)));
$selectuser = $con->query("SELECT * FROM users WHERE username='$rename'");
$checkuser = $con->query("SELECT * FROM users WHERE username='$matches[0]'");
if(!$selectuser or !$checkuser)
{
echo "Path2 taken <br />";
echo $con->mysql_error();
}
else
{
if($selectuser && !$checkuser)
{
echo "Path3 taken <br />";
$con->query("UPDATE users SET Username='$matches[0]' WHERE Username='$rename'");
$message = ' has changed the user '.$user.'\'s username to '.$matches[0].'.';
}
else
{
echo "Path4 taken <br />";
$message = 'The username you have entered is invalid or already taken.';
}
}
}
Which output(s) do you get?

edit: Please describe your problem more than "it won't work/nothing happens" ..else I can't help.
tip: sprinkle more echo's into your code so you know which pieces of code are actually being executed/the path of execution.
#4 · edited 12y ago · 12y ago
MA
marceliino
I Can help you if you can post the whole script.
But with a small snipped like this it's sort of hard to figure out whats the problem.
#5 · 12y ago
greengermbubble
greengermbubble
Your elseif is in an odd spot
#6 · 12y ago
Posts 1–6 of 6 · Page 1 of 1

Post a Reply

Similar Threads

  • changemap command not working?By zeekond in Vindictus Discussions
    3Last post 15y ago
  • Simple PTC command not workingBy amitsl in Combat Arms Coding Help & Discussion
    12Last post 13y ago
  • PushToConsole Command not workingBy lunatik21 in Combat Arms Coding Help & Discussion
    4Last post 13y ago
  • Command not workingBy m202 in Vindictus Discussions
    4Last post 15y ago
  • Vindictus uSa secondary weapons commands not workingBy olox123 in Vindictus Help
    8Last post 14y ago

Tags for this Thread

None