Abraham Garcia in PHP Scripts   Tuesday, September 12 2017

Upload a File to AWS S3 Bucket with PHP SDK

This is a sample PHP script on how to upload a file to AWS S3 using PHP SDK

This is a sample script on how to upload a file via the PHP AWS SDK.  require('./aws/aws-autoloader.php'); use Aws\S3\S3Client; $bucket = 'mybucketname'; $s3 = S3Client::factory(array( 'region' => 'us-west-2', 'version' => 'latest',

Continue reading
Abraham Garcia in PHP Scripts   Wednesday, August 2 2017

PHP Function to Get Client IP Address

A small function to retrieve the ip address of the user. This uses the PHP Server Method.

This is a function on how to retrieve users ip address. Use this for you projects. function get_client_ip() { $ipaddress = ''; if (isset($_SERVER['HTTP_CLIENT_IP'])) $ipaddress = $_SERVER['HTTP_CLIENT_IP']; else if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $ipaddress

Continue reading
Abraham Garcia in PHP Scripts   Thursday, March 9 2017

How to Send email with PHP and SendGrid

Here are a few examples on how to send email with PHP and SendGrid. Also examples on how to use cURL or SMTPAPI headers.

Here are a few examples on how to send email with PHP and SendGrid.  What is SendGrid? Founded in 2009, after graduating from the TechStars program, SendGrid developed an industry-disrupting,

Continue reading
Abraham Garcia in PHP Scripts   Tuesday, August 9 2016

Twilio SMS PHP Sample

Learn how to send SMS message with Twilio PHP SDK

Twilio is one of the fastest growing telecommunications company. Just last month they launched their IPO. As time passes twilio is bring new features for developers that are being used

Continue reading
Abraham Garcia in PHP Scripts   Friday, February 12 2016

How To Get Gravatar Image via PHP

How to get Gravatar image and insert it into your projects with a simple function

This is a useful function to get the gravatar image into your projects. $email = "someone@somewhere.com"; $default = "http://www.somewhere.com/homestar.jpg"; $size = 40; $grav_url = "http://www.gravatar.com/avatar/" . md5( strtolower( trim( $email

Continue reading