Jump to content

Problema Search player panel


iSkull

Recommended Posts

Salut all, am si eu o problema la bara de cautare ptr playeri, dau sa caut pe cineva si tot la pagina de cautare ma trimite in loc sa-mi afiseze rezultatele

 

Bara de cautare

<div class="nav-search" id="nav-search">
    <form class="form-search" action="search.php">
      <span class="input-icon">
        <input type="text" placeholder="Caută un jucător.." name="name" class="nav-search-input" autocomplete="off">
        <i class="icon-search nav-search-icon">
        </i>
      </span>
    </form>
  </div>


Si search.php

<?php require_once("./includes/Header.php"); ?>
<?php
$pagina = 'Cautare';
if(!isset($_SESSION['username']))
{
	Header("Location: /panel");
	return 1;
}

if(isset($_SESSION['username'])) 
{
	$antibug = 1;
	$verificare = mysqli_query($DB_H, "SELECT * FROM  ".$mysqli['SQL_ACCOUNTS']." WHERE `Name` = '".$_SESSION['username']."'");
	while($rowcheck = mysqli_fetch_array($verificare)) 
	{
		$antibug = 0;	
	}
	if($antibug == 1)
	{
		echo "
		<script type='text/javascript'>
		<!--
		function Redirect()
		{
			window.location='/panel/index.php?out';
		}
		setTimeout('Redirect()', 1);
		//-->
		</script>";
	}		
}
?>

<div class="breadcrumbs" id="breadcrumbs">
	<script type="text/javascript">
    try
	{
		ace.settings.check('breadcrumbs' , 'fixed')
	}
	catch(e)
	{
    
	}
	</script>
	<ul class="breadcrumb">
    <li>
      <i class="icon-home home-icon">
      </i>
      <a href="index"><?= $Informatii['NumeleComunitatii'] ?>
      </a>
    </li>
    <li class="active">
		<i class="icon-angle-right">
		</i>
      <?php echo htmlspecialchars($pagina);?>
    </li>
  </ul>
</div>


<div class="page-content">
<div class="row-fluid">


<div class="span12">
			
			<!-- BEGIN PAGE HEADER-->
			
			
			<!-- END PAGE HEADER-->
			<!-- BEGIN DASHBOARD STATS -->
<?php if(isset($_POST['search'])) { ?>
	<h3 class="page-title">Rezultatul cautarii tale:</h3></br>
	
	<?php } ?>
<?php
if(isset($_POST['search']) && isset($_POST['username']))
{
	$username = mysqli_real_escape_string($DB_H, $_POST['username']);
	
	if(count($username) < 3 && count($username) > 24) {
		$msg = "Username are invalid."; $class = "error";
	}
	else {
		$check = mysqli_query($DB_H, "SELECT * FROM  ".$mysqli['SQL_ACCOUNTS']." WHERE `Name` LIKE '%$username%' LIMIT 50");
		if(mysqli_num_rows($check) == 0){
			$msg = "Acest nume nu exista."; $class = "error";
			 echo "Acest jucator nu a putut fi gasit in baza noastra de date!</br>Urmeaza sa fi redirectionat in 3,5 secunde..";
			 echo "
		<script type='text/javascript'>
		<!--
		function Redirect()
		{
			window.location='/panel/panel/search.php';
		}
		setTimeout('Redirect()', 3550);
		//-->
		</script>";
		}
		else {
			echo "";
			while($row = mysqli_fetch_array($check)){
				echo "
				<b>(".$row['ID'].")</b> <a href=\"/panel/pages/account.php?id=".$row['ID']."\">".$row['Name']."</a><br/>";
			}
		}
	}

}


	
if(!isset($_POST['search']))
{
?>
<center>
<?php if(isset($msg)): ?>
	<div class="alert alert-danger" role="alert"><?= $msg ?></div>
	<?php endif; ?>
<h3 class="page-title">
Caută jucător<small> </br>Obține informații despre un anumit jucător</small>
</h3>
<form method="POST" action="">			
<label for="username">Nume din joc:</label>
<input name="username" type="text">
<br>
<input class="btn btn-inverse" name = "search" type="submit" value="Search">
</form>
</center>


<?php } ?>
				
			
			<!-- END DASHBOARD STATS -->
			
			
			
	


<?php require_once("./includes/Footer.php"); ?>

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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. For more details you can also review our Terms of Use and Privacy Policy.