Host Your PHP Websites With EasyPHP

Posted on October 3rd, 2007 in Softwares | No Comments »

Easyphp

I quite remember the hurdle I went through getting a good apache+mysql software to test my PHP Applications locally before I uploaded them onto the net.

My problem was getting a one-stop-software that could satisfy all the basic needs in hosting a php website.

I used quite a number of softwares but one that stood out amongst the rest was EasyPHP.

EasyPHP technically had all that I wanted to do my php coding from image processing, xml parsing to code encryption. It has an inbuilt phpmyadmin as well to help you build your mysql database.

EasyPHP is a complete software package allowing to use all the power and the flexibility that offers the dynamic language PHP and the effecient use of databases under Windows. Package includes an Apache server, a MySQL database, a fully PHP execution, as well as easy development tools for your web site or your applications.

The current version is EASYPHP 2.0 beta 1, and it contains Apache 2.2.3, PHP 5.2.0, MySQL 5.0.27, phpMyAdmin 2.9.1.1 and SQLiteManager 1.2.0.

Via Easyphp.org

Easyphp supports many languages including French and English.

From Text Messaging to Data Protection

Posted on October 1st, 2007 in HTTP/S | 2 Comments »

Clickatell

I have successfully completed my tutorials on how to Send SMS Message Using Clickatell API with a php script. The responses I have gotten so far are quite ok, so that means I am going to be moving to other topics in the subsequent weeks.

A friend of mine wants me to give more information about data maintenance and security in my subsequent articles and so in the next couple of weeks I will be doing more work on data handling.

Some of the vital topics I am going to be writing about are Continuous Data Protection, File Synchronization and Remote Access.

It will also include general tips on Data Protection, from backing up data to restoring data in all forms. Interesting features will also be given on the various kinds of Data and File Synchronization.

Whilst waiting for me to write on the above mentioned articles, you can check on Tilana Systems for the range of products they offer.

By the way have u heard of the current RSS battle between some top weblog monguls? More coming later

Send SMS Message Using Clickatell API – Part 7

Posted on October 1st, 2007 in HTTP/S, PHP Tutorials | No Comments »

After going through the first 6 parts of this tutorial, I realized I could do more to check the status of an sms message so i decided to add this part of the tutorial.

What this does is to check the status and charge of a message by your self just in case the callback url doesn’t give you the required feedback on time. Meaning this tutorial will help you to manual query the clickatell gateway to check the status of your sms message.

All you have to do is to create a page “status.php” and use the code below.

status.php

<?php
//*********************************************** //
// Send SMS Message Using Clickatell API – Part 7
// 23rd September 2007
// www.mboateng.com
// Michael Ofori Amanfo Boateng
//
//********************************************

echo “loading……”;

require_once(’settings.php’);

// auth call
$url = “http://api.clickatell.com/http/auth?user=$user”;
$url = $url.”&password=$password&api_id=$api_id”;
$ret = file($url);

// split our response. return string is on first line of the data returned
$sess = split(”:”,$ret[0]);
$sess_id = trim($sess[1]);

mysql_select_db($database_conn, $conn);
$result1 = mysql_query(”select * from tbl_outbox where status <> ‘004′ and dayofyear(now()) – dayofyear(dated) < 1 limit 10″,$conn);
$result2 = mysql_num_rows($result1);

while ($mydata1 = mysql_fetch_array($result1)){
$messageid = $mydata1['messageid'];
$api = trim($mydata1['apimsgid']);

//////////////////////////////////////////////
/////////////////////////////////////////////
// check charge
$charge_url = “$baseurl/http/getmsgcharge?session_id=$sess_id”;
$charge_url = $charge_url.”&apimsgid=$api”;
$charge_return = file($charge_url);

foreach($charge_return as $item){

$findapi = strpos($item, “apiMsgId:”);
$findcharge = strpos($item, “charge:”);
$findstatus = strpos($item, “status:”);

$length = strlen($item);

//Find the apimsgid
$part1 = substr($item, $findapi,$findstatus );
$part2no = strpos($item, $part1);

$api = trim(substr($item, $findapi,$findcharge ));
$status= trim(substr($item, $findstatus,$length ));
$charge= trim(substr($item, $findcharge, $findstatus – $findcharge ));

//find charge
$ret = $charge;
$sess = split(”:”,$ret);
$charge = trim($sess[1]);

//find status
$ret = $status;
$sess = split(”:”,$ret);
$status = trim($sess[1]);

mysql_select_db($database_conn, $conn);
$sql = “update tbl_outbox set status = ‘$status’ , charge = ‘$charge’ where messageid =$messageid”;
$result = mysql_query($sql, $conn) or die(mysql_error());
}
}
mysql_free_result($result1);

