File: example.php

Recommend this page to a friend!
  Classes of Aaron Cox  >  Msg2Pic  >  example.php  >  Download  
File: example.php
Role: Example script
Content type: text/plain
Description: Example of how to use Msg2Pic class to convert messages into b/w pictures and vice versa. This would allow messages to be hidden in picture files thus adding a degree of stealth to the user's arsenal.
Class: Msg2Pic
Encode and decode text messages inside pictures
Author: By
Last change:
Date: 5 years ago
Size: 2,194 bytes
 

Contents

Class file image Download
<?php
/* ------------------------------------------------------------------------------------------------------------------------------------------
    File: example.php
    Author: Aaron Cox ( aaron@gshirt.biz )
    Date: 09/01/2014
    Purpose: To allow the conversion of a message into a b/w picture and vice versa. This would allow messages to be hidden in picture files
    thus adding a degree of stealth to the user's arsenal.
------------------------------------------------------------------------------------------------------------------------------------------ */

require_once( "msg2pic.php" );

/* ------------------------------------------------------------------------------------------------------------------------------------------
    * Message to Convert to B/W Picture:
------------------------------------------------------------------------------------------------------------------------------------------ */

$MESSAGE = <<< EOT

How you can help the United States to win the Championship of 2014?

You can help by doing the following:

1. Submit More Innovative PHP Packages

    If you submit innovative packages you will be nominated to win the month innovation award.
    The site users will vote and all nominees will earn points depending on their position of the month ranking.
    The innovation points that you earn each month will be added to your country score.
    The country that accumulates more points throughout the year will be the Championship Winner of the year.

EOT;

// ------------------------------------------------------------------------------------------------------------------------------------------

$filename = "example.png"; // Filename for picture

$Msg2Pic = new Msg2Pic( $MESSAGE ); // Initiate Msg2Pic Object

$Msg2Pic->output_header(); // Output header for example

$Msg2Pic->message_to_picture( $filename ); // Convert message to image 'example.png'
$Msg2Pic->output_m2p( $filename ); // Output message to picture conversion info

$Msg2Pic->picture_to_message( $filename ); // Convert image 'example.png' to a message
$Msg2Pic->output_p2m( $filename ); // Output picture to message conversion info

?>


For more information send a message to info at phpclasses dot org.