<?php
//PHP Server Side Form Validation
if(isset($_POST['Submit'])){

  $emp_name=trim($_POST["emp_name"]);
  $emp_number=trim($_POST["emp_number"]);
  $emp_email=trim($_POST["emp_email"]);

  if($emp_name =="") {
    $errorMsg=  "error : You did not enter a name.";
    $code= "1" ;
  }
  elseif($emp_number == "") {
    $errorMsg=  "error : Please enter number.";
    $code= "2";
  }
  //check if the number field is numeric
  elseif(is_numeric(trim($emp_number)) == false){
    $errorMsg=  "error : Please enter numeric value.";
    $code= "2";
  }
  elseif(strlen($emp_number)<10){
    $errorMsg=  "error : Number should be ten digits.";
    $code= "2";
  }
  //check if email field is empty
  elseif($emp_email == ""){
    $errorMsg=  "error : You did not enter a email.";
    $code= "3";
} //check for valid email 
elseif(!preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $emp_email)){
  $errorMsg= 'error : You did not enter a valid email.';
  $code= "3";
}
else{
  echo "Success";
  //final code will execute here.
}

}
?>
<!DOCTYPE html>
<html>
<head>
 <meta charset="utf-8">
 <title>Employee Information Sample HTML Form</title>
 <style type="text/css" >
  .errorMsg{border:1px solid red; }
  .message{color: red; font-weight:bold; }
 </style>
</head>

<body>
  <?php if (isset($errorMsg)) { echo "<p class='message'>" .$errorMsg. "</p>" ;} ?>

<form name= "registration" id= "registration" method= "post" action= "">
<table width= "400" border= "0" align="center" cellpadding= "4" cellspacing= "1">
<tr>
<td>Employee Name:</td>
<td><input name= "emp_name" type= "text" id="emp_name" value="<?php if(isset($name)){echo $name;} ?>"
<?php if(isset($code) && $code == 1){echo "class=errorMsg" ;} ?> ></td>
</tr>
<tr>
<td>Contact No.: </td>
<td><input name= "emp_number" type= "text" id= "emp_number" value="<?php if(isset($number)){echo $number;} ?>"
<?php if(isset($code) && $code == 2){echo "class=errorMsg" ;}?> ></td>
</tr>
<tr>
<td> Personal Email: </td>
<td><input name= "emp_email" type= "text" id= "emp_email" value="<?php if(isset($email)){echo $email; }?>"
<?php if(isset($code) && $code == 3){echo "class=errorMsg" ;}?> ></td>
</tr>
<tr>
<td></td>
<td><input type= "submit" name= "Submit" value= "Submit"></td>
</tr>
</table>
</form>

</body>
</html>

======================


<?php


/*
https://stackoverflow.com/questions/7753365/php-preg-match-only-allow-alphanumeric-strings-and-characters/7753399


if(preg_match('/[^a-z_\-0-9]/i', $string))
{
  echo "not valid string";
}

Explanation:

[] => character class definition
^ => negate the class
a-z => chars from 'a' to 'z'
_ => underscore
- => hyphen '-' (You need to escape it)
0-9 => numbers (from zero to nine)
The 'i' modifier at the end of the regex is for 'case-insensitive' if you don't put that you will need to add the upper case characters in the code before by doing A-Z
 */

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

  $emp_name=trim($_POST["emp_name"]);

  if(preg_match('/[^a-z_\-0-9]/i', $emp_name)){
    $errorMsg=  "error : You did not enter a valid name.";
    $code= "1" ;
  }
  else{
      echo "Success";
      //final code will execute here.
    }

}
?>
<!DOCTYPE html>
<html>
<head>
 <meta charset="utf-8">
 <title>Employee Information Sample HTML Form</title>
 <style type="text/css" >
  .errorMsg{border:1px solid red; }
  .message{color: red; font-weight:bold; }
 </style>
</head>

<body>
  <?php if (isset($errorMsg)) { echo "<p class='message'>" .$errorMsg. "</p>" ;} ?>

<form name= "registration" id= "registration" method= "post" action= "">
<table width= "400" border= "0" align="center" cellpadding= "4" cellspacing= "1">
<tr>
<td>Employee Name:</td>
<td><input name= "emp_name" type= "text" id="emp_name" value="<?php if(isset($name)){echo $name;} ?>"
<?php if(isset($code) && $code == 1){echo "class=errorMsg" ;} ?> ></td>
</tr>
<tr>
<td></td>
<td><input type= "submit" name= "Submit" value= "Submit"></td>
</tr>
</table>
</form>

