I wrote some APIs in PHP to expose my website to a greater no of audience.
Now, can anyone help to know how I can secure them using O-Auth.


- <?php
- define('_JEXEC', 1);
- define('_API', 1);
- define('JPATH_BASE', dirname(dirname(dirname(__FILE__))));
- // Include the Joomla framework
- require_once JPATH_BASE . '/includes/defines.php';
- require_once JPATH_BASE . '/includes/framework.php';


- <?php
- if(isset($_POST['submit']))
- {
- $email_from = $_POST['email'];
- $email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
- if(preg_match($email_exp,$email_from)) {
- echo 'The Email Address you entered does not appear to be valid.';
- }
- else
- {

if ($var) {}
or
if (!$var) {}
2: Null or false value:

$password = bcrypt('secret'); $password = Hash::make('secret');


copy(used in PHP 4, PHP 5)
copy (string $source, string $destination);
- See full Blog at: How to Copy Files in PHP.
class grandParent
{
//Body of your class
}
class parent extends grandParent
{
//Body Of your class
}
Read the full Blog at: Inheritance in PHP .
/**
* Add logo in theme customize option
*/
add_action( 'customize_register', 'themename_customize_register' );
function themename_customize_register($wp_customize) {
$wp_customize->add_section( 'ignite_custom_logo', array(
'title' => 'Logo',
'description' => 'Display a custom logo?',
'priority' => 25,
) );
$wp_customize->add_setting( 'custom_logo', array(
'default' =>; '',
) );
- See full Blog at: Add Logo in Theme Customize Option in Wordpress
- /**
- * Add logo in theme customize option
- */
- add_action( 'customize_register', 'themename_customize_register' );
- function themename_customize_register($wp_customize) {
- $wp_customize->add_section( 'ignite_custom_logo', array(
- 'title' => 'Logo',
- 'description' => 'Display a custom logo?',
- 'priority' => 25,
- ) );
- $wp_customize->add_setting( 'custom_logo', array(
- 'default' =>; '',
- ) );
- $distance_one_latitude = 30.364267;
- $distance_two_latitude = 30.324860;
- $distance_one_longitude = 78.087412;
- $distance_two_longitude = 78.052046;
- .cake-sql-log {
- position:fixed;
- top:99%;
- z-index:10;
- width:100%;
- background-color:black;
- color:white;
- border-collapse:collapse;