Sunday, 22 October 2023

insert Youtube video in webpage with auto play function

 <!DOCTYPE html>

<html>

    <head>

        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=2.0, minimum-scale=1.0, user-scalable=yes">

    </head>

  <body>

<!-- 1. The <iframe> (video player) will replace this <div> tag. -->

<div id="player"></div>


<script>

  // 2. This code loads the IFrame Player API code asynchronously.

  var tag = document.createElement('script');


  tag.src = "https://www.youtube.com/iframe_api";

  var firstScriptTag = document.getElementsByTagName('script')[0];

  firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);


  // 3. This function creates an <iframe> (and YouTube player)

  //    after the API code downloads.

  var player;

  function onYouTubeIframeAPIReady() {

    player = new YT.Player('player', {

      width: '300px',

      height: '300px',

      videoId: 'x5CrknRXWZ0',

      playerVars: { 'autoplay': 1, 'playsinline': 1 },

      events: {

        'onReady': onPlayerReady

      }

    });

  }


  // 4. The API will call this function when the video player is ready.

  function onPlayerReady(event) {

     event.target.mute();

    event.target.playVideo();

  }

</script>

  </body>

</html>

Friday, 20 October 2023

Delete Data From a MySQL Table Using MySQLi in php

 The DELETE statement is used to delete records from a table:

DELETE FROM table_name WHERE some_column = some_value

<?php

$servername = "localhost";
$username = "username";
$password = "password";
$dbname = "myDB";

// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
  die("Connection failed: " . $conn->connect_error);
}

// sql to delete a record
$sql = "DELETE FROM MyGuests WHERE id=3";

if ($conn->query($sql) === TRUE) {
  echo "Record deleted successfully";
else {
  echo "Error deleting record: " . $conn->error;
}

$conn->close();
?>

Wednesday, 18 October 2023

email address validator – Email MX DNS Record Check

Validate email instantly with our cutting-edge free online email verification tool: simply enter the email address in the box below, and our advanced email validator will provide you with real-time email deliverability results!

 

<form name="myForm" method="post" action="#">

<center><h1>Please Enter Email Address:</h1></center><br/><br />

<input type="email" style="width: 100%;height:50px;" name="email" id="email" placeholder="admin@adquash.com"><br /><br />

 <center><input type="submit" value="Check" id="dsubmit" class="btn btn-blue" name ="submit"><br/><br/> </center>

</form>

<?php

if (isset($_POST['submit'])) {

$email = $_POST['email'];

/*

* Getting Domain part from user input Email-Address

*/

$domain = substr(strrchr($email, "@"), 1);

/*

* This Function is used for fetching the MX data records to a corresponding

- Email domain

*/


function mxrecordValidate($email, $domain) {


$arr = dns_get_record($domain, DNS_MX);

if ($arr[0]['host'] == $domain && !empty($arr[0]['target'])) {

return $arr[0]['target'];

}

}


echo"<table id ='tid' >";

echo"<th>";

echo"Result";

echo"</th>";

echo"<tr>";

echo"<td>";


if (mxrecordValidate($email, $domain)) {

echo("<br>This MX records exists. <br><b>'$email' is Valid Email Address</b><br>.");

if (checkdnsrr($domain, "A")) {

    echo "$domain has an A record";

} else {

    echo "$domain does not have an A record";

}

$data = dns_get_record($domain, DNS_MX);

foreach ($data as $key1) {

echo "<br>Host:- " . $key1['host'] ;

echo "<br>Class:- " . $key1['class'] ;

echo "<br>TTL:- " . $key1['ttl'] ;

echo "<br>Type:- " . $key1['type'] ;

echo "<br>PRI:- " . $key1['pri'] ;

echo "<br>Target:- " . $key1['target'] ;

echo "<br>Target-IP:- " . gethostbyname($key1['target']) ;

}

echo"</td>";

echo"</tr>";

} else {

echo("<br>No MX record exists. '$email' is Invalid Email Address.");

}

echo"</td>";

echo"</tr>";

echo"</table>";

}

?>

Thursday, 12 October 2023

Redirect to a Random Link with This HTML Code

Copy and paste given code . You can replace link as per your requirement.


<script type="text/javascript">


var urls = new Array();

urls[0] = "https://sakhihosting.in";

urls[1] = "https://sakhihosting.in/domain-registration/index.php";

urls[2] = "https://sakhihosting.in/web-hosting/index.php";

urls[4] = "https://sakhihosting.in/virtualserverlinux-hosting.php";

urls[5] = "https://sakhihosting.in/dedicated-servers.php";

urls[6] = "https://sakhihosting.in/dedicated-servers-windows.php";

urls[7] = "https://sakhihosting.in/web-hosting/windows-hosting.php";

urls[8] = "https://sakhihosting.in/optimized-wordpress-hosting.php";

urls[9] = "https://sakhihosting.in/reseller-hosting.php";

urls[10] = "https://sakhihosting.in/support/contact-us.php";


var random = Math.floor(Math.random()*urls.length);


window.location = urls[random];


</script>