echo “Update Completed”;

?>

Download Tutorial >>

Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

Free Text Messaging On Textforfree.net

Posted on September 30th, 2007 in Free SMS Text | 1 Comment »

textforfree

My quest for more free sms messaging websites has become interesting as I just found another interesting website Textforfree.net that allows users to send free text messages on their website.

What makes this Textforfree.net more unique is that, unlike the other SMS messaging websites; you don’t have to register to be able to send a message. You only logon to their website, enter the recipients phone number, type your text message and you are done.

They also have an option that allows you to choose the receiver’s cellular phone service provider if you know it. You can also type a subject for your sms message.

They also have a widget on their website which you can use to Add Text Messaging to your Myspace Profile, Blog or Website.

Here at Text For Free, we know that you are tired of paying text messaging fees. That’s why you can now send free text messages to almost any USA cell phone provider. Its 100% free texting, with no catch!

You can even prank your friends because we offer anonymous text messaging, which means that your friends will never know who sent them the text message!

Text For Free offers spam free text messaging, meaning we will never send you unwanted text messages or share your cell number with anybody. What are you waiting for? Stop spending and start texting for free.

Visit Textfornet.net and start having fun>>

Send SMS Message Using Clickatell API – Part 6

Posted on September 29th, 2007 in HTTP/S, PHP Tutorials | No Comments »

The last part of the tutorial is using the callback url feature of the clickatell api. This feature allows the Clickatell gateway to forward message status details of the sms message you sent back to your server, through the url you provided on your control panel. This is quite tricky but its simple.

All you have to do is to log on to clickatell’s control panel, and choose the api_id you want to set your callback url.
The insert the url, eg. www.mboateng.com/callback.php.

Create a file “callback.php” on your server and paste the code below.

What will happen is that, any time you send an SMS Message to Clickatell’s gateway, it will forward the response in a url form to which ever url you will provide as your callback url.

callback.php

<?php
//**************************************************
//
// Send SMS Message Using Clickatell API – Part 6
// 23rd September 2007
// www.mboateng.com
// Michael Ofori Amanfo Boateng
//
//**************************************************

require_once(’settings.php’);

// Declare variables for url string
$url = $_SERVER['QUERY_STRING'];

$api_id = $_GET['api_id'];
$from = $_GET['from'];
$to = $_GET['to'];
$text = $_GET['text'];
$dated = $_GET['timestamp'];
$apiMsgId = trim($_GET['apiMsgId']);
$status = $_GET['status'];
$charge = $_GET['charge'];

mysql_select_db($database_conn, $conn);
$sql = “update tbl_outbox set url=’$url’, status = ‘$status’, charge = ‘$charge’ where apimsgid = ‘$apiMsgId’”;
$result = mysql_query($sql, $conn) or die(mysql_error());

mysql_free_result($rsOutbox);
?>

Download Tutorial >>

Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

Zingku: Google’s Next Acquisition

Posted on September 28th, 2007 in SMS Messaging | No Comments »

zingku

For all you Google followers who felt Google’s age of acquisition was over, you should be bracing yourself for more news. From Youtube to DoubleClick to Dogbeball , Google’s next stop is a Mobile Social Network – Zingku.

So that means mobile and sms fanatics who have been enjoying free sms on google’s sms platform should be looking at getting more from google.

About Zingku

Our service is designed from the mobile phone, outward, allowing you to create and exchange things of interest ranging from invitations to “mobile flyers” with friends in a trusted manner. On the mobile phone, Zingku uses standard text messaging and picture messaging features that come with every phone. On the web, our service uses your standard web browser and instant messenger. There is nothing to install.

