Jump to content

jonassvensson4

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by jonassvensson4

  1. Thank you so much for the answer! That solved my problem
  2. Hello! I can't manage to get this to work and i have no idea what im doing wrong. It doesnt give me an error. (NOTICE: IM A BEGINNER AT PHP). Thanks /Jonas <?php class GameStruct { public $Name; public $Database; public $Game; public $NoticeLeave; public function Init($n, $db, $g, $nl) { $Name = $n; $Database = $db; $Game = $g; $NoticeLeave = $nl; } } $struct = Array(); function AddDefinition( $name, $database, $game, $notice ) { global $instance; $instance = new GameStruct; $instance->Init( $name, $database, $game, $notice ); $struct[] = $instance; } AddDefinition( "leavecsgo", "comp_user", "Csgo", "Du har nu lämnat CS:GO-turneringen!" ); AddDefinition( "leavesmite", "comp_user", "Smite", "Du har nu lämnat Smite-turneringen!" ); AddDefinition( "leavefifa", "comp_user", "Fifa", "Du har nu lämnat Fifa-turneringen!" ); AddDefinition( "leavehearthstone", "comp_user", "Hearthstone", "Du har nu lämnat Hearthstone-turneringen!" ); AddDefinition( "leavedota2", "comp_user", "Dota2", "Du har nu lämnat Dota2-turneringen!" ); for( $i = 0; $i < count( $struct ); $i++ ) { if( !isset( $_POST[ $struct->Name ] ) ) { $sql = $con->query("DELETE FROM `{$struct->Database}` WHERE Username='{$Username}' AND Game='{$struct->Game}'"); $format = 'alert("%s");'; echo '<script >'; echo sprintf( $format, $struct->NoticeLeave ); echo '</script>'; } } ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.