Perform two actions when clicking the button using jquery triggering



<script src="jquery.js"></script>
<script>
$(document).ready(function(){

 $(".d").click(function(){
 $("input").trigger("click");
 });
});
function sd() {
alert('balas')
}
</script>
</head>
<body>
<div class='link'>Click to see my name...</div>
<input type="submit" name="FirstName" onclick='sd()' value="My name" />

To see demo goto w3schools and copy/paste the above code

Adding menu page in admin end with WordPress


<?php
function file_admin() {
  include 'file.php';
}
 adding menu page => inside parameters with arrangements 1) page_title, 2) menu title, 3) capability, 4) file, 5) function, 6) icon, 7) position
 add_menu_page('Caros', 'Caros', 'read', 'caros/file.php', 'file_admin', 'images/menu.png','7');
 ?>
Getting custom field values
<?php $url = get_post_custom_values('url'); echo $url[0];?>
 

Scan images inside folder with PHP


</pre>
<?php
 $image_path = 'images/';
 $tch = '';
 if(is_dir($image_path))
 {
 $siteurl = 'http://example.com';
 if (substr($siteurl , -1) !== '/')
 {
 $siteurl = $siteurl ."/";
 }
 $tch_dirhandle = opendir($image_path);
 while ($tch_file = readdir($tch_dirhandle))
 {
 $tch_file_nocaps = $tch_file;
 $tch_file = strtoupper($tch_file);
 if(!is_dir($tch_file) && ((strpos($tch_file, '.JPG')>0) or (strpos($tch_file, '.GIF')>0) or (strpos($tch_file, '.PNG')>0) or (strpos($tch_file, '.JPEG')>0)))
 {
 echo "<a href='".$siteurl . $image_path . $tch_file_nocaps."' rel='lightbox'>";
 echo "<img class='siteimg' src='".$siteurl . $image_path . $tch_file_nocaps."' /></a>";
 }
 }
 }
 ?>