Pages

Thursday, December 15, 2011

query

select * from "tblname" order by sal desc limit (n-1),1;

gridview













0 and !is_numeric($start)){
echo "Data Error";
exit;
}


$eu = ($start - 0);
$limit = 10; // No of records to be shown per page.
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;

$sort = (isset($_GET['sort'])) ? $_GET['sort'] : 'name';

$sort_order = 'asc';
if(isset($_GET['sort_by']))
{
if($_GET['sort_by'] == 'asc')
{
$sort_order = 'desc';
} else
{
$sort_order = 'asc';
}
}

switch($sort)
{
case 'name':
$order_by = 'name';
break;
case 'email':
$order_by = 'email';
break;
case 'username':
$order_by = 'username';
break;
case 'company':
$order_by = 'company';
break;
case 'telephone':
$order_by = 'telephone';
break;
case 'post':
$order_by = 'post';
break;
case 'add1':
$order_by = 'add1';
break;
case 'add2':
$order_by = 'add2';
break;
case 'city':
$order_by = 'city';
break;
case 'country':
$order_by = 'country';
break;
}

/////////////// WE have to find out the number of records in our table. We will use this to break the pages///////
$query2=" SELECT * FROM users ORDER BY $sort $sort_order ";
$result2=mysql_query($query2);
echo mysql_error();
$nume=mysql_num_rows($result2);
/////// The variable nume above will store the total number of records in the table////

/////////// Now let us print the table headers ////////////////
echo "










";
////////////// Now let us start executing the query with variables $eu and $limit set at the top of the page///////////
$query=" SELECT * FROM users ORDER BY $sort $sort_order limit $eu, $limit ";
$result=mysql_query($query);
echo mysql_error();

//////////////// Now we will display the returned records in side the rows of the table/////////
while($row = mysql_fetch_array($result))
{


echo "













";

}
echo "
NameEmailUsernameCompanyTelephonePost CodeAddress 1Address 2CityCountry
".$row['name']."".$row['email']."".$row['username']."".$row['company']."".$row['telephone']."".$row['post']."".$row['add1']."".$row['add2']."".$row['city']."".$row['country']."Delete
";
////////////////////////////// End of displaying the table with records ////////////////////////

///////////////////////////////
if($nume > $limit ){ // Let us display bottom links if sufficient records are there for paging

/////////////// Start the bottom links with Prev and next link with page numbers /////////////////
echo "
";
//// if our variable $back is equal to 0 or more then only we will display the link to move back ////////
if($back >=0) {
print "PREV";
}
//////////////// Let us display the page links at center. We will not display the current page as a link ///////////
echo "
";
$i=0;
$l=1;
for($i=0;$i < $nume;$i=$i+$limit){
if($i <> $eu){
echo " $l ";
}
else { echo "$l";} /// Current page is not displayed as link and given font color red
$l=$l+1;
}


echo "
";
///////////// If we are not in the last page then Next link will be displayed. Here we check that /////
if($this1 < $nume) {
print "NEXT";}
echo "
";

}// end of if checking sufficient records are there to display bottom navigational link.
?>

ragister page

ragiteration page::

//Database Information

require "config.php";

//Connect to database


$name = $_POST['name'];
$email = $_POST['email'];
$username = $_POST['username'];
$password = $_POST['password'];
$company = $_POST['company'];
$telephone = $_POST['telephone'];
$post = $_POST['post'];
$add1 = $_POST['add1'];
$add2 = $_POST['add2'];
$city = $_POST['city'];
$country = $_POST['country'];


// lets check to see if the username already exists

$checkuser = mysql_query("SELECT username FROM users WHERE username='$username'");

$username_exist = mysql_num_rows($checkuser);

if($username_exist > 0){
echo "I'm sorry but the Username you specified has already been taken. Please pick another one.";
unset($username);
include 'register.html';
exit();
}

// lf no errors present with the username
// use a query to insert the data into the database.

$query = "INSERT INTO users (name, email, username, password, company, telephone, post, add1, add2, city, country)
VALUES('$name', '$email','$username', '$password', '$company', '$telephone', '$post', '$add1', '$add2', '$city', '$country' )";
mysql_query($query) or die(mysql_error());
mysql_close();

echo "You have successfully Registered Now go to login page Login Now ";

// mail user their information

$yoursite = 'www.tdsl-fm.com';
$webmaster = 'admin';
$youremail = 'info@tdsl-fm.com';

$subject = "You have successfully registered at $yoursite...";
$message = "Dear $name, you are now registered at our web site.

To login, simply go to our web page and enter in the following details in the login form:

Username: $username

Password: $password



Please print this information out and store it for future reference.



Thanks,

$webmaster";

$header="From:www.tdsl-fm.com\r\n";


$header.="Content-type: text/html \r\n";
mail($username, $subject, $message, $header);

echo "Your information has been mailed to your email address.";

?>



login page::


require "config.php";

session_start();
$username = $_POST['username'];
$password = $_POST['password'];
$query = mysql_query ("select * from users where username ='$username' and password='$password' LIMIT 1 ");



if (mysql_num_rows($query)!= 1) {
$error = "Bad Login";
echo $error;
include "index.html";

} else {

$_SESSION['username'] = "$username";
header("Location: admin.php");
}

?>

Thursday, January 13, 2011

property dealer in delhi- propertydealersindelhi.blogspot.com

delhi property dealer
property dealers in delhi....property dealer in delhi is a site that gives property dealers information...
property dealers in delhi | property dealers delhi | delhi property dealers...
property for sale in delhi | property deales | property | delhi | delhi proeprty dealer | dealers in delhi

Propertydealersindelhi.blogspot.com

property dealers in delhi
property dealers in delhi is a relative property dealer.
property for sale in delhi...

property dealers in delhi | property dealer in delhi | property dealers | proeprty dealers delhi | property

 
Powered by Blogger