Jump to content

Need help with "count++"..


jsmknow

Recommended Posts

Hi all..

I have a search form on my website, where you can search for members on my page.

On that page i have a working "count++" where it shows 10 results each page.

 

Now i have the problem, i have a page that you can access when you are logged in, where you can see all members on the page, but i cant get the "count++" to work on that page.

 

I really need help.. can any help me? maybe even update my code..

 

<?
$*****=($_POST[*****]);
echo "<body style='color: #000000; background-color: #FFFFFF; background-image: url(../images/$*****-bag.jpg)'>";
?>
<?php
$con = mysql_connect("*****","*****","*****");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }mysql_select_db("*****", $con);
  ?>
<head>
<link rel="stylesheet" type="text/css" href="style.css">
<style type="text/css">
.style1 {
color: #FFFFFF;
font-size: medium;
}
.style2 {
border: 3px solid #814D1D;
background-color: #C47E35;
}
.style30 {
border: 3px solid #82C03D;
margin-top: 0px;
}
.style31 {
text-align: center;
}
.style32 {
border-style: none;
border-width: 0;
margin-top: 0px;
}
</style>
</head>


<table align="center" width="400px" class="style32">
	<tr>
		<td class="style31"><strong>Andre Brugere På JSMknow Own:</strong></td>
	</tr>
</table>

<table class="style30" align="center" style="width: 450px">
<tr>
<td>
<?php
$*****= $_POST[*****];
$hent = mysql_query("SELECT * FROM ***** WHERE user!='$*****' ORDER BY online DESC");

if(mysql_num_rows($hent))
{
while ($vis = mysql_fetch_array($hent))
	{
			if (($vis[online]=='online'))
		 	{
		 	$online="<img src='../images/online.png' width='15' height='15' alt='Online'>";
		 	}
		 	else
		 	{
		 	$online="<img src='../images/offline.png' width='15' height='15' alt='Offline'>";
		 	}
	if (file_exists("../images/$vis[user].jpg"))
		{
			$img = "../images/$vis[user].jpg";
		}
		else
		{
			$img = "../images/nopic.jpg";
		}

	echo "<center>" . $online . "" . $vis['user'] . "<form class='form' method='post' action='profile.php?user=$vis[user]' target='Indhold' style='width: 200px'><input type='hidden' name='afsender' value='*****'><input name='jsmknow' type='submit' height='100px' width='100px' value='$vis[user]' alt='Se $vis[user]s Profil'></form></center>";




	$count++;

	if ($count % 8 == 0)
		{
		echo "</td><td>";
		}
	}
}


?>
</td>
</tr>
</table>




<?
mysql_close($con);
?>

Link to comment
https://forums.phpfreaks.com/topic/136952-need-help-with-count/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.