PHP isn't just a server side language. It can be executed on Windows/Linux boxes on command line/terminal. Just run the PHP executable, for example. However, it is unlikely that your Blackberry supports PHP on its proprietary OS.
Are you trying to create a script that runs on a HTTP server that then sends a message to a SMS server? And that SMS server then sends a message to a cell phone?
Here's a basic structure of form handling. I'll leave it up to you to fill in the details for communicating with the SMS server to pass on the form data.
<?php
// is this a form post?
if (isset($_POST['btnSubmit'])) {
// - check all user fields below to see if they are filled in
// - strip all bad characters and validate the data
// - if any errors back out and post an error message
$txtMsg = $_POST['txtMsg'];
$txtPhoneNumber = $_POST['txtPhoneNumber'];
$txtUsername = $_POST['txtUsername'];
$txtPassword = $_POST['txtPassword'];
$txtDestination = $_POST['txtDestination'];
// Build the URL here
$SMSUrl = "http://www.linuxbeanie.com";
$SMSUrl .= "username=" . $username;
$SMSUrl .= "&password=" . $password;
$SMSUrl .= "&from=" . $txtPhoneNumber;
$SMSUrl .= "&to=+" . $dest . "+";
$SMSUrl .= "&text=" . $txtMsg;
// comment out if this looks good... just a check only
echo $SMSUrl;
// Send it to the SMS gateway
// You can send it a number of ways:
// 1) Via socket (see PHP docs for fsockopen/fputs/fclose/feof)
// 2) Throuch CURL (see PHP docs)
//
// I'll leave it to you to fill in the details and create the HTTP header ($hdr)
$theSocket = @fsockopen($host, 80, $errno, $errstr);
if ($theSocket) {
fputs($theSocket, $hdr);
while(!feof($theSocket)) {
$ret[] = fgets($theSocket);
}
fclose($theSocket);
}
}
else { // show the form
$strForm = "<form id='frmData' name='frmData' method='post' action='sendit.php'>";
$strForm .= "<input name='txtUsername' type='text' value='name here' />";
$strForm .= "<input name='txtPassword' type='text' value='password' />";
$strForm .= "<input name='txtDestination' type='text' value='Houston' />";
$strForm .= "<input name='txtPhoneNumber' type='text' value='1-800-123-4567' />";
$strForm .= "<input name='txtMsg' type='text' value='Your message here' maxlength='160'/>";
$strForm .= "<input name='btnSubmit' type='submit' value='Submit' />";
$strForm .= "</form>";
echo $strForm;
}
?>
Name the file sendit.php and then run it on your HTTP server, fill in the rest.