![]() |
![]() |
![]() |
|
Enthusiast ![]() Joined Aug 16, '06 From Sandpoint, Idaho Currently Offline Reputation: 0 (0%) ![]() |
I'm piecing together a script to send text messages from one of my sites to my cell phone. I got it all work'd out all fine and It sends the message fine but the 'from address' is defined as anonymous@myserver.com when I'd like to have it as either...
1) I'd prefer to have it as the email address that the person fills out on the form that texts me OR 2)nobody@mydomain.com the current script is.. CODE <?php
$to="##########@vtext.com, myemail@mydomain.com"; $sucessURL="http://www.mydomain.com/success"; $failureURL="http://www.mydomain.com/error"; $subject="sitetxt"; $msg = "Name: {$_POST['txtName']}\nPhone: {$_POST['txtNumber']}\nEmail: {$_POST['txtEmail']}\nMessage: ".nl2br($_POST['txtMessage'])." "; $headers = "From: {$_POST['txtEmail']}"; if(mail($to, $subject, $msg, $headers)) { header("Location: $sucessURL"); } else { header("Location: $failureURL"); } ?> -------------------- |
![]() |
![]() |
|
Enthusiast ![]() Joined Aug 16, '06 From Sandpoint, Idaho Currently Offline Reputation: 0 (0%) ![]() |
that didn't seem to help, I'm still getting the message from anonymous@myserver.com
my form code CODE <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>TextMe</TITLE> <META http-equiv=Content-Type content="text/html; charset=iso-8859-1"> <META content="MSHTML 6.00.2900.2180" name=GENERATOR> <STYLE>BODY { COLOR: #373737; FONT-FAMILY: Verdana, sans-serif } TD { FONT-SIZE: 11px } #warning { DISPLAY: none } </STYLE> <script type=text/javascript> var totalchars = 100; function countChars() { // getting the remaining characters (will also count line beaks!) charNum = totalchars - (document.textmeform.txtName.value.length + document.textmeform.txtNumber.value.length + document.textmeform.txtMessage.value.length) //dumping the number in your input box document.textmeform.characters.value = charNum if ( charNum <= 0 ) { document.textmeform.characters.style.background = "#FF9966"; document.getElementById("warning").style.display = "block"; } else { document.textmeform.characters.style.background = "#FFFFFF"; document.getElementById("warning").style.display = "none"; } } </SCRIPT> </HEAD> <BODY onkeydown=countChars() onkeyup=countChars()> <FORM name=textmeform action=TextMe.php method=post> <BR><STRONG>Please use the form below to send a short text message to my cell phone.<BR><BR></STRONG> <TABLE width="100%" align=center border=0> <TBODY> <TR> <TD> <TABLE> <TBODY> <TR> <TD> <P align=right>Your Name:</P></TD> <TD> <P align=left><INPUT onkeydown=countChars() onkeyup=countChars() onchange=countChars() name=txtName></P></TD></TR> <TR> <TD> <P align=right>Your Phone Number </P></TD> <TD><INPUT onkeydown=countChars() onkeyup=countChars() onchange=countChars() name=txtNumber></TD></TR> <TR> <TD align=right>Your Email Address </TD> <TD><INPUT name=txtEmail></TD></TR> <TR> <TD align=right>Your Message </TD> <TD><TEXTAREA onkeydown=countChars() onkeyup=countChars() name=txtMessage onchange=countChars()></TEXTAREA></TD></TR> <TR> <TD align=right> </TD> <TD><INPUT type=submit value="Send Message" name=Button1></TD></TR> <TR> <TD align=right>Characters Remaining:</TD> <TD><INPUT id=characters size=3 value=100 name=characters></TD></TR></TBODY></TABLE><BR> <DIV id=warning>You have more than 100 characters! <BR>Your message may be truncated. </DIV></TD> <TD> </TD> <TD> <IMG src=""></TD></TR></TBODY></TABLE> </FORM></FONT></BODY></HTML> -------------------- |
![]() ![]() |
Lo-Fi Version | Time is now: July 26th, 2025 - 3:59 AM |