Press enter to see results or esc to cancel.

Abraham Garcia Abraham Garcia in PHP Scripts   Thursday, October 5 2017

How to get POST Variables from Multiple Checkbox Values

A short example on how to get the values of multiple checkbox in a form.

In order to get multiple post variables from checkboxes in your form. You can use the following login in your forms.  <form action="test.php" method="post"> <input type="checkbox" name="check_list[]" value="value 1"> <input

Continue reading
Abraham Garcia 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'

Continue reading
Abraham Garcia 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

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Tuesday, April 25 2017

How to Download Most Recent FTP Files Via PHP

A simple PHP script that allows you to download the most recent FTP files from your server.

Want to download your latest FTP files via PHP? Using this php script can help you download the most recent FTP files using plain PHP.  // connect $conn = ftp_connect('ftp.addr.com'); ftp_login($conn, 'user', 'pass'); // get list of files

Continue reading
Abraham Garcia 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, cloud-based email service to solve the challenges

Continue reading
Twilio SMS PHP Sample
Abraham Garcia 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 all around the world.  Today i am going to intruced on of

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Monday, August 8 2016

How to get all Wednesdays of a Month PHP

A PHP function on how to retrieve a certain day from the week like Wednesday. Grab every Wednesday from the week.

The other week i had to figure out how to get all wednesdays from a week. While browsing online i found something on stackoverflow that i think might help you guys writting this function.  With PHP5.3 function getWednesdays($y, $m) {

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Friday, March 18 2016

Array Search in Query Where Statement

This is a small example on how to run a query with an array inside the WHERE clause. I hope this can help you in your projects.

This is a small example on how to run a query with an array inside the WHERE clause. I hope this can help you in your projects.  $ids = array( "1", "2", "3", "4" ); $idsStr = implode(',', $ids); SELECT * FROM table WHERE id IN

Continue reading
Abraham Garcia 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(

Continue reading
Abraham Garcia Abraham Garcia in PHP Scripts   Tuesday, December 8 2015

How to Set Width on Imagine Framework

Learn how to use imagine image class. Use this to resize widen image and keep aspect ratio.

This is a tutorial on how to set width only on image. This is done with widen function. This is very useful when you want to size an image to a certain width and keep aspect ratio for the height. $imagine = new \Imagine\Gd\Imagine(); $image =

Continue reading