The Little Guy Posted August 19, 2008 Share Posted August 19, 2008 In the message it shows: To, From, Subject. An example would be: FRM:site.com SUBJ: Subject MSG: my message I would like to change it so it would look like this: my message I am using the PHP mail function. How, or is it possible to do this? // $e is the users phone provider email extention. $headers .= 'To: '.$_SESSION['first'].' <'.$row['phoneNumber'].'@'.$e.'>' . "\r\n"; $headers .= 'From: DudEel.com <no-reply@dudeel.com>' . "\r\n"; mail($row['phoneNumber'].'@'.$e, 'DudEel Pin', 'Your Pin: '.$pin, $headers); Quote Link to comment https://forums.phpfreaks.com/topic/120295-sms-question/ Share on other sites More sharing options...
JasonLewis Posted August 19, 2008 Share Posted August 19, 2008 You could use strpos. $str ="FRM:site.com SUBJ: Subject MSG: my message"; $msg = substr($str, stripos($str, "MSG:"),strlen($str)); echo $msg; Not tested. (at school) Quote Link to comment https://forums.phpfreaks.com/topic/120295-sms-question/#findComment-619758 Share on other sites More sharing options...
The Little Guy Posted August 19, 2008 Author Share Posted August 19, 2008 That won't work, because all that is processed by the phone. I was hoping there was some sort of header(s) that would hide all that info...? Quote Link to comment https://forums.phpfreaks.com/topic/120295-sms-question/#findComment-619759 Share on other sites More sharing options...
Andy-H Posted August 19, 2008 Share Posted August 19, 2008 Login Looks like you reached a page that requires a login, enter your email and password on the right hand side to log in. If you don't have an account with us, click on "Create Account" under the login button. The account creation period only takes a few minutes, just answer a few simple questions, confirm your email, and sign in. Within minutes you can have a page with us, and start creating your pages for users to come to. Make some friends, watch some movies, and look at some pictures. Creating, operating, and maintaining your account is free of charge (unless you hire someone to do it for you). If you hire someone for this job we are in no way responsible for any losses you may take (password/data/media/etc.). Warning: include(incl/boxes/login.php) [function.include]: failed to open stream: No such file or directory in /home/.marble/ryannaddy/dudeel.com/login.php on line 33 Warning: include() [function.include]: Failed opening 'incl/boxes/login.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.marble/ryannaddy/dudeel.com/login.php on line 33 Duno if you knew??? Entered username: ' Password: ' Quote Link to comment https://forums.phpfreaks.com/topic/120295-sms-question/#findComment-619760 Share on other sites More sharing options...
The Little Guy Posted August 19, 2008 Author Share Posted August 19, 2008 Warning: include(incl/boxes/login.php) [function.include]: failed to open stream: No such file or directory in /home/.marble/ryannaddy/dudeel.com/login.php on line 33 Warning: include() [function.include]: Failed opening 'incl/boxes/login.php' for inclusion (include_path='.:/usr/local/php5/lib/php:/usr/local/lib/php') in /home/.marble/ryannaddy/dudeel.com/login.php on line 33 Duno if you knew??? Entered username: ' Password: ' You didn't get those errors because you entered in a single quote, you got those because I included the wrong file, it should be fixed. Quote Link to comment https://forums.phpfreaks.com/topic/120295-sms-question/#findComment-619762 Share on other sites More sharing options...
Andy-H Posted August 19, 2008 Share Posted August 19, 2008 I know but I assumed that you needed to get an error returned for it to work as you hadn't noticed and had probably logged in at some point... Quote Link to comment https://forums.phpfreaks.com/topic/120295-sms-question/#findComment-619824 Share on other sites More sharing options...
Lamez Posted August 19, 2008 Share Posted August 19, 2008 I found this on my Web host's site, it helps send SMS messages, but you are going to have to do a little programming, and mess with it. <?php ################################################## # SAMPLE PHP CODE TO SEND SMS VIA SERVAGE API ################################################## // Send SMS function function sendSMS($number,$message,$concat = 1) { $url = 'http://smsgateway.servage.net/sms.php'; $customer = 'YOURCUSTOMERID'; $key = 'YOURKEY'; $request = $url.'?customer='.$customer.'&key='.$key.'&number='.urlencode($number).'&message='.urlencode($message).'&concat='.$concat; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $request); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($ch); curl_close($ch); return split(',',$response); } // Integration in your project $sms_api_result = sendSMS('number','text','1'); // Check if SMS was received by the API or not if ($sms_api_result[0] == 'OK') { // Ok, SMS received by the API // Do something here... } else { // Failure, SMS was not received by the API // I this example we display the response to identify the error print_r($sms_api_result); } ################################################## # SAMPLE PHP CODE FOR SMS COVERAGE QUERY ################################################## // Coverage Query function function coverageQuery($number) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://smsgateway.servage.net/sms_coverage.php?number='.$number); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); if (substr($data,0,2) == 'OK') return true; else return false; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/120295-sms-question/#findComment-619840 Share on other sites More sharing options...
The Little Guy Posted August 19, 2008 Author Share Posted August 19, 2008 I found this on my Web host's site, it helps send SMS messages, but you are going to have to do a little programming, and mess with it. <?php ################################################## # SAMPLE PHP CODE TO SEND SMS VIA SERVAGE API ################################################## // Send SMS function function sendSMS($number,$message,$concat = 1) { $url = 'http://smsgateway.servage.net/sms.php'; $customer = 'YOURCUSTOMERID'; $key = 'YOURKEY'; $request = $url.'?customer='.$customer.'&key='.$key.'&number='.urlencode($number).'&message='.urlencode($message).'&concat='.$concat; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $request); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($ch); curl_close($ch); return split(',',$response); } // Integration in your project $sms_api_result = sendSMS('number','text','1'); // Check if SMS was received by the API or not if ($sms_api_result[0] == 'OK') { // Ok, SMS received by the API // Do something here... } else { // Failure, SMS was not received by the API // I this example we display the response to identify the error print_r($sms_api_result); } ################################################## # SAMPLE PHP CODE FOR SMS COVERAGE QUERY ################################################## // Coverage Query function function coverageQuery($number) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://smsgateway.servage.net/sms_coverage.php?number='.$number); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); if (substr($data,0,2) == 'OK') return true; else return false; } ?> Sorry, but I don't want to use a service to send text messages. Quote Link to comment https://forums.phpfreaks.com/topic/120295-sms-question/#findComment-619842 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.