code.fastix.org

Dateiansicht:

Datei:Projekte -> PHP:executeAlone -> executeStorage -> php_sEtdoZ
md5:c104c6cc698cefdd9df34604e2325a59
sha1:14055cc2ae84fa10e729a68f4fdc07f802295562
Download-Link:Download
  1. <?php
  2. $_ENV = array (
  3. );
  4.  
  5. $_GET = array (
  6. );
  7.  
  8. $_POST = array (
  9.   'mailto' => 'fastix',
  10. );
  11.  
  12. $_COOKIE = array (
  13. );
  14.  
  15. $_SESSION = array (
  16.   'id' => 'ab3g78908r0ptrft93so3mebno',
  17.   'test' => 'Test',
  18. );
  19.  
  20. $foo = 'FOO';
  21.  
  22. $bar = 'BAR';
  23.  
  24.  
  25. # All in the next rows the is only a example. Do her, what you have to do!
  26.  
  27. /*
  28. * Configuration:
  29. */
  30.  
  31. $deleteFile = true; #delete the temporary File after execution? Set FALSE for debugging.
  32. $to         = "fastix@localhost"; # Often you want to use the mailaddress from the user, given via formular ($_POST, $_GET).
  33. $subject    = "alone executed";
  34.  
  35. /*
  36. * This is only a DEMONSTRATION how to handle the data. Show to executeCaller.php how export the vars.
  37. */
  38.  
  39. ob_start(); # save all output to a buffer!
  40.  
  41. ini_set("display_errors", 1);
  42.  
  43. #
  44. if ( false === strpos( __FILE__, 'executeAlone.php' ) ) {
  45.     trigger_error ( "Dieses Skript sollte nicht direkt aufgerufen werden!", E_USER_ERROR );
  46. }
  47.  
  48. echo "Data:\n=====\n\n";
  49.  
  50. if ( isset( $_SESSION )  ) {
  51.     session_id( $_SESSION['id'] );
  52.     session_start();
  53.     # this is only for the mail:
  54.    echo '$_SESSION = ' . var_export( $_SESSION, true ) . "\n\n";
  55. }
  56.  
  57. if ( isset( $_ENV )  ) {
  58.     # this is only for the mail:
  59.    echo '$_ENV = ' . var_export( $_ENV, true ) . "\n\n";
  60. }
  61.  
  62. if ( isset( $_SERVER )  ) {
  63.     # this is only for the mail:
  64.    echo '$_SERVER = ' . var_export( $_SERVER, true ) . "\n\n";
  65. }
  66.  
  67. if ( isset( $_GET )  ) {
  68.     # this is only for the mail:
  69.    echo '$_GET = ' . var_export( $_GET, true ) . "\n\n";
  70. }
  71.  
  72. if ( isset( $_POST )  ) {
  73.     # this is only for the mail:
  74.    echo '$_POST = ' . var_export( $_POST,  true) . "\n\n";
  75. }
  76.  
  77. if ( isset( $_COOKIE )  ) {
  78.     #
  79.    # You have to know, that you DON'T can send cookies to the Browser!
  80.    #
  81.    # this is only for the mail:
  82.    echo '$_COOKIE = ' . var_export( $_COOKIE, true ) . "\n\n";
  83. }
  84.  
  85. if ( isset( $foo )  ) {
  86.     echo '$foo = ' . var_export($foo, 1) . "\n";
  87. }
  88.  
  89. if ( isset( $bar )  ) {
  90.     echo '$bar = ' . var_export($bar, 1) . "\n";
  91. }
  92.  
  93. # Now you can send all output to the given emailaddress:
  94. $message = ob_get_clean();
  95. mb_language( 'uni' );
  96. mb_send_mail ( $to , $subject , $message, '', '' );
  97.  
  98. # This can delete the file after executing
  99.  
  100. if ( $deleteFile && ( false === strpos(__FILE__, 'executeAlone.php' ) ) ) {
  101.     unlink (__FILE__);
  102. }