How to give animation on the button when it is clicked using SASS and jQuery ?

Hi guys in today’s post I’m going to show you guys how to give animation on the button when user click on it.
So I uploaded the live example on the codepen from where you can see and can edit the file and make some more awesome stuff.

Click here to visit the pen.

How to change the background, text or a div color on real time with php, mysql, ajax and jQuery ?

Description:- Hello! In this lesson I’ll show you guys the logic with little example to how to change the background, text or a div color on real time with php, mysql, ajax and jQuery.
Maybe you guys have better logics to shorten my code. If you have then please comment below.

So for this lesson make the following files step by step:-
1. create database and name it “color”
2. create row in database(color) and name it colorname
3. Create 2 columns 
    (i) id
    (ii) colorcode
4. Download jQuery file
5. Create changebg.php
6. Create config.php
7. Create insertcolor.php

1. config.php

pdf of config file

2. changebg.php

pdf of changebg file

3. insertcolor.php

pdf of insertcolor file

*NOTE :- I’m providing you pdf files as my wordpress text editor is not working well copy and paste code and make the php files with the same name of files and then goto your browser after making database and then run the changebg.php file.
Live demo is available here

How to replace bad/abusive/swear/curse words through php ??

Description:- Hello guys today’s lesson is only for 18+ public because I really don’t want children to learn abusive words on my blog.
Today I’m going to show you how to replace abusive words through php like if someone typed in FUCK it will display like F**K .

<?php

$string = "Hello asshole I heared that you are asslicker too. Fuck off jerk and never show me your buttface.";
$swearWords = array("asshole","buttface","asslicker","jerk","fuck");
$replacer = array("a**hole","b**tface","a**li***r","j**k","f**k");
$filter = str_ireplace($swearWords,$replacer, $string);

echo $filter;
?>

*Note:- You can also use str_replace() but hence str_replace is case sensitive and str_ireplace() is not a case sensitive so it will accept both types of words lowercase or uppercase words.

How to make Fully functional Contact Form in php using mail() function ?

Description: In this example I’m gonna show you guys how to make fully functional contact form in php using mail() function. And in this example we also cover how to change the placeholder color, how to make captcha code and then will verify if the captcha code is same as you typed in.

I make this contact form for the holding page for my client  the kensington dentist, London.

And most important thing is this contact form is build in Zurb Foundation to make it fully responsive you guys can also use twitter bootstrap….

This example includes 4 different files:-
1. index.php   (In which we make our form)
2. send.php   (through which we’ll send the form it includes mail() function)
3. foundation.css  (its a zurb foundation css file to make the form responsive)
4. app.css  (this will be our custom stylesheet where we’ll give styling to input types and to the placeholders)

————————————————————————————————-
1. index.php

<?php
//  For captcha 
$aa = md5( time() * microtime() );
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Contact form</title>
<meta name="viewport" content="width=device-width,initial-scale=1, maximum-scale=1, user-scalable=0"/>
<link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,100italic,300italic,400italic,700italic' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="app.css"/>
<link rel="stylesheet" type="text/css" href="foundation.css"/>
</head>
<body>
   
       
                           
                   
                       
                                                   
                       
                                                    
                    </div>                                         
                       
                                                 
                       
                                                    
                    </div>                 </div>                                 
                   
                                           
                </div>                
                    
                        " readonly />                    
                </div>                
                    
                                                 
                </div>                
                   
                                           
                </div>                 
                   
                       

                       

                   
                </div>             </form>         </div>     </div> </div> </body> </html>

2. send.php

<?php
    if($_REQUEST['captcha'] != $_REQUEST['check'])
       {
            header("Location: index.php?error=The characters you entered didn't match the word verification. Please try again.");
       }
    else
       {
            $myemail = "mukul.soni0007@gmail.com";  /*ENTER THE EMAIL ADDRESS WHERE YOU WANT TO RECIEVE THE MAILS. In this case I set it to my personal gmail account. You can also make it dynamic by using $_REQUEST['the name of the field'] */
           
           $name = $_POST['fname'];
           $sname = $_POST['sname'];
           $subject = "Contact Form Submission";    /* Or you can make it dynamic by using $_POST['name of the field'] */
           $email = $_POST['mail'];
           $message = $_POST['message'];
           $tel = $_POST['tel'];
           
           $message="
           Name : $name $sname
           E-mail : $email
           Subject : $subject
           Telephone : $tel
           Message : 
           $message
           ";
           
           /* Send the message using mail() function */
           if(mail ($myemail, $subject, $message))
           {
           
           /* Redirect visitor to the page you guys want */
           header("Location: index.php?success=Thanks! We'll get back to you soon");
           exit(); 
           }
           else{
           /*If any error then throw an error.*/
               echo "Some error Occured !";
               exit();
           } 
       }
?>

3. foundation.css

You guys will find foundation.css here

4. app.css

.cb
{
    border:1px solid #000;
}
.posts-contact ::-webkit-input-placeholder {
   color: #24292d;
    opacity: 0.7;
}

.posts-contact :-moz-placeholder { 
   color:  #24292d;  
}

.posts-contact ::-moz-placeholder { 
   color:  #24292d;  
}

.posts-contact :-ms-input-placeholder {  
   color:  #24292d;  
}

