GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 11-Apr-2003, 17:45
jrobbio's Avatar
jrobbio jrobbio is offline
Regular Member
 
Join Date: Jan 2003
Location: Loughborough, England
Posts: 840
jrobbio will become famous soon enough

Customising SMS sending script via e-mail gateway for multiple users


First this is all the documentation that came with this open source script:
Put this form on your webpage and you will be always ONLINE!!! Receive messages right from your web site.
Open source and edit line 2. You can add new fileds such as name and email and receive them in message body too!
v2.0 - message length unlimited. Message will be splited in several parts!

Install notices: Every mobile service provider has sms service. There are a lot of ways to send sms messages to your cell phone. One way is to send sms messages through simple service which has almost every mobile service provider (e-mail). When you buy cell phone with number, you have your own phone number, which is your sms number in the same time. In that case you can receive sms messages, sending them to your_phone_number@yourprovidersmsgate.com. Every mobile service provider has such smsgates and sms services... So everything you need is to open source of downloaded file and edit your address - yournumber@yourprovider.com.
And this is that: (question at bottom)

PHP Code:

<?
$smsto="yournum@yourcellprovider.com";
$subject="SMS";
$meslength="130";
?>
<html>

        <head>
                <meta http-equiv="content-type" content="text/html;charset=windows-1250">
                <title>contact me / send sms</title>
                <link rel="stylesheet" href="../text.css">

<script Language="JavaScript"><!--

var s=0;
var str='/send';

function len(F)
{
  F.counter.value = F.message.value.length+1;
}

//--></script>
        </head>

        <body bgcolor="#336699" leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" link="white" text="black" vlink="white">
                <div align="center">
<? if ($action==send) {
//$fromemail="a@a.kg";
if ($fromemail==""){ $fromemail="a@a.kg"; }
$bodytext="$message";
$body="$bodytext";
if (strlen($body)>$meslength) {
  $newbody = wordwrap($body, $meslength, "<br>");
  $barr = explode("<br>", $newbody);
  $count=count($barr);
  for($i = 0; $i < $count; $i++) {
    $i2=$i+1;
    $barr[$i]="($i2/$count) \n $barr[$i]";
  //  echo"$barr[$i]<br>";
    mail($smsto, $subject, $barr[$i], "From: $fromemail");
    }
  }
  else 
  {
    mail($smsto, $subject, $body, "From: $fromemail");
  }
echo"<p class=text1><i>Thanx, your message have been sent! You can send one more :)</i></p>";
}
?>
                                    
                                    <form method="POST" onsubmit="return Sub1()" name="Form1" align=center action="<? echo"sms.php?action=send";?>">
                                        <table border=0 cellspacing=2 cellpadding=0>
                                                                                        <tr>
                                                                                                <td>
                                                                                                        <p class="text1"><b>Message:</b></p>
                                                                                                </td>
                                                                                                <td valign="top" align=left><textarea id=input2 name=message rows=5 cols=18 wrap=no onkeypress="len(Form1)"></textarea></td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                                <td>
                                                                                                        <p class="text1"><b>E-mail:</b></p>
                                                                                                </td>
                                                                                                <td valign="top" align=left><input type="text" name="fromemail" size="10"></td>
                                                                                        </tr>
                                                                                        <tr>
                                                                                                <td align=left>
                                                    <p class="text1"><b>Length:</b></p>
                                                </td>
                                                                                                <td valign="top" align=left><input id=input2 type=text name="counter" size=4 value="0" onfocus="Form1.message.focus();"></td>
                                                                                        </tr>
                                            <tr>
                                                <td valign="top" align=left></td>
                                                <td valign="top" align=left><INPUT TYPE="submit" ID="img_send" width="84" height="15" border="0" name="Ok" value="Îòïðàâèòü (Send)"></td>
                                            </tr>
                                        </table>
                                        <p class="text2"><b>Message length unlimited :)</b></p>
                                    </form>
                                                                </td>
                                                        </tr>
                                                </table>
                                        </td>
                                </tr>
            <br>
        </div>
        </body>

</html>


What I want to do is make it so that people are able to enter their friends e-mail addresses rather than send them to me. Since these things are quite hard to remember, I am going to combine it with some sort of storing device so that people don't have to fiddle about with strange e-mail addresses every time that they are not likely to remember. Any suggestions
  #2  
Old 28-Sep-2003, 01:57
eboy305 eboy305 is offline
New Member
 
Join Date: Sep 2003
Posts: 2
eboy305 is an unknown quantity at this point

sms sending form setup


Dear jrobbio,

i had copy your script but its not working on my site , can u tell me y, n pls help me to spot the error.


www.mineit.com.my

TQ
  #3  
Old 28-Sep-2003, 08:02
Allowee's Avatar
Allowee Allowee is offline
Regular Member
 
Join Date: May 2003
Location: The Netherlands
Posts: 339
Allowee has a spectacular aura about
It looks like your host doesn't support PHP on there server.
__________________
Pastebin
PHP Documentation Site
Allowee's Blog http://allowee.net
  #4  
Old 28-Sep-2003, 17:53
JdS's Avatar
JdS JdS is offline
Senior Member
 
Join Date: Aug 2001
Location: KUL, Malaysia
Posts: 3,371
JdS will become famous soon enough
If you're making a simple SMS script like this i.e. Email->SMS, you can use ANY form mail script basically.

Take away the javascript and the 'count message length' fluff and all that remains is a simple form mail script. So you could do this with perl, php, asp... anything.
  #5  
Old 29-Sep-2003, 12:49
eboy305 eboy305 is offline
New Member
 
Join Date: Sep 2003
Posts: 2
eboy305 is an unknown quantity at this point

i did a newsletter in php


my server confirm support php
 
 

Recent GIDBlogToyota - 2008 July Promotion by Nihal

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 23:56.


vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.