nancyaggarwal Posted November 10, 2009 Share Posted November 10, 2009 Sir i am fresher in php. So help me as soon as possible. My query is how we send sms to mobile number from php form.I have made a php form in which i have made two things one is "text area" and other is "drop down".for that i am using two tables.names are coming from database dynamically from table and "smsinformation" table is used for storing the data "userid,message,phoneno.,date". please tell me how i m send a sms to mobile number. my code is:- HERE IS A DATABASE CONNECTION....... <? // $cid=0; $sql= mysql_query("select mobileno from mobileusrs where user_id='$_POST[recipient]'"); //echo $sql; while($row = mysql_fetch_array($sql)) { $mob=$row['mobileno']; } ?> <? if (isset($_POST['submitinfo'])) { $sql1 = "insert into smsinformation (name,mobileno,date,msg)values('$_POST[recipient]','$mob',now(),'$_POST[message]')"; //echo $sql1; mysql_query($sql1); } ?> <table cellpadding="0" cellspacing="0" border="0"> <tr><td class="main_td"> <form name="frm1" action="#" method="POST" onsubmit="return valid()"> <table cellpadding="0" cellspacing="0" border="0" align="center"> <tr><td colspan="2" align="center" class="heading_form" style="color:#333333; padding:10px; text-decoration:none;"></td></tr> <tr><td colspan="2" align="center"><font color="green"></font></td></tr> <tr> <td valign="top"> <table cellpadding="12" cellspacing="0" border="0" width="300px"> <tr> <td> <span> Name</span><span>*</span></td> <? $sql="select * from mobileusrs"; //echo $sql;?> <?$rs=mysql_query($sql);?> <td align="left"> <select name="recipient" class="input" style="width:190px; font-family:Geneva, Arial, Helvetica, sans-serif; font-size:11px;"> <option>-----SELECT-----</option> <?while($row = mysql_fetch_array($rs)){?> <option value="<?echo $row['user_id'];?>"> <?echo $row['name'];?></option><?}?> </select></td> </tr><tr> <td align="left">Message:</td> <td><textarea rows="10" cols="10" name="message" style="height:100px;" value="Enter your text here:-" class="text_box_form"/></textarea></td> </tr> <tr> <td> </td><td align="left" style="padding-left:12px; padding-top:10px;"> <input type="Submit" name="submitinfo" value="Send"></td></tr> </table> </form> </td></tr></table> </td></tr> </table> THANKS AND REPLY ME SOON Quote Link to comment https://forums.phpfreaks.com/topic/180942-help-me/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.