.posts-contact
{
    
    max-width:504px;
    margin:34px auto;
    margin-bottom:0px;
    
}
#captcha
{
    background-color:#fff;
    font-size: 20px;
    font-weight:bold;
    text-shadow: 2px 0px 5px #5ca8fe;
    font-family:'Lato', sans-serif;
    color:rgba(0,0,0,0.5);
    letter-spacing: 10px;
}
.posts-contact input[type="text"],
.posts-contact input[type="tel"],
.posts-contact input[type="email"],
.posts-contact textarea
{
    background-color:#fff;
    box-shadow: 0px 0px 0px;
    text-shadow: none;
    color:rgba(0,0,0,0.75);
    font-family:'Lato', sans-serif;
    border:1px solid #c7c7c7;
    letter-spacing: 1px;
}
textarea
{
    font-family:'Lato', sans-serif;
}
input[type='submit']
{
    background-color:#75b4e2;
    width:171px;
    height:48px;
    border:1px solid #4484b4;
    color:#fff;
    font-family:'Lato', sans-serif;
    font-weight:bold;
    margin-top:28px;
}
input[type='submit']:hover
{
    cursor:pointer;
}
#error
{
    color:#f00;
    font-size:17px;
    padding: 5px;
    font-family: "Lato",sans-serif;
}
#success
{
    color:#2add37;
    font-size:17px;
    padding:5px;
    font-family: "Lato",sans-serif;
}

Note:-
1. Please whenever you use this contact form please change the email address inside send.php file which is wrapped in $myemail variable otherwise I’ll get all your mails.
2. It is possible that you can not find the mail in your inbox. So don’t forget to check spam folder
3. Keep all 4 files in the same folder.
4. You need a server to check this. Without server its just a static contact form. It will work only online.
If you want to see the live example of this form you can go to my testing server i.e jaiupur4ever .

To watch the video of php mail function

How to make Vertical Drop-Down Navigation using HTML, CSS3 and jQuery ?

Description:- In today’s example I’m gonna show you how to make vertical drop-down navigation menu. You can use it in your site or in your admin dashboard like I did. So for this we need to download jquery file so go to http://code.jquery.com/jquery-1.11.3.min.js and download it and save it in your folder.

So, here is the finish product’s images in first image you can see only 5 menus with down arrow but after click on courses link it expands and the sub menus of courses will appear with the arrow facing to the upper direction.

pic1

pic2

Code is below just change the names of list items and use it or play with the colors or do whatever you want to do peeps.

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Menu</title>
<script type="text/javascript" src="jquery-1.11.3.min.js"></script>
<script>
$(document).ready(function(e) {
$(".course-sub").click(function(e){
$(this).toggleClass("roll");
});
});

</script>
<style>
*{padding:0px; margin:0px;}
.nav{width:250px; background:rgba(51,51,51,1);}
.nav a{display:block;padding:10px 0px 10px 20px; text-decoration:none; border-bottom:1px dotted gray;color:#fff; letter-spacing:.2em; text-transform:uppercase; transition:all 0.3s linear;}
.nav a:hover{background:#dd0909;}
.nav li{list-style:none;}
.nav-ul ul{display:none;}
.nav-ul li.roll ul{display:block;}
.arrow:after{content:'\203A'; float:right; margin-right:20px; transform:rotate(90deg); font-size:20px;}
.nav li.tap .arrow:after{content:'\2039';}
.nav-ul ul a:before{content:'\203A'; margin-right:20px;}

</style>
</head>
<body>
<nav class="nav">
<ul class="nav-ul">
<li><a href="#">Home</a></li>
<li class="course-sub"><a href="#">Courses<span class="arrow"></span></a>
<ul>
<li><a href="#">HTML5</a></li>
<li><a href="#">CSS3</a></li>
<li><a href="#">JavaScript</a></li>
<li><a href="#">jQuery</a></li>
</ul>
</li>
<li><a href="#">Services</a></li>
<li><a href="#">About Us</a></li>
<li><a href="#">Contact Us</a></li>

</ul>


</nav>

</body>
</html>

*Note:- Don’t forget to include jQuery file.

How to upload multiple images in one time through PHP ?

Description:- Through this example you can easily come to know how to upload multiple images in one time by selecting the images through ctrl button.

<!-- Uploading multifiles by webtechball -->
<!-- www.webtechball.wordpress.com -->
<!DOCTYPE html>
<head>
<title>Multifile uploading by Webtechball</title>
<style>
img{margin:10px 0 0 10px; border:1px inset rgba(51,51,51,1);}
</style>
</head>
<body>
<center>
<form action="<?php $_PHP_SELF; ?>" method="post" enctype="multipart/form-data">
    <input type="file" name="multiImgs[]" multiple/> 
    <input type="submit" name="upload" value="Upload"/>
</form>

<?php
if(isset($_REQUEST['upload']))
{
    //Inserting the name of the files into the loop, so that it will upload each and every file
    for($a=0; $a < count($_FILES['multiImgs']['name']); $a++)
    {
        move_uploaded_file($_FILES['multiImgs']['tmp_name'][$a],"upload/".$_FILES['multiImgs']['name'][$a]);
        echo "<img src='upload/".$_FILES['multiImgs']['name'][$a]."' width=100px height=100px/>"
        //Printing each and every files with loop
    }
}

?>
</center>
</body>
</html>

*Note :- Copy the code and paste in your text editor and save it in your htdocs and
don’t forget to create a new folder and rename it as “upload”. This will be your folder where your uploaded files will going to be save.