What is social share button?
How to add?
Note: Don't edit this code, otherwise it may not work & Keep backup everytime before you edit your template.
The Store House of Web Tunes.
Company | Contact | Country |
---|---|---|
Alfreds Futterkiste | Maria Anders | Germany |
Berglunds snabbköp | Christina Berglund | Sweden |
Centro comercial Moctezuma | Francisco Chang | Mexico |
Ernst Handel | Roland Mendel | Austria |
Island Trading | Helen Bennett | UK |
Königlich Essen | Philip Cramer | Germany |
Laughing Bacchus Winecellars | Yoshi Tannamuri | Canada |
Magazzini Alimentari Riuniti | Giovanni Rovelli | Italy |
North/South | Simon Crowther | UK |
Paris spécialités | Marie Bertrand | France |
One-colored border!
Two-colored border!
Three-colored border!
Four-colored border!
Note: The "border-color" property does not work if it is used alone. Use the "border-style" property to set the borders first.
No border.
A dotted border.
A dashed border.
A solid border.
A double border.
A groove border.
A ridge border.
An inset border.
An outset border.
A hidden border.
.htccess or hyper-text access to the configuration file is a powerful tool. It's specialty is anybody can edit it easily and use. Today we will see the use of this powerful tool.
Stop Hotlink
Is there anybody who consume your bandwidth by using your uploaded image? Then you can add this code to
.htaccess file.
Options +FollowSymlinks
#Protect against hotlinking
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?domainname.com/ [nc]
RewriteRule .*.(gif|jpg|png)$ http://yourdomainname.com/img/stop_stealing_bandwidth.gif[nc]
Protect your site from bad bot
some hacking tools when use bot to crowling, scaning your site then you can stop them by adding this code to your .htaccess file.
#Block bad bots
SetEnvIfNoCase user-Agent ^FrontPage [NC,OR]
SetEnvIfNoCase user-Agent ^Java.* [NC,OR]
SetEnvIfNoCase user-Agent ^Microsoft.URL
[NC,OR]
SetEnvIfNoCase user-Agent ^MSFrontPage
[NC,OR]
SetEnvIfNoCase user-Agent ^Offline.Explorer
[NC,OR]
SetEnvIfNoCase user-Agent ^[Ww]eb[Bb]andit
[NC,OR]
SetEnvIfNoCase user-Agent ^Zeus [NC]
Order Allow,Deny
Allow from all
Deny from env=bad_bot
Block specific IP
when you see that a specific ip used to hack or spaming to your website then you can block that ip by add this code to .htaccess file.
allow from all
deny from 145.186.14.102
deny from 124.15
here replace your targeted ip by 145.186.14.102 and then it will be blocked.
Redirect to 401, 403, 404, 503 etc error page.
You can redirect your visitor to this error page when they input the url which doesn't exist in your website.
ErrorDocument 401 /error/401.php
ErrorDocument 403 /error/403.php
ErrorDocument 404 /error/404.php
ErrorDocument 500 /error/500.php
Here we store our error page in the error directory. you should replace this with your own directory.
Protect any specific file
you need to protect your configuration file for your security.
#Protect the your-file-name-with-extension File
order allow,deny
deny from all
Here replace your file name with your-file-name-with-extension.(must include extension)
Protect any file or directory with password.
To protect file with password you can use this code
password-protect a file
AuthType Basic
AuthName "Prompt"
AuthUserFile /home/path/.htpasswd
Require valid-user
# password-protect a directory
resides
AuthType basic
AuthName "This directory is protected"
AuthUserFile /home/path/.htpasswd
AuthGroupFile /dev/null
Require valid-user
Make your site super fast by compressing content to gzip.
AddOutputFilterByType DEFLATE text/html text/plain text/xml application/xml application/xhtml+xml text/javascript text/css
application/x-javascript
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSIE !no-gzip !gzip-only-text/html
Remove extension from link
If your site have a page named page.php
and it will load by http://yoursite.com/page.php. but you can remove this .php
extension by adding this code to your .htaccess and then it will http://yoursite.com/page
RewriteRule ^(([^/]+/)*[^.]+)$ /$1.php [L]
You can also remove .html by this code. simply remove .php and add .html
Remove category from url
Say, your site have a category called downloads. Then you can access this directory by /category/downloads. But now, you want to remove this category tag from url. You can do it by adding this code to .htaccess file.
RewriteRule ^category/(.+)$ http://www.YourSite.com/$1 [R=301,L]
Change wordpress default feeds to feedburner.
#Redirect wordpress content feeds to
feedburner
RewriteEngine on
RewriteCond %{HTTP_USER_AGENT} !
FeedBurner [NC]
RewriteCond %{HTTP_USER_AGENT} !
FeedValidator [NC]
RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds.feedburner.com/yourfeedhere [R=302,NC,L]
HTML | JS | SQL |
CSS | PHP | MySQL |
Markup | Programming | Database |
---|---|---|
HTML | JS | SQL |
CSS | PHP | MySQL |
Markup | Programming | Database |
---|---|---|
HTML | JS | SQL |
CSS | PHP | MySQL |
If you don't know how to create a menu then you can follow this tutorial. Paste the code in a html file. Ex: menu.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type"
charset=utf-8" />
<title>My Beautiful css menu</title>
<link href="menu.css" type="text/css" rel="stylesheet" />
</head>
<body>
<div class="menu">
<ul>
<li><a href="#">Desktops</a></li>
<li><a href="#">Laptops &
Notebooks</a></li>
<li><a href="#">Components</a>
<ul>
<li><a href="#"> Mice and Trackballs</a></li>
<li><a href="#"> Monitors</a></li>
<li><a href="#"> Printers</a></li>
<li><a href="#"> Scanners</a></li>
<li><a href="#"> Web Cameras</a>
<ul>
<li><a href="#"> Mice and Trackballs</a></li>
<li><a href="#"> Monitors</a></li>
<li><a href="#"> Printers</a></li>
<li><a href="#"> Scanners</a></li>
<li><a href="#"> Web Cameras</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Tablets</a></li>
<li><a href="#">Software</a></li>
</ul>
</div>
</body>
</html>
Now, save the file.
Save the bellow code with name menu.css
.menu {
background: none repeat scroll 0 0 #1A1A1A;
display: block;
height: 40px;
margin: 0 auto;
width: 960px;
}
.menu ul{
padding:0;
margin:0;
}
.menu ul li{
float:left;
list-style:none;
position:relative;
width:150px;
}
.menu ul li a{
font-size:14px;
padding:12px 10px;
text-decoration:none;
display:block;
color:#0FF;
background:#000;
}
.menu ul li a:hover{
color:#F00;
background:#666;
}
.menu ul li ul{
top:39px;
width:150px;
left:0;
padding:0;
margin:0;
position:absolute;
display:block;
visibility:hidden;
}
.menu ul li:hover ul{
display:block;
visibility:visible;
}
.menu ul li:hover ul li ul{
display:block;
left:150px;
position:absolute;
width:150px;
top: 0;
padding:0;
margin:0;
visibility:hidden;
}
.menu ul li ul li:hover ul{
display:block;
visibility:visible;
}
And save this file and run your menu.html file.
Hello everybody, How are you? EID MUBARAK to all. Today I am going to show you how can you protect a php file by php. If you want the file will only show for you or by entering password, then you can follow the tutorial.
For this work, You must know the basic php. Paste this code in your php file
<?php
$view = header(location: #allcode);
$passMain = yourpasswordhere;
echo "<form method='post' action='#allcode'><input type='password' name='pass'/><input type='submit' value='View file'/></form>";
if($pass==$passMain)
{
echo "$view";
}
else
{
echo "Your password is not correct";
}
?>
<div id="allcode">Your file's all code here</div>
Now save your file and run. Here the $passMain variable contains your main password which will unlock the file. So, change the password with your own.
Good bye and again EID MUBARAK
There are many use of random number. In php, there are a function to create random number and it is rand();
ex:
<?php
echo rand();
?>
It will output a number and refresh the page it will output deferent number.
You can create many random number by using bellow code:
<?php
echo rand(). "\n";
echo rand(). "\n";
echo rand(). "\n";
echo rand(). "\n";
?>
It will output deferent 4 random number.
If we want to get a number between a range then what can we do? Example, if we want get a number between 15 and 30 then we can use this code
<?php
echo rand(15, 30);
?>
Now We can use this in our project by adding some condition.
Ex:
<?php
$rand = rand(1, 3);
if ($rand == 1){
echo "Generated number is 1";
}else if ($rand == 2){
echo "Generated number is 2";
}else {
echo 'Generated number is 3';
}
?>
Good by and wish you EID MUBARAK.