Hello there,
I want to introduce message system in my website. I've created table fields as follows:
id(int), receiver_id, msg_id, msg_sub, msg_desc, msg_time
Below is my html form in which registered users will be displayed in dropdown list:
<form class="form-horizontal" action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<legend>Send Message</legend>
Recipient:<select name="receiver_id" data-rel="chosen" onchange="showValues()">
<?php
$query = "SELECT * FROM star.users";
$run = mysql_query($query);
while( $row = mysql_fetch_assoc($run) ){
$receiver_id = $row['id'];
$usrname = $row['username'];
?>
<option value="<?php echo $receiver_id; ?>" ><?php echo $usrname; ?></option>
<?php } ?>
</select>
Subject:<input type="text" name="msg_sub" value="" />
Message:<textarea name="msg_desc" rows="4" value="" /></textarea>
<button type="submit" name="send">Send</button>
<button type="reset" >Cancel</button>
</form>
Now how to get receiver id from selected user and send sms to that user ?