With Zingku, things you wish to promote or share, can easily be created and fetched via mobile, instant messenger, and web browser. Our service integrates your mobile phone with a personalized web site so that you can easily move (zing) things back and forth between the web and and your mobile as well as powerfully connect with friends and optionally their friends.

Note: The service is limited to the US and, until Zingku migrates to Google’s servers, you can’t create a new account.

Read More about Zingku>>

Send SMS Message Using Clickatell API – Part 5

Posted on September 28th, 2007 in HTTP/S, PHP Tutorials | No Comments »

This part of the tutorial is probably the most important part of the whole tutorial in sending an sms message using the clickatell api. You will create a page “send.php”, then you copy and paste the php code in this page. The send.php does the following;

  1. Authenticates with the Clickatell Gateway
  2. Sends the SMS Message
  3. Retrieve the apimsgid of the corresponding Text Message
  4. Save the SMS Message and its Apimsgid into the Mysql Database

I have put comments at every step of the code so you can identify what is happening at every stage of the code.

send.php

<?php
//*******************************************
//
// Send SMS Message Using Clickatell API – Part 5
// 23rd September 2007
// www.mboateng.com
// Michael Ofori Amanfo Boateng
//
//**********************************************

require_once(’settings.php’);

//retrieve form details
$to = $_POST['to'];
$from = $_POST['from'];
$message = $_POST['message'];

function GetSQLValueString($theValue)
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

return $theValue;
}

//get magic quotes
$message = GetSQLValueString($message);

//url encode message
$message = urlencode($message);

//authenticating user
$url = “$baseurl/http/auth?user=$user&password=$password&”;
$url = $url.”api_id=$api_id&from=$from&concat=2″;
$ret = file($url);

// split our response. return string is on first line of the data returned
$sess = split(”:”,$ret[0]);
if ($sess[0] == “OK”) {
$sess_id = trim($sess[1]); // remove any whitespace

// url for sending message
$url = “$baseurl/http/sendmsg?session_id=$sess_id&”;
$url = $url.”to=$to&text=$message&from=$from&”;
$url = $url.”callback=3&deliv_ack=1&concat=2″;

// send message
$ret = file($url);
$send = split(”:”,$ret[0]);
if ($send[0] == “ID”){

// apimsgid
$apimsgid = trim($send[1]);

// insert message with its corresponding apimsgid into the table
mysql_select_db($database_conn, $conn);
$sql = “insert into tbl_outbox (sender,recipient,message,dated,apimsgid ) values (’$from’,'$to’,'$message’,now(),’$apimsgid’) “;
$result = mysql_query($sql, $conn) or die(mysql_error());

// redirect to sent.php when message is correctly sent
echo “<script language=\”JavaScript\”>”;
echo ” location.href = ’sent.php’; “;
echo “</script>”;
}
else{

// this portion is for message sending failure
echo “<script language=\”JavaScript\”>”;
echo ” location.href = ‘failed.php’; “;
echo “</script>”;

}
} else {

// this portion checks for correct authentication
echo “<script language=\”JavaScript\”>”;
echo ” location.href = ‘badlogin.php’; “;
echo “</script>”;
}

?>

Download Tutorial >>

Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

Send SMS Message Using Clickatell API – Part 4

Posted on September 26th, 2007 in HTTP/S, PHP Tutorials | No Comments »

The next thing to do is create a file “settings.php” which will store general settings for sending sms messages using clickatell’s api.

settings.php

<?php

$baseurl =”http://api.clickatell.com”;

//User details @ Clickatell
$user = “xxxx”;
$password = “xxxx”;
$api_id = “xxxxx”;

//mysql details
$hostname_conn = “xxxx”;
$database_conn = “xxxx”;
$username_conn = “xxxx”;
$password_conn = “xxxx”;
$conn = mysql_pconnect($hostname_conn, $username_conn, $password_conn) or trigger_error(mysql_error(),E_USER_ERROR);

?>

User Details @ Clickatell
//$user = This is the username assigned to you by clickatell
//$password = This your clickatell api password;
//$api_id = The api id can be generated on your clickatell control panel

