In this post we have explained about how to generate strong password in PHP. Following function is very easy to generate strong password with alphanumeric and custom special characters too.

generate_strong_password_in_php

(more…)

In this article we have explained about how to upload an image with resize using simple php script. Save image as your width and height.

In HTML:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>Upload Image File and Resized</title>
		<style>
			.success{
				color:green;
			} 
			.error{
				color:red;
			}
		</style>
	</head>
	<body>
		<form enctype="multipart/form-data" action="" method="post">
			<input type="file" name="files" />
			<input type="submit" value="Upload File" name="upload"/>
		</form>
	</body>
</html>

(more…)

In this  article we have explained about how to create custom Helper in Codeigniter. Helper is a group of functions but it is not a class.

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

if ( ! function_exists('sample_method'))
{
    function sample_method($var = '')
    {
        return $var;
    }   
}

(more…)

To avoid the illegal words in your content as you are using codeigniter provide word_censor functions.Here we are brief explain about this function. First you mention what are the words are you going to skip from the content. Those values are maintain your table.

Table:

CREATE TABLE `test`.`get_illegal_words` (`word_id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `illegal_word` VARCHAR(255) NOT NULL) ENGINE = InnoDB;

(more…)

When you are integrating google maps for locations you may need to know their latitude and longitude values. In that time pass your address through maps.google.com for api request.It returns the values as json output. The values are stored into database. So next time you can search the location in table. If it is not found you can send api request and store it.Why we are store the values in database because to avoid of frequent usage this is free api even it has some limit of access. when we frequent request the server doesn’t respond immediately. So that’s why we store the values.

In php:

For example

$prepAddr="Atlanda";

$geocode=file_get_contents('http://maps.google.com/maps/api/geocode/json?address='.$prepAddr.'&sensor=false');

$output= json_decode($geocode);

$lat = $output->results[0]->geometry->location->lat;
$long = $output->results[0]->geometry->location->lng;

Database:

CREATE TABLE `test`.`geocode` (`location_id` INT(11) NOT NULL AUTO_INCREMENT PRIMARY KEY, `city_name` VARCHAR(255) NOT NULL, `latitude` VARCHAR(255) NOT NULL, `longitude` VARCHAR(255) NOT NULL, `status` TINYINT(2) NOT NULL DEFAULT '1' COMMENT '1-Active,0-Deactive') ENGINE = InnoDB;

 

Subscribe Our Channel

Email Subscription
Watch Tutorials
Loading
Copyright © 2015 - 2021 PHPEXPERTISE.COM