</body>
</html>

==============================


<?php
$valid = true;
$lang = 'french';


if( $valid ) {
    $x = 'yes';
} else {
    $x = 'no';
}

echo "using If else Conditions:".$x;
echo "<br/>";

$x = $valid ? 'yes' : 'no';
echo "using ternary Conditions:".$x;
echo "<br/>";


$x = $valid ? ($lang === 'french' ? 'oui' : 'yes') : ($lang === 'french' ? 'non' : 'no');
echo "using Multiple ternary Conditions:".$x; // outputs 'oui'
echo "<br/>";


/* Ternary shorthand */

$counter = "";

if( $counter ) {
    $counter = $counter;
} else {
    $counter = 1;
}

echo "Way 1: using if else ternary Conditions:".$counter;
echo "<br/>";


if( !$counter ) {
    $counter = 1;
}

echo "Way 2: using shorthand ternary Conditions:".$counter; 
echo "<br/>";

$counter = $counter ?: 1;
echo "Way 3: using Best way to ternary Conditions:".$counter; 
echo "<br/>";

?>

https://lzone.de/cheat-sheet/PHP

========================
    "message": "Unsupported get request. Object with ID '' does not exist, cannot be loaded due to missing permissions, or does not support this operation. Please read the Graph API documentation at https://developers.facebook.com/docs/graph-api",

https://developers.facebook.com/docs/marketing-api/access/
https://tecadmin.net/install-google-chrome-in-ubuntu/


===============================



How To Get Fulfillment priority in shopify API
How To Get Fulfillment priority using location in shopify API
Locations API - fulfillment priority
locations api - fulfillment priority in shopify
shopify api get all fulfillment priority locations

"Fulfill online orders from this location" option status through Location API



Is there a way how to retrieve the fulfillment priority of the locations?

The location resource GET /admin/locations.json is not sorted by the fulfillment priority from shopify admin and there is no attribute like priority on the location.



"Fulfill online orders from this location" option status through Location API


Hi shopify API Dev.,

I've 3 locations in my shopify store, but in one of them the option "Fulfill online orders from this location" is disabled. When I retrieve locations list though Inventory API https://help.shopify.com/en/api/reference/inventory/location#index it doesn't return any information about the "Fulfill online orders from this location" option status.
Is there a different API where I can fetch this info? Or could you please add an appropriate field in locations for Inventory API responses? 
Thanks

in_array
is_array
isset
ternory opertors

addslashes
stripslashes
htmlspecialchars
html_entity_decode

json_encode

file_get_contents('php://input');


===============


  Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /var/www/ajax_app.php on line 1773

  =============================

  https://stackoverflow.com/questions/29278909/how-to-get-a-listing-of-product-catalogs-from-a-business-manager-with-developmen


==========================

How to use since Id in Order Api Method


https://feedarmy.com/kb/how-to-enable-shopping-actions-in-google-merchant-center/

https://support.geekseller.com/knowledgebase/setting-up-shopping-actions/

---------------

https://tecadmin.net/check-laravel-version/
https://tecadmin.net/install-php-7-on-ubuntu/
https://asdqwe.net/


Upgrade PHP 7.3 

sudo apt-get install php-zip
sudo apt-get install php7.3-zip
sudo service apache2 restart

-------------------------------------

How to Solve the XAMPP 1.7.7 - PHPMyAdmin - MySQL Error #2002 in Ubuntu


Way 1: 

1: Open config.default.php file under phpmyadmin/libraries/
2: Find $cfg['Servers'][$i]['host'] = 'localhost'; Change to $cfg['Servers'][$i]['host'] = '127.0.0.1';
3: refresh your phpmyadmin page, login


/* Authentication type */
$cfg['Servers'][$i]['auth_type'] = 'config';

$cfg['Servers'][$i]['user'] = 'root';
$cfg['Servers'][$i]['password'] = '';
/* Server parameters */
$cfg['Servers'][$i]['host'] = 'localhost';
$cfg['Servers'][$i]['compress'] = false;
$cfg['Servers'][$i]['AllowNoPassword'] = true;


$cfg['Servers'][$i]['host'] = 'localhost';

into 

$cfg['Servers'][$i]['host'] = '127.0.0.1';

sudo /etc/init.d/apache2 stop
sudo /etc/init.d/mysql stop
sudo /opt/lampp/lampp start