Menu bar

Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Saturday, 5 July 2014

How to disable right click , F12 key and Direct link access?

Stop users from stealing your website images, copying content, or from inspecting the source.

In order to setup a security as above , the first is to disable right click ,disable F12 key and then disable direct link access.

Direct link access means that a user get full path of image by writing 'view-source:' before the domain name.
After getting the full path, user will type the full path of image in address bar to access images, So we have to avoid this attack also.
Use this code in your header file or where ever you required.

<body oncontextmenu="return false;">
Fires when the user clicks the right mouse button in the client area, opening the context menu.


<meta http-equiv="imagetoolbar" content="no" />
This turns off Internet Explorer's image toolbar that appears when you hover over an image.
Use this code within <head > tag.


RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [NC,F,L]
Write this code in your .htaccess file

Monday, 23 June 2014

Understanding Join Query.

Untitled Document Here we are goingto join two tables with common column named

Emp'Age' Table
EmpAge
Ron White32
Femina65
John25
Don

'Salary_Emp' Table
SalaryEmp
40000Ron White
29000Femina
25000
11000Ron White

The important thing to note here is that the column Emp contains information that can tie these two tables together. In the "Age" table, the Emp column contains all the Employee of the Company and their respective ages. In the "Salary_Emp" table the Emp column contains the respective Salary of the Employee. It's only through a shared column relationship such as this that tables can be joined together, so remember this when creating tables you wish to have interact with each other.
//php start
// Make a MySQL connection using your database credentials
// Construct our join query
$query = "SELECT Age.Emp, Salary_Emp.Salary ".
 "FROM Age, Salary_Emp".
 "WHERE Age.Emp = Salary_Emp.Emp";
  
$result = mysql_query($query) or die(mysql_error());


// Print out the contents of each row into a table 
while($row = mysql_fetch_array($result)){
 echo $row['Emp']. " - ". $row['Salary'];
 echo "
";
}
//php ends
EmpSalary
Ron White40000
Femina29000
Ron White11000