lunes, 6 de diciembre de 2021

php get time zome based on current time


$date = new DateTime();

$date->setTimezone(new DateTimeZone('America/Detroit'));

echo $fdate = $date->format('Y-m-d H:i:s');

https://www.php.net/manual/en/timezones.php

https://compass.greatdata.com/areacode/currenttime

lunes, 1 de noviembre de 2021

Javascript confirmaton

 <a href="delete.php?id=22" onclick="return confirm('Are you sure you want to delete?')">Link</a>


miércoles, 27 de octubre de 2021

HTML autoplay

 <head> 

    <title> 

        HTML audio autoplay Attribute

    </title> 

</head> 

  

<body style="text-align: center"> 

  

    <h1 style="color: green"> 

        GeeksforGeeks 

    </h1> 

      

    <h2>HTML audio autoplay Attribute</h2> 

  

    <audio controls autoplay> 

        <source src="GFG.ogg" type="audio/ogg"> 

        <source src="https://www.mboxdrive.com/Alarm-Fast-A1-www.fesliyanstudios.com.mp3" type="audio/mpeg"> 

    </audio> 

</body> 

  

</html>

viernes, 8 de octubre de 2021

pipe drive curl

 <?php

// Content of createDeal.php

    

// Pipedrive API token

$api_token = '659c9fddb16335e48cc67114694b52074e812e03';

    

// Pipedrive company domain

$company_domain = 'theunicorntail';

 

// Deal title and Organization ID

$deal = array(

  'title' => 'Deal title goes here',

  'org_id' => 'Organization ID goes here'

);

 

$url = 'https://' . $company_domain . '.pipedrive.com/api/v1/deals?api_token=' . $api_token;

 

$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, $url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

curl_setopt($ch, CURLOPT_POST, true);

curl_setopt($ch, CURLOPT_POSTFIELDS, $deal);

 

echo 'Sending request...' . PHP_EOL;

 

$output = curl_exec($ch);

curl_close($ch);

 

// Create an array from the data that is sent back from the API

// As the original content from server is in JSON format, you need to convert it to PHP array

$result = json_decode($output, true);

 

// Check if an ID came back, if did print it out

if (!empty($result['data']['id'])) {

   echo 'Deal was added successfully!' . PHP_EOL;

}

?>

domingo, 3 de octubre de 2021

mysql delete script

 <?php

$link = mysqli_connect("localhost", "root", "", "dialer");


/* check connection */

if (mysqli_connect_errno()) {

    printf("Connect failed: %s\n", mysqli_connect_error());

    exit();

}


$query = " delete from dnc where phone='$_GET[name]'";


if ($result = mysqli_query($link, $query)) {


 header("Location:./dnc.php");



    /* free result set */

    mysqli_free_result($result);

}


else {


 printf("Error: %s\n", mysqli_error($link));


}



/* close connection */

mysqli_close($link);

?>


sábado, 25 de septiembre de 2021

dynamically-add-or-remove-form-input-fields-using-jquer

 https://bootstrapfriendly.com/blog/dynamically-add-or-remove-form-input-fields-using-jquery/


https://www.formget.com/how-to-dynamically-add-and-remove-form-fields-using-javascript/


http://demos.codexworld.com/add-remove-input-fields-dynamically-using-jquery/

lunes, 13 de septiembre de 2021

php disk space

 


<?php
    $bytes 
disk_free_space(".");
    
$si_prefix = array( 'B''KB''MB''GB''TB''EB''ZB''YB' );
    
$base 1024;
    
$class min((int)log($bytes $base) , count($si_prefix) - 1);
    echo 
$bytes '<br />';
    echo 
sprintf('%1.2f' $bytes pow($base,$class)) . ' ' $si_prefix[$class] . '<br />';
?>