Jump to content


Check out our Community Blogs

ghost2012

Member Since 27 Oct 2009
Offline Last Active Dec 16 2010 02:07 PM
-----

Topics I've Started

Update via Textarea

16 December 2010 - 12:13 PM

I'm trying to learn to update a table in mysql from a textarea. <textarea rows="30" cols="60" name="content" /><?php echo $row['content'] ?></textarea>. This is the mysql command i use. mysql_query("UPDATE pages SET content='$content' WHERE id='$id'");. I'm not sure why it's not doing it. Also I'm using tinymce as the editor and the area is hard to edit. If anyone has any suggestions please let me know.

Send text message via php (issue)

25 June 2010 - 05:24 PM

I've been using a friends code to send an sms message via php. The only issue is that on receiving the message it gives out the hosting servers name. Now this I know can lead to a security issue. So am I'm turning to you guys to see what is it that I've missed.

This code uses the mail function of PHP
The default sub is set to TestingText

Here is the general form:
<form id="sms" name="sms" method="post" action="send.php">
<table width="400">
  <tr>
    <td align="right" valign="top">From:</td>
    <td align="left"><input name="from" type="text" id="from" size="30" /></td>
  </tr>
  <tr>
    <td align="right" valign="top">To:</td>
    <td align="left"><input name="to" type="text" id="to" size="30" /></td>
  </tr>
  <tr>
    <td align="right" valign="top">Carrier:</td>
    <td align="left"><select name="carrier" id="carrier">
      <option value="verizon">Verizon</option>
      <option value="tmobile">T-Mobile</option>
   <option value="sprint">Sprint</option>
   <option value="att">AT&T</option>
   <option value="virgin">Virgin Mobile</option>
    </select></td>
  </tr>
  <tr>
    <td align="right" valign="top">Message:</td>
    <td align="left"><textarea name="message" cols="40" rows="5" id="message"></textarea></td>
  </tr>
  <tr>
    <td colspan="2" align="right"><input type="submit" name="Submit" value="Submit" /></td>
    </tr>
</table>
</form>
And here is the php code:

 <?php
$from = $_POST['from'];
$to = $_POST['to'];
$carrier = $_POST['carrier'];
$message = stripslashes($_POST['message']);

if ((empty($from)) || (empty($to)) || (empty($message))) {
echo"Fail";
}

else if ($carrier == "verizon") {
$formatted_number = $to."@vtext.com";
mail("$formatted_number", "TestingText", "$message");

echo"Success";
}

else if ($carrier == "tmobile") {
$formatted_number = $to."@tomomail.net";
mail("$formatted_number", "TestingText", "$message");

echo"Success";
}

else if ($carrier == "sprint") {
$formatted_number = $to."@messaging.sprintpcs.com";
mail("$formatted_number", "TestingText", "$message");

echo"Success";
}

else if ($carrier == "att") {
$formatted_number = $to."@txt.att.net";
mail("$formatted_number", "TestingText", "$message");
echo"Success";
}

else if ($carrier == "virgin") {
$formatted_number = $to."@vmobl.com";
mail("$formatted_number", "TestingText", "$message");

echo"Success";
}
?>
If anyone has any idea of cloaking the hosting servers name. Let me know please.
Thanks all.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download