PHP Classes
Icontem

File: example_small/example1.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jonatan Heyman  >  MMS Decoder  >  example_small/example1.php  
File: example_small/example1.php
Role: Example script
Content type: text/plain
Description: Small example on how to recieve and decode an MMS.
Class: MMS Decoder
Recieve, decode and display MMS messages.
 

Contents

Class file image Download
<?php
/**
 * If the URL to this script is used as the MMSC url, the MMS messages 
 * will be saved in the same directory with the unix timestamp as filenames. 
 *
 * Copyright (c) 2004 Jonatan Heyman
 */


require_once("../mmsdecoder.php");

// check that something has actually been sent to the script
if ($HTTP_RAW_POST_DATA != "") {
    
// parse MMS
    
$mms = new MMSDecoder($HTTP_RAW_POST_DATA);
    
$mms->parse();
    
    
// The MMS is parsed, so let's get the mms data from the class by the print_r() function,
    
$mmsdata print_r($mmstrue);
    
$filename time();
    
    
// make sure the file is writable
    
if (is_writable($filename)) {
        
// write mms data to file
        
$file fopen($filename"w");
        
fwrite($file$mmsdata);
        
fclose($file);
    }
    
    
// send confirmation response
    
header('Content-type: application/vnd.wap.mms-message');
    
$mms->confirm();
} else
    echo 
"This script should be accessed by an MMS client, wich shoul send MMS data!";


?>

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products