Day: January 20, 2018

How to checked checkbox is checked or not using PHP?

If you want to check that which checkbox checked and which not checked using php . Then you can check this simple code which give you this option.

<?php
if(isset($_POST['submit']))
{
  if(isset($_POST['submit']))
    {
       // $x = cout($_POST['checkbox']);
        for($x = 0;$x <= 4;$x++)
        {
            if(strlen($_POST['checkbox'][$x])>1)
            {
                echo "Checkbox is cheked<br>";
            }
            else{
                echo "Checkbox not checked<br>";
            }
        }
    }
 
 
}
 
 
?>

This is html code

<html>
<head>
 
</head>
<body>
<form enctype="multipart/form-data" action="" method="POST">
    <div id="text">
        <input type="checkbox" name="checkbox[0]"  />Checkbox1<br>
        <input type="checkbox" name="checkbox[1]"  />Checkbox2<br>
        <input type="checkbox" name="checkbox[2]"  />Checkbox3<br>
        <input type="checkbox" name="checkbox[3]"  />Checkbox4<br>
        <input type="checkbox" name="checkbox[4]"  />Checkbox5<br>
 
    </div>
    <input type="submit" value="Submit" name="submit" id="submit" />
</form>
</body>
</html>

Hope it will help you. If you find any problem then please inform me. i will try to help you

Comment

How to auto reload and clear cache using Javascript?

If you want to reload page automatically and at a time you want to clear cache then you can do this using javascript. This is simple code which reload after 3 seconds

 

<pre class="brush: xml; title: ; notranslate" title=""><!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js">
</script>
<script>
$(document).ready(function(){
setInterval(function(){cache_clear()},3000);
});
function cache_clear()
{
window.location.reload(true); // if you do not want to clear cache then use window.location.reload();
}
</script>
</head>

<body>
<p>Auto reload and clear cache</p>
</body>
</html></pre>

Hope it will help you. If you face any problem then please inform me.

Comment

Phpstrom Editor Some Important Tips


-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-ea
Just change Xmx 512 m this value. then save it. sometime this file not save normally then save it other folder then replace this in bin folder. Restart phpstrom editor .You will see new define memory in right bottom side.

2. How to show line number ?

Ans: goto file->setting from top menu then you will see a screen . goto <span style="color: #993300;">editor tab-> appearance</span> then you will see

Show line number checkbox . Check it.

3. Goto line number ->Ctrl+g

4. Find Ctrl+f

5. Find and replace Ctrl+r

6. Find in path Ctrl+shift+f

7. Replace in path Ctrl+shift+r

8. Any comment ctrl+shift+/

9. Goto end tag ctrl+}

10. Format code ctrl+alt+l

11. goto include file then click this file name

12. Goto start tag ctrl+{
13. Find total function list and file list which include ctrl+F12

For more setting go to file->setting from top menu then go to keymap from "editor->keymap".



 

if you face any problem then please inform me.

Comment