Hello again.
I have a search form that returns results. These results are displayed in a table. Each row in the table has a checkbox.
The checkbox is assigned a certain value.
This table is ALSO a form that will lead to a certain action.
This action is – sending an SMS to that row’s user.
I would like to be able to insert the user’s first name into the SMS message.
The action that sends the SMS messages starts like this:
[CODE]set_time_limit (0);
$textMessage = urlencode($_GET[‘textMessage’]);
$textMessage1 = $_GET[‘textMessage’];
$number = count($cb);
$todayDate = date(“Y-m-d”);
$todayTime = date(“H:i:s”);
foreach ($cb as $val) {
1)the action that sends the SMS messages….
2)write data into database (e.g. log the sent sms etc…)
}
As you can see I have to URLENCODE the text that is provided by the user in the form in order for it to go through, but I am also keeping a non–encoded version of the text message so that I can log it into the database.
The following code will successfully fetch the firstName for each $val (mobilePhone).
[code=php]$sqlgetfname = “SELECT `firstName`,`mobilePhone` FROM `Results` WHERE `mobilePhone` = ‘$val'”;
$queryfname = mysql_query($sqlgetfname) or die(‘ERROR: ‘.mysql_errno().’, ‘.mysql_error());
$fnamerow = mysql_fetch_array($queryfname);
$fname = $fnamerow[‘firstName’];
What do I have to do in order to supply my user with a certain variable, that if inserted into the textMessage box will include the recipient’s firstName in the message.
For example = instead of sending “Hello your account is active” to 50,000 people, I could send “Hello %variable%, your account is active, and %variable% will change according to the recipient’s firstName.
Thanks for your help.