SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    May 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question problem form making sending web to sms

    during my project work, how can i make a web application so that it can be able send sms to mobile phones. i had to buy a sms gateway? there is not any free sms gateways so that i can get authentication for access of HTTP API for that sms gateways.
    is there have any alternative for that? please respond it fast as u can.

    "Sms usage is simple, when the user registers they will select their mobile carrier. To send sms to that mobile phone all you do is have a script send an email to mobilenumber@email to sms gateway (i.e. 1234567@msg.acsalaska.com). All carriers and gateways are found here: http://en.wikipedia.org/wiki/SMS_gateways"
    "this is the real issue for me so that can u help me to resolve this issue"
    and i had a script downloaded from sourcforge.com which i will attach if any one intrested can use that for sending email to sms for cellular phone.
    if gives error like that
    "Warning: mail() [function.mail]: SMTP server response: 503 This mail server requires authentication. Please check your mail client settings. in D:\www\sms\includes\class_send_SMS.php on line 39"
    -----------------------------------------------------class-----------------------
    //please save as "class_send_SMS.php"
    <?
    include ('config.php');

    class send_SMS{
    var $carrier;
    var $number;
    var $message;
    var $mailto;
    var $db;
    function send_SMS(){
    require_once ('ezsql/db.class.php');
    $this->db = new db(USERNAME, PASSWORD, DATABASE, HOSTSPEC);
    }
    function set_carrier($carrier){
    $this->carrier=$carrier;
    }
    function set_number($number){
    $number=preg_replace('@[^0-9]@','',$number);
    $this->number=$number;
    }
    function set_user($user){
    $sql="SELECT * from core_users WHERE id=" . $user;
    $sendto=$this->db->get_row($sql);
    $this->carrier=$sendto['carrier'];
    $this->number=$sendto['number'];
    }
    function set_subject($subject){
    $this->subject=$subject;
    }
    function send_message($message){
    $this->message=$message;
    $this->mailto=$this->create_email();
    preg_match('@^(?:http://)?([^/]+)@i',$_SERVER['HTTP_REFERER'], $matches);
    $host = $matches[1];
    preg_match('/[^.]+\.[^.]+$/', $host, $matches);
    $domain="{$matches[0]}";
    $sql="INSERT INTO core_logs SET sender_ip='" . $_SERVER['REMOTE_ADDR'] . "',domain='" . $domain . "',number='" . $this->number . "',date_time='" . date('Y-m-d H:i:s') . "'";
    $this->db->query($sql);
    if(!mail($this->mailto,$this->subject,$this->message,$headers)){
    echo "error sending message";
    }
    }
    function create_email(){
    $sql="SELECT domain from core_carriers WHERE id='" . $this->carrier . "' LIMIT 1";
    $gateway_domain=$this->db->get_var($sql);
    return $this->number . '@' . $gateway_domain;
    }
    function get_carriers($set){
    $dd="<select name='sms_carrier'>";
    $sql="SELECT * from core_carriers";
    $carriers=$this->db->get_results($sql);
    foreach($carriers AS $carrier){
    $dd.="<option value='" . $carrier['id'] . "'";
    if($set==$key){
    $dd.=" SELECTED";
    }
    $dd.=">" . $carrier['carrier'] . "</option>";
    }
    $dd.="</select>";

    return $dd;
    }
    function get_users(){
    $dd="<select name='sms_user'>";
    $sql="SELECT * from core_users";
    $users=$this->db->get_results($sql);
    foreach($users AS $user){
    $dd.="<option value='" . $user['id'] . "'>" . $user['name'] . "</option>";
    }
    $dd.="</select>";

    return $dd;
    }
    }
    ?>
    //----------end of class-----------------------------------------------------
    //-----------------next class--------------------------------------
    //save as "db.class.php--------------------------
    <?

    // ==================================================================
    // Author: Justin Vincent (justin@visunet.ie)
    // Web: http://www.justinvincent.com
    // Name: ezSQL
    // Desc: Class to make it very easy to deal with mySQL database connections.

    // ==================================================================
    // ezSQL Constants
    define("EZSQL_VERSION","1.01");
    define("ARRAY_A","ARRAY_A",true);
    define("ARRAY_N","ARRAY_N",true);

    // ==================================================================
    // The Main Class

    class db {

    // ==================================================================
    // DB Constructor - connects to the server and selects a database

    function db($dbuser, $dbpassword, $dbname, $dbhost)
    {

    $this->dbh = @mysql_connect($dbhost,$dbuser,$dbpassword);

    if ( ! $this->dbh )
    {
    $this->print_error("<ol><b>Error establishing a database connection!</b><li>Are you sure you have the correct user/password?<li>Are you sure that you have typed the correct hostname?<li>Are you sure that the database server is running?</ol>");
    }


    $this->select($dbname);

    }

    // ==================================================================
    // Select a DB (if another one needs to be selected)

    function select($db)
    {
    if ( !@mysql_select_db($db,$this->dbh))
    {
    $this->print_error("<ol><b>Error selecting database <u>$db</u>!</b><li>Are you sure it exists?<li>Are you sure there is a valid database connection?</ol>");
    }
    }

    // ==================================================================
    // Print SQL/DB error.

    function print_error($str = "")
    {
    global $domain;
    if ( !$str ) $str = mysql_error();
    // If there is an error then take note of it
    $error= "SQL/DB Error -- ";
    $error.= "$str - ";
    $error.= $this->last_query . " - " . $domain . $_SERVER['REQUEST_URI'];
    trigger_error($error);
    }

    // ==================================================================
    // Basic Query - see docs for more detail

    function query($query, $output = ARRAY_A)
    {
    //$this->allqueries .= '||' . $query;
    // Log how the function was called
    $this->func_call = "\$db->query(\"$query\", $output)";

    // Kill this
    $this->last_result = Array();
    //$this->col_info = null;

    // Keep track of the last query for debug..
    $this->last_query = $query;

    // Perform the query via std mysql_query function..
    $this->result = mysql_query($query,$this->dbh);

    if ( mysql_error() )
    {

    // If there is an error then take note of it..
    $this->print_error();

    }
    else
    {

    // In other words if this was a select statement..
    if ( $this->result )
    {

    // =======================================================
    // Take note of column info

    //$i=0;
    //while ($i < @mysql_num_fields($this->result))
    //{
    // $this->col_info[$i] = @mysql_fetch_field($this->result);
    // $i++;
    //}

    // =======================================================
    // Store Query Results

    $i=0;
    while ( $row = @mysql_fetch_assoc($this->result) )
    {

    // Store relults as an objects within main array
    $this->last_result[$i] = $row;

    $i++;
    }

    @mysql_free_result($this->result);

    // If there were results then return true for $db->query
    if ( $i )
    {
    return true;

    }
    else
    {
    return false;
    }

    }

    }
    }

    // ==================================================================
    // Get one variable from the DB - see docs for more detail

    function get_var($query=null,$x=0,$y=0)
    {

    // Log how the function was called
    $this->func_call = "\$db->get_var(\"$query\",$x,$y)";

    // If there is a query then perform it if not then use cached results..
    if ( $query )
    {
    $this->query($query);
    }

    // Extract var out of cached results based x,y vals
    if ( $this->last_result[$y] )
    {
    $values = array_values($this->last_result[$y]);
    }

    // If there is a value return it else return null
    return $values[$x]?$values[$x]:null;
    }

    // ==================================================================
    // Get one row from the DB - see docs for more detail

    function get_row($query=null,$y=0,$output=ARRAY_A)
    {

    // Log how the function was called
    $this->func_call = "\$db->get_row(\"$query\",$y,$output)";

    // If there is a query then perform it if not then use cached results..
    if ( $query )
    {
    $this->query($query);
    }


    // If the output is an associative array then return row as such..
    if ( $output == ARRAY_A )
    {
    $toreturn=$this->last_result[$y]?$this->last_result[$y]:null;
    if($toreturn==''){$toreturn=Array();}
    return $toreturn;
    }
    // If the output is an numerical array then return row as such..
    elseif ( $output == ARRAY_N )
    {
    return $this->last_result[$y]?array_values($this->last_result[$y]):null;
    }
    // If invalid output type was specified..
    else
    {
    $this->print_error(" \$db->get_row(string query,int offset,output type) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N ");
    }

    }

    // ==================================================================
    // Function to get 1 column from the cached result set based in X index
    // se docs for usage and info

    //function get_col($query=null,$x=0)
    //{
    //
    // // If there is a query then perform it if not then use cached results..
    // if ( $query )
    // {
    // $this->query($query);
    // }
    //
    // // Extract the column values
    // for ( $i=0; $i < count($this->last_result); $i++ )
    // {
    // $new_array[$i] = $this->get_var(null,$x,$i);
    // }
    //
    // return $new_array;
    //}

    // ==================================================================
    // Return the the query as a result set - see docs for more details

    function get_results($query=null, $output = ARRAY_A)
    {

    // Log how the function was called
    $this->func_call = "\$db->get_results(\"$query\", $output)";

    // If there is a query then perform it if not then use cached results..
    if ( $query )
    {
    $this->query($query);
    }

    // Send back array of objects. Each row is an object
    if ( $output == ARRAY_A )
    {
    return $this->last_result;
    }
    elseif ( $output == ARRAY_N )
    {
    if ( $this->last_result )
    {
    $i=0;
    foreach( $this->last_result as $row )
    {

    if ( $output == ARRAY_N )
    {
    $new_array[$i] = array_values($new_array[$i]);
    }

    $i++;
    }

    return $new_array;
    }
    else
    {
    return Array();
    }
    }
    }


    // ==================================================================
    // Function to get column meta data info pertaining to the last query
    // see docs for more info and usage

    //function get_col_info($info_type="name",$col_offset=-1)
    //{

    // if ( $this->col_info )
    // {
    // if ( $col_offset == -1 )
    // {
    // $i=0;
    // foreach($this->col_info as $col )
    // {
    // $new_array[$i] = $col->{$info_type};
    // $i++;
    // }
    // return $new_array;
    // }
    // else
    // {
    // return $this->col_info[$col_offset]->{$info_type};
    // }
    //
    // }
    //
    //}


    // ==================================================================
    // Dumps the contents of any input variable to screen in a nicely
    // formatted and easy to understand way - any type: Object, Var or Array

    //function vardump($mixed)
    //{

    // echo "<blockquote><font color=000090>";
    // echo "<pre><font face=arial>";
    //
    // if ( ! $this->vardump_called )
    // {
    // echo "<font color=800080><b>ezSQL</b> (v".EZSQL_VERSION.") <b>Variable Dump..</b></font>\n\n";
    // }
    //
    // print_r($mixed);
    // echo "\n\n<b>Last Query/b> ".($this->last_query?$this->last_query:"NULL")."\n";
    // echo "<b>Last Function Call/b> " . ($this->func_call?$this->func_call:"None")."\n";
    // echo "<b>Last Rows Returned/b> ".count($this->last_result)."\n";
    // echo "</font></pre></font></blockquote>";
    // echo "\n<hr size=1 noshade color=dddddd>";

    // $this->vardump_called = true;

    //}

    // Alias for the above function
    //function dumpvars($mixed)
    //{
    // $this->vardump($mixed);
    //}


    function disconnect(){
    //$sql='INSERT INTO zz_query_log SET path="' . $this->allqueries . '"';
    //$this->query($sql);
    mysql_close();
    }
    function insert_id(){
    return mysql_insert_id();
    }
    function affected_rows(){
    return mysql_affected_rows();
    }
    // ==================================================================
    // Displays the last query string that was sent to the database & a
    // table listing results (if there were any).
    // (abstracted into a seperate file to save server overhead).

    //function debug()
    //{

    // echo "<blockquote>";

    // // Only show ezSQL credits once..
    // if ( ! $this->debug_called )
    // {
    // echo "<font color=800080 face=arial size=2><b>ezSQL</b> (v".EZSQL_VERSION.") <b>Debug..</b></font><p>\n";
    // }
    // echo "<font face=arial size=2 color=000099><b>Query --</b> ";
    // echo "[<font color=000000><b>$this->last_query</b></font>]</font><p>";
    //
    // echo "<font face=arial size=2 color=000099><b>Query Result..</b></font>";
    // echo "<blockquote>";
    //
    // if ( $this->col_info )
    // {

    // =====================================================
    // Results top rows

    // echo "<table cellpadding=5 cellspacing=1 bgcolor=555555>";
    // echo "<tr bgcolor=eeeeee><td nowrap valign=bottom><font color=555599 face=arial size=2><b>(row)</b></font></td>";


    // for ( $i=0; $i < count($this->col_info); $i++ )
    // {
    // echo "<td nowrap align=left valign=top><font size=1 color=555599 face=arial>{$this->col_info[$i]->type} {$this->col_info[$i]->max_length}<br><font size=2><b>{$this->col_info[$i]->name}</b></font></td>";
    // }
    //
    // echo "</tr>";
    //
    // // ======================================================
    // // print main results
    //
    // if ( $this->last_result )
    // {
    //
    // $i=0;
    // foreach ( $this->get_results(null,ARRAY_N) as $one_row )
    // {
    // $i++;
    // echo "<tr bgcolor=ffffff><td bgcolor=eeeeee nowrap align=middle><font size=2 color=555599 face=arial>$i</font></td>";
    //
    // foreach ( $one_row as $item )
    // {
    // echo "<td nowrap><font face=arial size=2>$item</font></td>";
    // }
    //
    // echo "</tr>";
    // }
    //
    // } // if last result
    // else
    // {
    // echo "<tr bgcolor=ffffff><td colspan=".(count($this->col_info)+1)."><font face=arial size=2>No Results</font></td></tr>";
    // }
    //
    // echo "</table>";
    //
    // } // if col_info
    // else
    // {
    // echo "<font face=arial size=2>No Results</font>";
    // }
    //
    // echo "</blockquote></blockquote><hr noshade color=dddddd size=1>";
    //
    //
    // $this->debug_called = true;
    // }


    }
    ?>
    //-----------------end of class "db.class.php"----------------------------------------
    //------------next file-----------------
    //----------save as "confog.php"--------------------------------
    //------------start of "config.php"--------------------------
    <?
    define('USERNAME','root');
    define('PASSWORD','raju');
    define('DATABASE','core_sms');
    define('HOSTSPEC','localhost');

    ?>
    //------------end of "config.php"--------------------------
    //-----------please save as "to_anyone.php"------------
    //-----------start of "to_anyone.php"------------------------
    <?
    include('includes/class_send_SMS.php');
    $sms=new send_SMS();
    if($_POST){
    $sms->set_number($_POST['number']);
    $sms->set_carrier($_POST['sms_carrier']);

    $message=$_POST['message'];
    $error=$sms->send_message($message);
    echo "<font color='red'>MESSAGE SENT</font>";
    }

    ?>

    <form action="<?= $_SERVER['PHP_SELF']?>" method="post">
    Phone Number<br> <input type="text" name="number"><br>
    Carrier<br> <? echo $sms->get_carriers('');?><br>
    Message<br>
    <textarea cols=15 rows=6 name="message"></textarea><br>
    <input type="submit" value="submit">

    </form>
    //-----------end of "to_anyone.php"------------------------
    //------------------this is table for database so it must be exported in database--------------
    -- phpMyAdmin SQL Dump
    -- version 2.9.0.2
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Generation Time: Jan 19, 2007 at 03:56 PM
    -- Server version: 4.1.21
    -- PHP Version: 4.4.2
    --
    -- Database: `core_sms`
    --

    -- --------------------------------------------------------

    --
    -- Table structure for table `core_carriers`
    --

    CREATE TABLE `core_carriers` (
    `id` int(11) NOT NULL auto_increment,
    `carrier` varchar(50) NOT NULL default '',
    `domain` varchar(30) NOT NULL default '',
    `country` varchar(15) NOT NULL default '',
    `reliable` tinyint(4) NOT NULL default '0',
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=143 ;

    --
    -- Dumping data for table `core_carriers`
    --

    INSERT INTO `core_carriers` VALUES (1, '', '', '', 0);
    INSERT INTO `core_carriers` VALUES (2, 'Unknown', 'Unknown', '', 0);
    INSERT INTO `core_carriers` VALUES (3, '3River Wireless', 'sms.3rivers.net', '', 0);
    INSERT INTO `core_carriers` VALUES (4, 'Andhra Pradesh Airtel', 'airtelap.com', '', 0);
    INSERT INTO `core_carriers` VALUES (5, 'Andhra Pradesh Idea Cellular', 'ideacellular.net', '', 0);
    INSERT INTO `core_carriers` VALUES (6, 'Alltel PCS', 'message.alltel.com', '', 0);
    INSERT INTO `core_carriers` VALUES (7, 'Alltel', 'alltelmessage.com', '', 0);
    INSERT INTO `core_carriers` VALUES (8, 'Arch Wireless', 'archwireless.net', '', 0);
    INSERT INTO `core_carriers` VALUES (9, 'BeeLine GSM', 'sms.beemail.ru', '', 0);
    INSERT INTO `core_carriers` VALUES (10, 'BeeLine (Moscow)', 'sms.gate.ru', '', 0);
    INSERT INTO `core_carriers` VALUES (11, 'Bell Canada', 'txt.bellmobility.ca', '', 0);
    INSERT INTO `core_carriers` VALUES (12, 'Bell Canada', 'bellmobility.ca', '', 0);
    INSERT INTO `core_carriers` VALUES (13, 'Bell Atlantic', 'message.bam.com', '', 0);
    INSERT INTO `core_carriers` VALUES (14, 'Bell South', 'sms.bellsouth.com', '', 0);
    INSERT INTO `core_carriers` VALUES (15, 'Bell South', 'wireless.bellsouth.com', '', 0);
    INSERT INTO `core_carriers` VALUES (16, 'Bite GSM (Lithuania)', 'sms.bite.lt', '', 0);
    INSERT INTO `core_carriers` VALUES (17, 'Bluegrass Cellular', 'sms.bluecell.com', '', 0);
    INSERT INTO `core_carriers` VALUES (18, 'BPL mobile', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (19, 'Celcom (Malaysia)', 'sms.celcom.com.my', '', 0);
    INSERT INTO `core_carriers` VALUES (20, 'Cellular One', 'mobile.celloneusa.com', 'US', 10);
    INSERT INTO `core_carriers` VALUES (21, 'Cellular One East Cost', 'phone.cellone.net', '', 0);
    INSERT INTO `core_carriers` VALUES (22, 'Cellular South', 'csouth1.com', '', 0);
    INSERT INTO `core_carriers` VALUES (23, 'Cellular One', 'sbcemail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (24, 'Cingular', 'mobile.mycingular.net', 'US', 10);
    INSERT INTO `core_carriers` VALUES (26, 'CZECH EuroTel', 'sms.eurotel.cz', '', 0);
    INSERT INTO `core_carriers` VALUES (27, 'Chennai Skycell / Airtel', 'airtelchennai.com', '', 0);
    INSERT INTO `core_carriers` VALUES (28, 'Comviq GSM Sweden', 'sms.comviq.se', '', 0);
    INSERT INTO `core_carriers` VALUES (29, 'Corr Wireless Communications', 'corrwireless.net', '', 0);
    INSERT INTO `core_carriers` VALUES (30, 'D1 De TeMobil', 't-d1-sms.de', '', 0);
    INSERT INTO `core_carriers` VALUES (31, 'D2 Mannesmann Mobilefunk', 'd2-message.de', '', 0);
    INSERT INTO `core_carriers` VALUES (32, 'DT T-Mobile', 't-mobile-sms.de', '', 0);
    INSERT INTO `core_carriers` VALUES (33, 'Delhi Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (34, 'Delhi Hutch', 'delhi.hutch.co.in', '', 0);
    INSERT INTO `core_carriers` VALUES (35, 'Dobson Cellular Systems', 'mobile.dobson.net', '', 0);
    INSERT INTO `core_carriers` VALUES (36, 'E-Plus (Germany)', 'eplus.de', '', 0);
    INSERT INTO `core_carriers` VALUES (37, 'EMT', 'sms.emt.ee', '', 0);
    INSERT INTO `core_carriers` VALUES (38, 'Eurotel (Czech Republic)', 'sms.eurotel.cz', '', 0);
    INSERT INTO `core_carriers` VALUES (39, 'Escotel', 'escotelmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (40, 'Estonia EMT', 'sms-m.emt.ee', '', 0);
    INSERT INTO `core_carriers` VALUES (41, 'Estonia RLE', 'rle.ee', '', 0);
    INSERT INTO `core_carriers` VALUES (42, 'Estonia Q GSM', 'qgsm.ee', '', 0);
    INSERT INTO `core_carriers` VALUES (43, 'Estonia Mobil Telephone', 'sms.emt.ee', '', 0);
    INSERT INTO `core_carriers` VALUES (44, 'Fido', 'fido.ca', '', 0);
    INSERT INTO `core_carriers` VALUES (45, 'Georgea geocell', 'sms.ge', '', 0);
    INSERT INTO `core_carriers` VALUES (46, 'Goa BPLMobil', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (47, 'Golden Telecom', 'sms.goldentele.com', '', 0);
    INSERT INTO `core_carriers` VALUES (48, 'Golden Telecom (Kiev, Ukraine only)', 'sms.gt.kiev.ua', '', 0);
    INSERT INTO `core_carriers` VALUES (49, 'GTE', 'messagealert.com', '', 0);
    INSERT INTO `core_carriers` VALUES (50, 'GTE', 'airmessage.net', '', 0);
    INSERT INTO `core_carriers` VALUES (51, 'Gujarat Idea', 'ideacellular.net', '', 0);
    INSERT INTO `core_carriers` VALUES (52, 'Gujarat Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (53, 'Goa Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (54, 'Goa BPLMobil', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (55, 'Goa Idea Cellular', 'ideacellular.net', '', 0);
    INSERT INTO `core_carriers` VALUES (56, 'Haryana Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (57, 'Haryana Escotel', 'escotelmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (58, 'Himachal Pradesh Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (59, 'Hungary Pannon GSM', 'sms.pgsm.hu', '', 0);
    INSERT INTO `core_carriers` VALUES (60, 'Idea Cellular', 'ideacellular.net', '', 0);
    INSERT INTO `core_carriers` VALUES (61, 'Inland Cellular Telephone', 'inlandlink.com', '', 0);
    INSERT INTO `core_carriers` VALUES (62, 'Israel Orange IL', 'shiny.co.il', '', 0);
    INSERT INTO `core_carriers` VALUES (63, 'Karnataka Airtel', 'airtelkk.com', '', 0);
    INSERT INTO `core_carriers` VALUES (64, 'Kerala Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (65, 'Kerala Escotel', 'escotelmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (66, 'Kerala BPL Mobile', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (67, 'Kyivstar (Kiev Ukraine only)', 'sms.kyivstar.net', '', 0);
    INSERT INTO `core_carriers` VALUES (68, 'Latvia TELE2', 'sms.tele2.lv', '', 0);
    INSERT INTO `core_carriers` VALUES (69, 'Madhya Pradesh Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (70, 'Maharashtra Idea Cellular', 'ideacellular.net', '', 0);
    INSERT INTO `core_carriers` VALUES (71, 'MCI Phone', 'mci.com', '', 0);
    INSERT INTO `core_carriers` VALUES (72, 'Meteor', 'mymeteor.ie', '', 0);
    INSERT INTO `core_carriers` VALUES (73, 'Metro PCS', 'mymetropcs.com', '', 0);
    INSERT INTO `core_carriers` VALUES (74, 'MiWorld', 'm1.com.sg', '', 0);
    INSERT INTO `core_carriers` VALUES (75, 'Mobileone', 'm1.com.sg', '', 0);
    INSERT INTO `core_carriers` VALUES (76, 'Mobilecomm', 'mobilecomm.net', '', 0);
    INSERT INTO `core_carriers` VALUES (77, 'Mobtel Srbija', 'mobtel.co.yu', '', 0);
    INSERT INTO `core_carriers` VALUES (78, 'Mobistar Belgium', 'mobistar.be', '', 0);
    INSERT INTO `core_carriers` VALUES (79, 'Mobility Bermuda', 'ml.bm', '', 0);
    INSERT INTO `core_carriers` VALUES (80, 'Maharashtra Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (81, 'Maharashtra BPL Mobile', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (82, 'Manitoba Telecom Systems', 'text.mtsmobility.com', '', 0);
    INSERT INTO `core_carriers` VALUES (83, 'Mumbai BPL Mobile', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (84, 'MTN (South Africa only )', 'sms.co.za', '', 0);
    INSERT INTO `core_carriers` VALUES (85, 'MiWorld ( Singapore)', 'm1.com.sg', '', 0);
    INSERT INTO `core_carriers` VALUES (86, 'NBTel', 'wirefree.informe.ca', '', 0);
    INSERT INTO `core_carriers` VALUES (87, 'Netcom GSM (Norway)', 'sms.netcom.no', '', 0);
    INSERT INTO `core_carriers` VALUES (88, 'Nextel', 'messaging.nextel.com', '', 0);
    INSERT INTO `core_carriers` VALUES (89, 'Nextel', 'nextel.com.br', '', 0);
    INSERT INTO `core_carriers` VALUES (90, 'Optimus (Portugal)', 'sms.optimus.pt', '', 0);
    INSERT INTO `core_carriers` VALUES (91, 'Orange', 'orange.net', '', 0);
    INSERT INTO `core_carriers` VALUES (92, 'Oskar', 'mujoskar.cz', '', 0);
    INSERT INTO `core_carriers` VALUES (93, 'Pacific Bell', 'pacbellpcs.net', '', 0);
    INSERT INTO `core_carriers` VALUES (94, 'PlusGSM (Poland only)', 'text.plusgsm.pl', '', 0);
    INSERT INTO `core_carriers` VALUES (95, 'P&T Luxembourg', 'sms.luxgsm.lu', '', 0);
    INSERT INTO `core_carriers` VALUES (96, 'Poland PLUS GSM', 'text.plusgsm.pl', '', 0);
    INSERT INTO `core_carriers` VALUES (97, 'Pondicherry BPL Mobile', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (98, 'Primtel', 'sms.primtel.ru', '', 0);
    INSERT INTO `core_carriers` VALUES (99, 'Punjab Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (100, 'Qwest', 'qwestmp.com', '', 0);
    INSERT INTO `core_carriers` VALUES (101, 'Rogers AT&T Wireless', 'pcs.rogers.com', '', 0);
    INSERT INTO `core_carriers` VALUES (102, 'Safaricom', 'safaricomsms.com', '', 0);
    INSERT INTO `core_carriers` VALUES (103, 'Satelindo GSM', 'satelindogsm.com', '', 0);
    INSERT INTO `core_carriers` VALUES (104, 'Simobile (Slovenia)', 'simobil.net', '', 0);
    INSERT INTO `core_carriers` VALUES (105, 'SCS-900', 'scs-900.ru', '', 0);
    INSERT INTO `core_carriers` VALUES (106, 'Sunrise Mobile', 'mysunrise.ch', '', 0);
    INSERT INTO `core_carriers` VALUES (107, 'Sunrise Mobile', 'freesurf.ch', '', 0);
    INSERT INTO `core_carriers` VALUES (108, 'SFR France', 'sfr.fr', '', 0);
    INSERT INTO `core_carriers` VALUES (109, 'Southwestern Bell', 'email.swbw.com', '', 0);
    INSERT INTO `core_carriers` VALUES (110, 'Sprint PCS', 'messaging.sprintpcs.com', '', 0);
    INSERT INTO `core_carriers` VALUES (111, 'Sprint', 'sprintpaging.com', '', 0);
    INSERT INTO `core_carriers` VALUES (112, 'Swisscom', 'bluewin.ch', '', 0);
    INSERT INTO `core_carriers` VALUES (113, 'Swisscom', 'bluemail.ch', '', 0);
    INSERT INTO `core_carriers` VALUES (114, 'Telecom Italia Mobile (Italy)', 'posta.tim.it', '', 0);
    INSERT INTO `core_carriers` VALUES (115, 'Telenor Mobil Norway', 'mobilpost.com', '', 0);
    INSERT INTO `core_carriers` VALUES (116, 'Telecel (Portugal)', 'sms.telecel.pt', '', 0);
    INSERT INTO `core_carriers` VALUES (117, 'Tele2', 'sms.tele2.lv', '', 0);
    INSERT INTO `core_carriers` VALUES (118, 'Telus', 'msg.telus.com', '', 0);
    INSERT INTO `core_carriers` VALUES (119, 'Telenor', 'mobilpost.no', '', 0);
    INSERT INTO `core_carriers` VALUES (120, 'Telia Denmark', 'gsm1800.telia.dk', '', 0);
    INSERT INTO `core_carriers` VALUES (121, 'TMN (Portugal)', 'mail.tmn.pt', '', 0);
    INSERT INTO `core_carriers` VALUES (122, 'T-Mobile Austria', 'sms.t-mobile.at', '', 0);
    INSERT INTO `core_carriers` VALUES (123, 'T-Mobile Germany', 't-d1-sms.de', '', 0);
    INSERT INTO `core_carriers` VALUES (124, 'T-Mobile UK', 't-mobile.uk.net', '', 0);
    INSERT INTO `core_carriers` VALUES (125, 'T-Mobile USA', 'tmomail.net', '', 0);
    INSERT INTO `core_carriers` VALUES (126, 'Triton', 'tms.suncom.com', '', 0);
    INSERT INTO `core_carriers` VALUES (127, 'Tamil Nadu BPL Mobile', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (128, 'UMC GSM', 'sms.umc.com.ua', '', 0);
    INSERT INTO `core_carriers` VALUES (129, 'Unicel', 'utext.com', '', 0);
    INSERT INTO `core_carriers` VALUES (130, 'Uraltel', 'sms.uraltel.ru', '', 0);
    INSERT INTO `core_carriers` VALUES (131, 'US Cellular', 'email.uscc.net', '', 0);
    INSERT INTO `core_carriers` VALUES (132, 'Uttar Pradesh (West) Escotel', 'escotelmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (133, 'Verizon', 'vtext.com', '', 0);
    INSERT INTO `core_carriers` VALUES (134, 'Vodafone Omnitel (Italy)', 'vizzavi.it', '', 0);
    INSERT INTO `core_carriers` VALUES (135, 'Vodafone Italy', 'sms.vodafone.it', '', 0);
    INSERT INTO `core_carriers` VALUES (136, 'Vodafone Japan', 'c.vodafone.ne.jp', '', 0);
    INSERT INTO `core_carriers` VALUES (137, 'Vodafone Japan', 'h.vodafone.ne.jp', '', 0);
    INSERT INTO `core_carriers` VALUES (138, 'Vodafone Japan', 't.vodafone.ne.jp', '', 0);
    INSERT INTO `core_carriers` VALUES (139, 'Vodafone Spain', 'vodafone.es', '', 0);
    INSERT INTO `core_carriers` VALUES (140, 'Vodafone UK', 'vodafone.net', '', 0);
    INSERT INTO `core_carriers` VALUES (141, 'West Central Wireless', 'sms.wcc.net', '', 0);
    INSERT INTO `core_carriers` VALUES (142, 'Western Wireless', 'cellularonewest.com', '', 0);

    -- --------------------------------------------------------

    --
    -- Table structure for table `core_logs`
    --

    CREATE TABLE `core_logs` (
    `id` int(11) NOT NULL auto_increment,
    `domain` varchar(30) NOT NULL default '',
    `number` varchar(10) NOT NULL default '',
    `sender_ip` varchar(15) NOT NULL default '',
    `date_time` datetime NOT NULL default '0000-00-00 00:00:00',
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

    --
    -- Dumping data for table `core_logs`
    --


    -- --------------------------------------------------------

    --
    -- Table structure for table `core_users`
    --

    CREATE TABLE `core_users` (
    `id` int(11) NOT NULL auto_increment,
    `name` varchar(30) NOT NULL default '',
    `username` varchar(20) NOT NULL default '',
    `password` varchar(50) NOT NULL default '',
    `carrier` varchar(5) NOT NULL default '',
    `number` varchar(10) NOT NULL default '',
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

    --
    -- Dumping data for table `core_users`
    --

    --------------end of database table----------------------------
    instruction fo that
    save in www where server is running and open to_anyone.php from browser
    i think u will response me so that i feel easy to implement
    Last edited by ranabhat suresh; May 11, 2007 at 02:22. Reason: for clearance to others

  2. #2
    That's Right. notepad_coder's Avatar
    Join Date
    Apr 2002
    Location
    Colorado
    Posts
    835
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've never seen a free API for SMS, I know of Clickatell. I've seen a lot of scripts written for their HTTP gateway, but they charge $0.06 USD for each message.
    - the lid is off the maple syrup again!

  3. #3
    SitePoint Member
    Join Date
    Jun 2007
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Suresh,

    Do you have any idea how to find the carrier address of Indian mobile services. For e.g for Karnataka Airtel -- airtelkk.com .

    Could you let me know what is the source to get all the carrier of Indian mobiles?

    Thanks

    Best Regads,
    Pramod kumar Shah
    Bangalore












    Quote Originally Posted by ranabhat suresh View Post
    during my project work, how can i make a web application so that it can be able send sms to mobile phones. i had to buy a sms gateway? there is not any free sms gateways so that i can get authentication for access of HTTP API for that sms gateways.
    is there have any alternative for that? please respond it fast as u can.

    "Sms usage is simple, when the user registers they will select their mobile carrier. To send sms to that mobile phone all you do is have a script send an email to mobilenumber@email to sms gateway (i.e. 1234567@msg.acsalaska.com). All carriers and gateways are found here: http://en.wikipedia.org/wiki/SMS_gateways"
    "this is the real issue for me so that can u help me to resolve this issue"
    and i had a script downloaded from sourcforge.com which i will attach if any one intrested can use that for sending email to sms for cellular phone.
    if gives error like that
    "Warning: mail() [function.mail]: SMTP server response: 503 This mail server requires authentication. Please check your mail client settings. in D:\www\sms\includes\class_send_SMS.php on line 39"
    -----------------------------------------------------class-----------------------
    //please save as "class_send_SMS.php"
    <?
    include ('config.php');

    class send_SMS{
    var $carrier;
    var $number;
    var $message;
    var $mailto;
    var $db;
    function send_SMS(){
    require_once ('ezsql/db.class.php');
    $this->db = new db(USERNAME, PASSWORD, DATABASE, HOSTSPEC);
    }
    function set_carrier($carrier){
    $this->carrier=$carrier;
    }
    function set_number($number){
    $number=preg_replace('@[^0-9]@','',$number);
    $this->number=$number;
    }
    function set_user($user){
    $sql="SELECT * from core_users WHERE id=" . $user;
    $sendto=$this->db->get_row($sql);
    $this->carrier=$sendto['carrier'];
    $this->number=$sendto['number'];
    }
    function set_subject($subject){
    $this->subject=$subject;
    }
    function send_message($message){
    $this->message=$message;
    $this->mailto=$this->create_email();
    preg_match('@^(?:http://)?([^/]+)@i',$_SERVER['HTTP_REFERER'], $matches);
    $host = $matches[1];
    preg_match('/[^.]+\.[^.]+$/', $host, $matches);
    $domain="{$matches[0]}";
    $sql="INSERT INTO core_logs SET sender_ip='" . $_SERVER['REMOTE_ADDR'] . "',domain='" . $domain . "',number='" . $this->number . "',date_time='" . date('Y-m-d H:i:s') . "'";
    $this->db->query($sql);
    if(!mail($this->mailto,$this->subject,$this->message,$headers)){
    echo "error sending message";
    }
    }
    function create_email(){
    $sql="SELECT domain from core_carriers WHERE id='" . $this->carrier . "' LIMIT 1";
    $gateway_domain=$this->db->get_var($sql);
    return $this->number . '@' . $gateway_domain;
    }
    function get_carriers($set){
    $dd="<select name='sms_carrier'>";
    $sql="SELECT * from core_carriers";
    $carriers=$this->db->get_results($sql);
    foreach($carriers AS $carrier){
    $dd.="<option value='" . $carrier['id'] . "'";
    if($set==$key){
    $dd.=" SELECTED";
    }
    $dd.=">" . $carrier['carrier'] . "</option>";
    }
    $dd.="</select>";

    return $dd;
    }
    function get_users(){
    $dd="<select name='sms_user'>";
    $sql="SELECT * from core_users";
    $users=$this->db->get_results($sql);
    foreach($users AS $user){
    $dd.="<option value='" . $user['id'] . "'>" . $user['name'] . "</option>";
    }
    $dd.="</select>";

    return $dd;
    }
    }
    ?>
    //----------end of class-----------------------------------------------------
    //-----------------next class--------------------------------------
    //save as "db.class.php--------------------------
    <?

    // ==================================================================
    // Author: Justin Vincent (justin@visunet.ie)
    // Web: http://www.justinvincent.com
    // Name: ezSQL
    // Desc: Class to make it very easy to deal with mySQL database connections.

    // ==================================================================
    // ezSQL Constants
    define("EZSQL_VERSION","1.01");
    define("ARRAY_A","ARRAY_A",true);
    define("ARRAY_N","ARRAY_N",true);

    // ==================================================================
    // The Main Class

    class db {

    // ==================================================================
    // DB Constructor - connects to the server and selects a database

    function db($dbuser, $dbpassword, $dbname, $dbhost)
    {

    $this->dbh = @mysql_connect($dbhost,$dbuser,$dbpassword);

    if ( ! $this->dbh )
    {
    $this->print_error("<ol><b>Error establishing a database connection!</b><li>Are you sure you have the correct user/password?<li>Are you sure that you have typed the correct hostname?<li>Are you sure that the database server is running?</ol>");
    }


    $this->select($dbname);

    }

    // ==================================================================
    // Select a DB (if another one needs to be selected)

    function select($db)
    {
    if ( !@mysql_select_db($db,$this->dbh))
    {
    $this->print_error("<ol><b>Error selecting database <u>$db</u>!</b><li>Are you sure it exists?<li>Are you sure there is a valid database connection?</ol>");
    }
    }

    // ==================================================================
    // Print SQL/DB error.

    function print_error($str = "")
    {
    global $domain;
    if ( !$str ) $str = mysql_error();
    // If there is an error then take note of it
    $error= "SQL/DB Error -- ";
    $error.= "$str - ";
    $error.= $this->last_query . " - " . $domain . $_SERVER['REQUEST_URI'];
    trigger_error($error);
    }

    // ==================================================================
    // Basic Query - see docs for more detail

    function query($query, $output = ARRAY_A)
    {
    //$this->allqueries .= '||' . $query;
    // Log how the function was called
    $this->func_call = "\$db->query(\"$query\", $output)";

    // Kill this
    $this->last_result = Array();
    //$this->col_info = null;

    // Keep track of the last query for debug..
    $this->last_query = $query;

    // Perform the query via std mysql_query function..
    $this->result = mysql_query($query,$this->dbh);

    if ( mysql_error() )
    {

    // If there is an error then take note of it..
    $this->print_error();

    }
    else
    {

    // In other words if this was a select statement..
    if ( $this->result )
    {

    // =======================================================
    // Take note of column info

    //$i=0;
    //while ($i < @mysql_num_fields($this->result))
    //{
    // $this->col_info[$i] = @mysql_fetch_field($this->result);
    // $i++;
    //}

    // =======================================================
    // Store Query Results

    $i=0;
    while ( $row = @mysql_fetch_assoc($this->result) )
    {

    // Store relults as an objects within main array
    $this->last_result[$i] = $row;

    $i++;
    }

    @mysql_free_result($this->result);

    // If there were results then return true for $db->query
    if ( $i )
    {
    return true;

    }
    else
    {
    return false;
    }

    }

    }
    }

    // ==================================================================
    // Get one variable from the DB - see docs for more detail

    function get_var($query=null,$x=0,$y=0)
    {

    // Log how the function was called
    $this->func_call = "\$db->get_var(\"$query\",$x,$y)";

    // If there is a query then perform it if not then use cached results..
    if ( $query )
    {
    $this->query($query);
    }

    // Extract var out of cached results based x,y vals
    if ( $this->last_result[$y] )
    {
    $values = array_values($this->last_result[$y]);
    }

    // If there is a value return it else return null
    return $values[$x]?$values[$x]:null;
    }

    // ==================================================================
    // Get one row from the DB - see docs for more detail

    function get_row($query=null,$y=0,$output=ARRAY_A)
    {

    // Log how the function was called
    $this->func_call = "\$db->get_row(\"$query\",$y,$output)";

    // If there is a query then perform it if not then use cached results..
    if ( $query )
    {
    $this->query($query);
    }


    // If the output is an associative array then return row as such..
    if ( $output == ARRAY_A )
    {
    $toreturn=$this->last_result[$y]?$this->last_result[$y]:null;
    if($toreturn==''){$toreturn=Array();}
    return $toreturn;
    }
    // If the output is an numerical array then return row as such..
    elseif ( $output == ARRAY_N )
    {
    return $this->last_result[$y]?array_values($this->last_result[$y]):null;
    }
    // If invalid output type was specified..
    else
    {
    $this->print_error(" \$db->get_row(string query,int offset,output type) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N ");
    }

    }

    // ==================================================================
    // Function to get 1 column from the cached result set based in X index
    // se docs for usage and info

    //function get_col($query=null,$x=0)
    //{
    //
    // // If there is a query then perform it if not then use cached results..
    // if ( $query )
    // {
    // $this->query($query);
    // }
    //
    // // Extract the column values
    // for ( $i=0; $i < count($this->last_result); $i++ )
    // {
    // $new_array[$i] = $this->get_var(null,$x,$i);
    // }
    //
    // return $new_array;
    //}

    // ==================================================================
    // Return the the query as a result set - see docs for more details

    function get_results($query=null, $output = ARRAY_A)
    {

    // Log how the function was called
    $this->func_call = "\$db->get_results(\"$query\", $output)";

    // If there is a query then perform it if not then use cached results..
    if ( $query )
    {
    $this->query($query);
    }

    // Send back array of objects. Each row is an object
    if ( $output == ARRAY_A )
    {
    return $this->last_result;
    }
    elseif ( $output == ARRAY_N )
    {
    if ( $this->last_result )
    {
    $i=0;
    foreach( $this->last_result as $row )
    {

    if ( $output == ARRAY_N )
    {
    $new_array[$i] = array_values($new_array[$i]);
    }

    $i++;
    }

    return $new_array;
    }
    else
    {
    return Array();
    }
    }
    }


    // ==================================================================
    // Function to get column meta data info pertaining to the last query
    // see docs for more info and usage

    //function get_col_info($info_type="name",$col_offset=-1)
    //{

    // if ( $this->col_info )
    // {
    // if ( $col_offset == -1 )
    // {
    // $i=0;
    // foreach($this->col_info as $col )
    // {
    // $new_array[$i] = $col->{$info_type};
    // $i++;
    // }
    // return $new_array;
    // }
    // else
    // {
    // return $this->col_info[$col_offset]->{$info_type};
    // }
    //
    // }
    //
    //}


    // ==================================================================
    // Dumps the contents of any input variable to screen in a nicely
    // formatted and easy to understand way - any type: Object, Var or Array

    //function vardump($mixed)
    //{

    // echo "<blockquote><font color=000090>";
    // echo "<pre><font face=arial>";
    //
    // if ( ! $this->vardump_called )
    // {
    // echo "<font color=800080><b>ezSQL</b> (v".EZSQL_VERSION.") <b>Variable Dump..</b></font>\n\n";
    // }
    //
    // print_r($mixed);
    // echo "\n\n<b>Last Query/b> ".($this->last_query?$this->last_query:"NULL")."\n";
    // echo "<b>Last Function Call/b> " . ($this->func_call?$this->func_call:"None")."\n";
    // echo "<b>Last Rows Returned/b> ".count($this->last_result)."\n";
    // echo "</font></pre></font></blockquote>";
    // echo "\n<hr size=1 noshade color=dddddd>";

    // $this->vardump_called = true;

    //}

    // Alias for the above function
    //function dumpvars($mixed)
    //{
    // $this->vardump($mixed);
    //}


    function disconnect(){
    //$sql='INSERT INTO zz_query_log SET path="' . $this->allqueries . '"';
    //$this->query($sql);
    mysql_close();
    }
    function insert_id(){
    return mysql_insert_id();
    }
    function affected_rows(){
    return mysql_affected_rows();
    }
    // ==================================================================
    // Displays the last query string that was sent to the database & a
    // table listing results (if there were any).
    // (abstracted into a seperate file to save server overhead).

    //function debug()
    //{

    // echo "<blockquote>";

    // // Only show ezSQL credits once..
    // if ( ! $this->debug_called )
    // {
    // echo "<font color=800080 face=arial size=2><b>ezSQL</b> (v".EZSQL_VERSION.") <b>Debug..</b></font><p>\n";
    // }
    // echo "<font face=arial size=2 color=000099><b>Query --</b> ";
    // echo "[<font color=000000><b>$this->last_query</b></font>]</font><p>";
    //
    // echo "<font face=arial size=2 color=000099><b>Query Result..</b></font>";
    // echo "<blockquote>";
    //
    // if ( $this->col_info )
    // {

    // =====================================================
    // Results top rows

    // echo "<table cellpadding=5 cellspacing=1 bgcolor=555555>";
    // echo "<tr bgcolor=eeeeee><td nowrap valign=bottom><font color=555599 face=arial size=2><b>(row)</b></font></td>";


    // for ( $i=0; $i < count($this->col_info); $i++ )
    // {
    // echo "<td nowrap align=left valign=top><font size=1 color=555599 face=arial>{$this->col_info[$i]->type} {$this->col_info[$i]->max_length}<br><font size=2><b>{$this->col_info[$i]->name}</b></font></td>";
    // }
    //
    // echo "</tr>";
    //
    // // ======================================================
    // // print main results
    //
    // if ( $this->last_result )
    // {
    //
    // $i=0;
    // foreach ( $this->get_results(null,ARRAY_N) as $one_row )
    // {
    // $i++;
    // echo "<tr bgcolor=ffffff><td bgcolor=eeeeee nowrap align=middle><font size=2 color=555599 face=arial>$i</font></td>";
    //
    // foreach ( $one_row as $item )
    // {
    // echo "<td nowrap><font face=arial size=2>$item</font></td>";
    // }
    //
    // echo "</tr>";
    // }
    //
    // } // if last result
    // else
    // {
    // echo "<tr bgcolor=ffffff><td colspan=".(count($this->col_info)+1)."><font face=arial size=2>No Results</font></td></tr>";
    // }
    //
    // echo "</table>";
    //
    // } // if col_info
    // else
    // {
    // echo "<font face=arial size=2>No Results</font>";
    // }
    //
    // echo "</blockquote></blockquote><hr noshade color=dddddd size=1>";
    //
    //
    // $this->debug_called = true;
    // }


    }
    ?>
    //-----------------end of class "db.class.php"----------------------------------------
    //------------next file-----------------
    //----------save as "confog.php"--------------------------------
    //------------start of "config.php"--------------------------
    <?
    define('USERNAME','root');
    define('PASSWORD','raju');
    define('DATABASE','core_sms');
    define('HOSTSPEC','localhost');

    ?>
    //------------end of "config.php"--------------------------
    //-----------please save as "to_anyone.php"------------
    //-----------start of "to_anyone.php"------------------------
    <?
    include('includes/class_send_SMS.php');
    $sms=new send_SMS();
    if($_POST){
    $sms->set_number($_POST['number']);
    $sms->set_carrier($_POST['sms_carrier']);

    $message=$_POST['message'];
    $error=$sms->send_message($message);
    echo "<font color='red'>MESSAGE SENT</font>";
    }

    ?>

    <form action="<?= $_SERVER['PHP_SELF']?>" method="post">
    Phone Number<br> <input type="text" name="number"><br>
    Carrier<br> <? echo $sms->get_carriers('');?><br>
    Message<br>
    <textarea cols=15 rows=6 name="message"></textarea><br>
    <input type="submit" value="submit">

    </form>
    //-----------end of "to_anyone.php"------------------------
    //------------------this is table for database so it must be exported in database--------------
    -- phpMyAdmin SQL Dump
    -- version 2.9.0.2
    -- http://www.phpmyadmin.net
    --
    -- Host: localhost
    -- Generation Time: Jan 19, 2007 at 03:56 PM
    -- Server version: 4.1.21
    -- PHP Version: 4.4.2
    --
    -- Database: `core_sms`
    --

    -- --------------------------------------------------------

    --
    -- Table structure for table `core_carriers`
    --

    CREATE TABLE `core_carriers` (
    `id` int(11) NOT NULL auto_increment,
    `carrier` varchar(50) NOT NULL default '',
    `domain` varchar(30) NOT NULL default '',
    `country` varchar(15) NOT NULL default '',
    `reliable` tinyint(4) NOT NULL default '0',
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=143 ;

    --
    -- Dumping data for table `core_carriers`
    --

    INSERT INTO `core_carriers` VALUES (1, '', '', '', 0);
    INSERT INTO `core_carriers` VALUES (2, 'Unknown', 'Unknown', '', 0);
    INSERT INTO `core_carriers` VALUES (3, '3River Wireless', 'sms.3rivers.net', '', 0);
    INSERT INTO `core_carriers` VALUES (4, 'Andhra Pradesh Airtel', 'airtelap.com', '', 0);
    INSERT INTO `core_carriers` VALUES (5, 'Andhra Pradesh Idea Cellular', 'ideacellular.net', '', 0);
    INSERT INTO `core_carriers` VALUES (6, 'Alltel PCS', 'message.alltel.com', '', 0);
    INSERT INTO `core_carriers` VALUES (7, 'Alltel', 'alltelmessage.com', '', 0);
    INSERT INTO `core_carriers` VALUES (8, 'Arch Wireless', 'archwireless.net', '', 0);
    INSERT INTO `core_carriers` VALUES (9, 'BeeLine GSM', 'sms.beemail.ru', '', 0);
    INSERT INTO `core_carriers` VALUES (10, 'BeeLine (Moscow)', 'sms.gate.ru', '', 0);
    INSERT INTO `core_carriers` VALUES (11, 'Bell Canada', 'txt.bellmobility.ca', '', 0);
    INSERT INTO `core_carriers` VALUES (12, 'Bell Canada', 'bellmobility.ca', '', 0);
    INSERT INTO `core_carriers` VALUES (13, 'Bell Atlantic', 'message.bam.com', '', 0);
    INSERT INTO `core_carriers` VALUES (14, 'Bell South', 'sms.bellsouth.com', '', 0);
    INSERT INTO `core_carriers` VALUES (15, 'Bell South', 'wireless.bellsouth.com', '', 0);
    INSERT INTO `core_carriers` VALUES (16, 'Bite GSM (Lithuania)', 'sms.bite.lt', '', 0);
    INSERT INTO `core_carriers` VALUES (17, 'Bluegrass Cellular', 'sms.bluecell.com', '', 0);
    INSERT INTO `core_carriers` VALUES (18, 'BPL mobile', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (19, 'Celcom (Malaysia)', 'sms.celcom.com.my', '', 0);
    INSERT INTO `core_carriers` VALUES (20, 'Cellular One', 'mobile.celloneusa.com', 'US', 10);
    INSERT INTO `core_carriers` VALUES (21, 'Cellular One East Cost', 'phone.cellone.net', '', 0);
    INSERT INTO `core_carriers` VALUES (22, 'Cellular South', 'csouth1.com', '', 0);
    INSERT INTO `core_carriers` VALUES (23, 'Cellular One', 'sbcemail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (24, 'Cingular', 'mobile.mycingular.net', 'US', 10);
    INSERT INTO `core_carriers` VALUES (26, 'CZECH EuroTel', 'sms.eurotel.cz', '', 0);
    INSERT INTO `core_carriers` VALUES (27, 'Chennai Skycell / Airtel', 'airtelchennai.com', '', 0);
    INSERT INTO `core_carriers` VALUES (28, 'Comviq GSM Sweden', 'sms.comviq.se', '', 0);
    INSERT INTO `core_carriers` VALUES (29, 'Corr Wireless Communications', 'corrwireless.net', '', 0);
    INSERT INTO `core_carriers` VALUES (30, 'D1 De TeMobil', 't-d1-sms.de', '', 0);
    INSERT INTO `core_carriers` VALUES (31, 'D2 Mannesmann Mobilefunk', 'd2-message.de', '', 0);
    INSERT INTO `core_carriers` VALUES (32, 'DT T-Mobile', 't-mobile-sms.de', '', 0);
    INSERT INTO `core_carriers` VALUES (33, 'Delhi Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (34, 'Delhi Hutch', 'delhi.hutch.co.in', '', 0);
    INSERT INTO `core_carriers` VALUES (35, 'Dobson Cellular Systems', 'mobile.dobson.net', '', 0);
    INSERT INTO `core_carriers` VALUES (36, 'E-Plus (Germany)', 'eplus.de', '', 0);
    INSERT INTO `core_carriers` VALUES (37, 'EMT', 'sms.emt.ee', '', 0);
    INSERT INTO `core_carriers` VALUES (38, 'Eurotel (Czech Republic)', 'sms.eurotel.cz', '', 0);
    INSERT INTO `core_carriers` VALUES (39, 'Escotel', 'escotelmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (40, 'Estonia EMT', 'sms-m.emt.ee', '', 0);
    INSERT INTO `core_carriers` VALUES (41, 'Estonia RLE', 'rle.ee', '', 0);
    INSERT INTO `core_carriers` VALUES (42, 'Estonia Q GSM', 'qgsm.ee', '', 0);
    INSERT INTO `core_carriers` VALUES (43, 'Estonia Mobil Telephone', 'sms.emt.ee', '', 0);
    INSERT INTO `core_carriers` VALUES (44, 'Fido', 'fido.ca', '', 0);
    INSERT INTO `core_carriers` VALUES (45, 'Georgea geocell', 'sms.ge', '', 0);
    INSERT INTO `core_carriers` VALUES (46, 'Goa BPLMobil', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (47, 'Golden Telecom', 'sms.goldentele.com', '', 0);
    INSERT INTO `core_carriers` VALUES (48, 'Golden Telecom (Kiev, Ukraine only)', 'sms.gt.kiev.ua', '', 0);
    INSERT INTO `core_carriers` VALUES (49, 'GTE', 'messagealert.com', '', 0);
    INSERT INTO `core_carriers` VALUES (50, 'GTE', 'airmessage.net', '', 0);
    INSERT INTO `core_carriers` VALUES (51, 'Gujarat Idea', 'ideacellular.net', '', 0);
    INSERT INTO `core_carriers` VALUES (52, 'Gujarat Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (53, 'Goa Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (54, 'Goa BPLMobil', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (55, 'Goa Idea Cellular', 'ideacellular.net', '', 0);
    INSERT INTO `core_carriers` VALUES (56, 'Haryana Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (57, 'Haryana Escotel', 'escotelmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (58, 'Himachal Pradesh Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (59, 'Hungary Pannon GSM', 'sms.pgsm.hu', '', 0);
    INSERT INTO `core_carriers` VALUES (60, 'Idea Cellular', 'ideacellular.net', '', 0);
    INSERT INTO `core_carriers` VALUES (61, 'Inland Cellular Telephone', 'inlandlink.com', '', 0);
    INSERT INTO `core_carriers` VALUES (62, 'Israel Orange IL', 'shiny.co.il', '', 0);
    INSERT INTO `core_carriers` VALUES (63, 'Karnataka Airtel', 'airtelkk.com', '', 0);
    INSERT INTO `core_carriers` VALUES (64, 'Kerala Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (65, 'Kerala Escotel', 'escotelmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (66, 'Kerala BPL Mobile', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (67, 'Kyivstar (Kiev Ukraine only)', 'sms.kyivstar.net', '', 0);
    INSERT INTO `core_carriers` VALUES (68, 'Latvia TELE2', 'sms.tele2.lv', '', 0);
    INSERT INTO `core_carriers` VALUES (69, 'Madhya Pradesh Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (70, 'Maharashtra Idea Cellular', 'ideacellular.net', '', 0);
    INSERT INTO `core_carriers` VALUES (71, 'MCI Phone', 'mci.com', '', 0);
    INSERT INTO `core_carriers` VALUES (72, 'Meteor', 'mymeteor.ie', '', 0);
    INSERT INTO `core_carriers` VALUES (73, 'Metro PCS', 'mymetropcs.com', '', 0);
    INSERT INTO `core_carriers` VALUES (74, 'MiWorld', 'm1.com.sg', '', 0);
    INSERT INTO `core_carriers` VALUES (75, 'Mobileone', 'm1.com.sg', '', 0);
    INSERT INTO `core_carriers` VALUES (76, 'Mobilecomm', 'mobilecomm.net', '', 0);
    INSERT INTO `core_carriers` VALUES (77, 'Mobtel Srbija', 'mobtel.co.yu', '', 0);
    INSERT INTO `core_carriers` VALUES (78, 'Mobistar Belgium', 'mobistar.be', '', 0);
    INSERT INTO `core_carriers` VALUES (79, 'Mobility Bermuda', 'ml.bm', '', 0);
    INSERT INTO `core_carriers` VALUES (80, 'Maharashtra Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (81, 'Maharashtra BPL Mobile', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (82, 'Manitoba Telecom Systems', 'text.mtsmobility.com', '', 0);
    INSERT INTO `core_carriers` VALUES (83, 'Mumbai BPL Mobile', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (84, 'MTN (South Africa only )', 'sms.co.za', '', 0);
    INSERT INTO `core_carriers` VALUES (85, 'MiWorld ( Singapore)', 'm1.com.sg', '', 0);
    INSERT INTO `core_carriers` VALUES (86, 'NBTel', 'wirefree.informe.ca', '', 0);
    INSERT INTO `core_carriers` VALUES (87, 'Netcom GSM (Norway)', 'sms.netcom.no', '', 0);
    INSERT INTO `core_carriers` VALUES (88, 'Nextel', 'messaging.nextel.com', '', 0);
    INSERT INTO `core_carriers` VALUES (89, 'Nextel', 'nextel.com.br', '', 0);
    INSERT INTO `core_carriers` VALUES (90, 'Optimus (Portugal)', 'sms.optimus.pt', '', 0);
    INSERT INTO `core_carriers` VALUES (91, 'Orange', 'orange.net', '', 0);
    INSERT INTO `core_carriers` VALUES (92, 'Oskar', 'mujoskar.cz', '', 0);
    INSERT INTO `core_carriers` VALUES (93, 'Pacific Bell', 'pacbellpcs.net', '', 0);
    INSERT INTO `core_carriers` VALUES (94, 'PlusGSM (Poland only)', 'text.plusgsm.pl', '', 0);
    INSERT INTO `core_carriers` VALUES (95, 'P&T Luxembourg', 'sms.luxgsm.lu', '', 0);
    INSERT INTO `core_carriers` VALUES (96, 'Poland PLUS GSM', 'text.plusgsm.pl', '', 0);
    INSERT INTO `core_carriers` VALUES (97, 'Pondicherry BPL Mobile', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (98, 'Primtel', 'sms.primtel.ru', '', 0);
    INSERT INTO `core_carriers` VALUES (99, 'Punjab Airtel', 'airtelmail.com', '', 0);
    INSERT INTO `core_carriers` VALUES (100, 'Qwest', 'qwestmp.com', '', 0);
    INSERT INTO `core_carriers` VALUES (101, 'Rogers AT&T Wireless', 'pcs.rogers.com', '', 0);
    INSERT INTO `core_carriers` VALUES (102, 'Safaricom', 'safaricomsms.com', '', 0);
    INSERT INTO `core_carriers` VALUES (103, 'Satelindo GSM', 'satelindogsm.com', '', 0);
    INSERT INTO `core_carriers` VALUES (104, 'Simobile (Slovenia)', 'simobil.net', '', 0);
    INSERT INTO `core_carriers` VALUES (105, 'SCS-900', 'scs-900.ru', '', 0);
    INSERT INTO `core_carriers` VALUES (106, 'Sunrise Mobile', 'mysunrise.ch', '', 0);
    INSERT INTO `core_carriers` VALUES (107, 'Sunrise Mobile', 'freesurf.ch', '', 0);
    INSERT INTO `core_carriers` VALUES (108, 'SFR France', 'sfr.fr', '', 0);
    INSERT INTO `core_carriers` VALUES (109, 'Southwestern Bell', 'email.swbw.com', '', 0);
    INSERT INTO `core_carriers` VALUES (110, 'Sprint PCS', 'messaging.sprintpcs.com', '', 0);
    INSERT INTO `core_carriers` VALUES (111, 'Sprint', 'sprintpaging.com', '', 0);
    INSERT INTO `core_carriers` VALUES (112, 'Swisscom', 'bluewin.ch', '', 0);
    INSERT INTO `core_carriers` VALUES (113, 'Swisscom', 'bluemail.ch', '', 0);
    INSERT INTO `core_carriers` VALUES (114, 'Telecom Italia Mobile (Italy)', 'posta.tim.it', '', 0);
    INSERT INTO `core_carriers` VALUES (115, 'Telenor Mobil Norway', 'mobilpost.com', '', 0);
    INSERT INTO `core_carriers` VALUES (116, 'Telecel (Portugal)', 'sms.telecel.pt', '', 0);
    INSERT INTO `core_carriers` VALUES (117, 'Tele2', 'sms.tele2.lv', '', 0);
    INSERT INTO `core_carriers` VALUES (118, 'Telus', 'msg.telus.com', '', 0);
    INSERT INTO `core_carriers` VALUES (119, 'Telenor', 'mobilpost.no', '', 0);
    INSERT INTO `core_carriers` VALUES (120, 'Telia Denmark', 'gsm1800.telia.dk', '', 0);
    INSERT INTO `core_carriers` VALUES (121, 'TMN (Portugal)', 'mail.tmn.pt', '', 0);
    INSERT INTO `core_carriers` VALUES (122, 'T-Mobile Austria', 'sms.t-mobile.at', '', 0);
    INSERT INTO `core_carriers` VALUES (123, 'T-Mobile Germany', 't-d1-sms.de', '', 0);
    INSERT INTO `core_carriers` VALUES (124, 'T-Mobile UK', 't-mobile.uk.net', '', 0);
    INSERT INTO `core_carriers` VALUES (125, 'T-Mobile USA', 'tmomail.net', '', 0);
    INSERT INTO `core_carriers` VALUES (126, 'Triton', 'tms.suncom.com', '', 0);
    INSERT INTO `core_carriers` VALUES (127, 'Tamil Nadu BPL Mobile', 'bplmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (128, 'UMC GSM', 'sms.umc.com.ua', '', 0);
    INSERT INTO `core_carriers` VALUES (129, 'Unicel', 'utext.com', '', 0);
    INSERT INTO `core_carriers` VALUES (130, 'Uraltel', 'sms.uraltel.ru', '', 0);
    INSERT INTO `core_carriers` VALUES (131, 'US Cellular', 'email.uscc.net', '', 0);
    INSERT INTO `core_carriers` VALUES (132, 'Uttar Pradesh (West) Escotel', 'escotelmobile.com', '', 0);
    INSERT INTO `core_carriers` VALUES (133, 'Verizon', 'vtext.com', '', 0);
    INSERT INTO `core_carriers` VALUES (134, 'Vodafone Omnitel (Italy)', 'vizzavi.it', '', 0);
    INSERT INTO `core_carriers` VALUES (135, 'Vodafone Italy', 'sms.vodafone.it', '', 0);
    INSERT INTO `core_carriers` VALUES (136, 'Vodafone Japan', 'c.vodafone.ne.jp', '', 0);
    INSERT INTO `core_carriers` VALUES (137, 'Vodafone Japan', 'h.vodafone.ne.jp', '', 0);
    INSERT INTO `core_carriers` VALUES (138, 'Vodafone Japan', 't.vodafone.ne.jp', '', 0);
    INSERT INTO `core_carriers` VALUES (139, 'Vodafone Spain', 'vodafone.es', '', 0);
    INSERT INTO `core_carriers` VALUES (140, 'Vodafone UK', 'vodafone.net', '', 0);
    INSERT INTO `core_carriers` VALUES (141, 'West Central Wireless', 'sms.wcc.net', '', 0);
    INSERT INTO `core_carriers` VALUES (142, 'Western Wireless', 'cellularonewest.com', '', 0);

    -- --------------------------------------------------------

    --
    -- Table structure for table `core_logs`
    --

    CREATE TABLE `core_logs` (
    `id` int(11) NOT NULL auto_increment,
    `domain` varchar(30) NOT NULL default '',
    `number` varchar(10) NOT NULL default '',
    `sender_ip` varchar(15) NOT NULL default '',
    `date_time` datetime NOT NULL default '0000-00-00 00:00:00',
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;

    --
    -- Dumping data for table `core_logs`
    --


    -- --------------------------------------------------------

    --
    -- Table structure for table `core_users`
    --

    CREATE TABLE `core_users` (
    `id` int(11) NOT NULL auto_increment,
    `name` varchar(30) NOT NULL default '',
    `username` varchar(20) NOT NULL default '',
    `password` varchar(50) NOT NULL default '',
    `carrier` varchar(5) NOT NULL default '',
    `number` varchar(10) NOT NULL default '',
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;

    --
    -- Dumping data for table `core_users`
    --

    --------------end of database table----------------------------
    instruction fo that
    save in www where server is running and open to_anyone.php from browser
    i think u will response me so that i feel easy to implement


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •