menu

Tuesday 30 October 2012

PHP Mail Injection Protection and E-Mail Validation

Introduction There's a lot of advice available on the subject of protecting a PHP based contact form from injection attacks, (slightly) different approaches plus various ready-made functions and classes to help you. Since I am new to this, (the article is for beginner's and I am in that category myself), I decided to take a more in depth look at as much of this advice as I could and in particular to look at the source code for a few of the ready-made solutions. In doing so I am confident that the solution I have chosen will work well for me and more importantly I know why I chose that option and what its benefits and limitations are. Hopefully you can also get to that stage by reading this. I’m happy to receive as many improvements as you can throw at me; this is about learning and understanding. I’m no expert; this is designed for beginners (like me). Just don’t tell me it’s wrong and I’m dumb, that won’t help improve the article or the advice, please try and explain it in ‘for dummies’ mode so I can adapt the article appropriately. This is also PHP focussed; no doubt other languages and mixes of languages provide other options. PHP is what I was using / learning when I got into this mess in the first place. read more here in details : Click

Registry Key Handling Through PHP

The registry is made up of "Keys". Each key is similiar to branch of a tree. Each key has one parent key, and zero or more child keys. Each key can contain zero or more "Values", each of which contains a single piece of data. read more here click

Sunday 28 October 2012

upload large file on server

Write this code in the .htaccess file ----code----------------------------------- suPHP_ConfigPath /home/sdman007/public_html order allow,deny deny from all --------------------------------------- Create php.ini file in your root path ----code---------------------------------- ;;;;;;;;;;;;;;;; ; File Uploads ; ;;;;;;;;;;;;;;;; ; Maximum allowed size for uploaded files10mb ( You can change it) upload_max_filesize = 10M post_max_size = 10M max_execution_time=300 ;This is exicution time 300 like as 5 min max_input_time =300 ------------------------------------- After do that login ur cpanel again. Now you can see php configuration using the function.

Friday 26 October 2012

jQuery Store Locator

jLocator is a jQuery store locator plugin uses Google Maps API V3 and enables searching, sorting, filtering and pagination for your stores. No database required.
more details Click

General Features

  • No database required
  • Google API V3 , no key required
  • All stores are declared in HTML ,
    stores HTML structure is flexible and can be changed easily.
  • Any additional info can be added to a store.
  • Map pin can be replaced by any image/icon
  • User location detection (geolocation)
  • Search stores by address, city or postal code.
  • Sort stores by title or any other property.
  • Stores auto pagination
  • Can be added several kinds on filters:
    checkbox filters, dropdown filters and textbox search
  • Fully customizable styles
  • Works in all major browsers
  • Annotated source code
  • JSDoc documentation

Wednesday 24 October 2012

PHP: Export Database Schema as XML


Sometimes it can be useful to have a dump of the current database schema. The script below reads the schema from a MySQL database and outputs XML that describes the schema.

At first we connect to a MySQL database and use the SHOW TABLES command to return all the tables in the database. Next, we iterate over each table and return the fields for each table using the SHOW FIELDS command. Finally, we put all of the returned information into XML.
Have a look at the code:
<?php
// database constants
// make sure the information is correct
define("DB_SERVER", "localhost");
define("DB_USER", "root");
define("DB_PASS", "password");
define("DB_NAME", "tutorials");

// connection to the database 
$dbhandle = mysql_connect(DB_SERVER, DB_USER, DB_PASS) 
   or die("Unable to connect to MySQL"); 

// select a database to work with 
$selected = mysql_select_db(DB_NAME, $dbhandle) 
   or die("Could not select examples"); 

// return all available tables 
$result_tbl = mysql_query( "SHOW TABLES FROM ".DB_NAME, $dbhandle ); 

$tables = array(); 
while ($row = mysql_fetch_row($result_tbl)) { 
   $tables[] = $row[0]; 

$output = "<?xml version=\"1.0\" ?>\n"; 
$output .= "<schema>"; 

// iterate over each table and return the fields for each table
foreach ( $tables as $table ) { 
   $output .= "<table name=\"$table\">"; 
   $result_fld = mysql_query( "SHOW FIELDS FROM ".$table, $dbhandle ); 

   while( $row1 = mysql_fetch_row($result_fld) ) {
      $output .= "<field name=\"$row1[0]\" type=\"$row1[1]\"";
      $output .= ($row1[3] == "PRI") ? " primary_key=\"yes\" />" : " />";
   } 

   $output .= "</table>"; 

$output .= "</schema>"; 

// tell the browser what kind of file is come in
header("Content-type: text/xml"); 
// print out XML that describes the schema
echo $output; 

// close the connection 
mysql_close($dbhandle); 
?>

Monday 22 October 2012

Prevent PHP Security Attacks in PHP coding

Security is important part of any language . If we learn PHP then we also need and keep in mind, all security tips and tricks to prevent our code from being attacked by hackers.


To read more about this article Click here