User Details @ Clickatell
// $hostname_conn = This is your database hostname
//database_conn = Change this to the name of your database
// $username_conn = This is the user logon to ur database
// $password_conn = Change this to your database password

Download Tutorial >>

Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

Send SMS Message Using Clickatell API – Part 3

Posted on September 24th, 2007 in HTTP/S, PHP Tutorials | No Comments »

The next part of the tutorial is the Interface to type your SMS Message. I have designed a simple interface that you can use. You can also design one yourself; and in designing one, just make sure you have the the following three fields

  1. “to”
  2. “from”
  3. “Message”

“to”
This is the field where you type in the RECIPIENT NUMBER. Make sure it is in an international format. eg. +233244232323 or +16364545555

“from”
This is the field where you type in the either YOUR NUMBER or YOUR NAME. If you type your name, make sure you dont leave spaces.

“message”
This is the field where you type your MESSAGE. Clickatell sets the default message length to 160 characters, but you can increase it to any number you want on your Clickatell Control Panel.

Compose.php

<?php
//**************************************
//
// Send SMS Message Using Clickatell API – Part 3
// 23rd September 2007
// www.mboateng.com
// Michael Ofori Amanfo Boateng
//
//***************************************

?>

<!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=utf-8″ />
<title>Sending SMS Message with Clickatell API</title>
</head>
<body>
<table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td><form action=”send.php” method=”post” enctype=”application/x-www-form-urlencoded” name=”smssender” id=”smssender”>
<table width=”100%” border=”0″ cellpadding=”3″ cellspacing=”3″ class=”text”>
<tr>
<td>From :
<input name=”from” type=”text” id=”from” size=”20″ maxlength=”14″ />
</td>
</tr>
<tr>
<td><strong>Recipient</strong>:
<input name=”to” type=”text” id=”to” size=”20″ />
(Number in international format eg. +233244666666)</td>
</tr>
<tr>
<td><textarea name=”message” cols=”40″ rows=”7″ id=”message” ></textarea></td>
</tr>
<tr>
<td><input name=”SendMessage” type=”submit” class=”form_button” value=”Send Message” id=”SendMessage” /></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>

Download Tutorial >>

Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7

Send SMS Message Using Clickatell API – Part 2

Posted on September 24th, 2007 in HTTP/S, PHP Tutorials | No Comments »

The second part of the tutorial is actually optional for those who know their way around php coding. These pages will help you diagnose errors with ease.

Create these three pages

1. failed.php
2. sent.php
3. badlogin.php

On sending the sms message three things are likely to happen;

1. Login Failure, i.e. failure to authenticate with the Clickatell Gateway
2. SMS Sending Failure , i.e. failure to send the sms
3. Successful message sending

And in any of the listed conditions above, you will be redirected to a corresponding php page to know where the fault it came from.

failed.php

<?php
//********************************************
//
// Send SMS Message Using Clickatell API – Part 3
// 23rd September 2007
// www.mboateng.com
// Michael Ofori Amanfo Boateng
//
//***********************************************
?>

<!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=utf-8″ />
<title>Untitled Document</title>
</head>
<body>
<table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td align=”center”><h1>Message Sending Failed</h1></td>
</tr>
</table>
</body>
</html>

Sent.php

<?php
//******************************************
//
// Send SMS Message Using Clickatell API – Part 3
// 23rd September 2007
// www.mboateng.com
// Michael Ofori Amanfo Boateng
//
//********************************************
?>

<!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=utf-8″ />
<title>Untitled Document</title>
</head>
<body>
<table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td align=”center”><h1>Message Sent</h1></td>
</tr>
</table>
</body>
</html>

badlogin.php

<?php
//*******************************************
//
// Send SMS Message Using Clickatell API – Part 3
// 23rd September 2007
// www.mboateng.com
// Michael Ofori Amanfo Boateng
//
//********************************************
?>

<!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=utf-8″ />
<title>Untitled Document</title>
</head>
<body>
<table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td align=”center”><h1>Login Failed</h1></td>
</tr>
</table>
</body>
</html>

Download Tutorial >>

Part 1 | Part 2 | Part 3 | Part 4 | Part 5 | Part 6 | Part 7