Posts

Showing posts with the label PHP

date_diff function in php

////////////////////////////////////////////////////////////////////// //PARA: Date Should In YYYY-MM-DD Format //RESULT FORMAT: // '%y Year %m Month %d Day %h Hours %i Minute %s Seconds'        =>  1 Year 3 Month 14 Day 11 Hours 49 Minute 36 Seconds // '%y Year %m Month %d Day'                                    =>  1 Year 3 Month 14 Days // '%m Month %d Day'                                            =>  3 Month 14 Day // '%d Day %h Hours'                                            =>  14 Day 11 Hours // '%d Day'                                 ...

How to create a custom form in wordpress

// create table in database ( must add prefix ) // create page to display form i was wrote code into front-page.php                       Name: Email Selecet Resume: Submit if(isset($_POST['submitted'])) { global $wpdb; //print_r($_FILES['res']); $filename =  basename($_FILES['res']['name']); $path = get_template_directory()."/"."upload/resume/".$filename; //echo " "; $status = false; if(move_uploaded_file($_FILES['res']['tmp_name'], $path)) { $status = ture; } if($status == true) { $tablename=$wpdb->prefix.'resume'; $date = date("Y-m-d H:i:s A"); $data=array('name' => $_POST['contactName'], 'email...

How to create Custom Menu in wordpress admin panel

// Create a file under the theme folder Yourname.php /* How to add menu into the admin */ add_action('admin_menu', 'my_menu_pages'); function my_menu_pages(){     add_menu_page('Show Recodes',  // page name         'View Resume',  // menu name         'manage_options',  // not change         'Second-menu',  //  Page is display to admin panel it is display in url         'my_menu_output', // function name         'dashicons-welcome-view-site', // icon url or icon name          3          /*             where to display             Default: bottom of menu structure #Default: bottom of menu structure             2 – Dashboard             4 – Separator     ...

Solve array challange on php

Code is : $array = array(1,2,3,5,8,13,21,34,55); $sum = 0; echo "i = array(i) = array(array(i)) "; for( $i=0;$i   echo $i. " = ".$array[$i] . "        = " .$array[$array[$i]]." ";   $sum += $array[$array[$i]]; } echo $sum; Output : i = array(i) = array(array(i)) 0 = 1        = 2 1 = 2        = 3 2 = 3        = 5 3 = 5        = 13 4 = 8        = 55 78