PX : code

EXPORT FILE FROM A WEB BROWSER by CIF & FOB
Download this code


<?php
     
/*****************************************
     * EXPORT FILE FROM A WEB BROWSER
     ******************************************/

if ($_POST['submit']) {

     
header('Content-Type: text/x-sql');
     
header('Expires: ' gmdate('D, d M Y H:i:s') . ' GMT');

     
// browser and version
     // (must check everything else before Mozilla)
     
if (preg_match('@Opera(/| )([0-9].[0-9]{1,2})@'$_SERVER['HTTP_USER_AGENT'], $log_version)) {
        
define('PMA_USR_BROWSER_AGENT''OPERA');
     } else if (
preg_match('@MSIE ([0-9].[0-9]{1,2})@'$_SERVER['HTTP_USER_AGENT'], $log_version)) {
        
define('PMA_USR_BROWSER_AGENT''IE');
     } else if (
preg_match('@OmniWeb/([0-9].[0-9]{1,2})@'$_SERVER['HTTP_USER_AGENT'], $log_version)) {
        
define('PMA_USR_BROWSER_AGENT''OMNIWEB');
     } else if (
preg_match('@(Konqueror/)(.*)(;)@'$_SERVER['HTTP_USER_AGENT'], $log_version)) {
        
define('PMA_USR_BROWSER_AGENT''KONQUEROR');
     } else if (
preg_match('@Mozilla/([0-9].[0-9]{1,2})@'$_SERVER['HTTP_USER_AGENT'], $log_version)
               && 
preg_match('@Safari/([0-9]*)@'$_SERVER['HTTP_USER_AGENT'], $log_version2)) {
        
define('PMA_USR_BROWSER_AGENT''SAFARI');
     } else if (
preg_match('@Mozilla/([0-9].[0-9]{1,2})@'$_SERVER['HTTP_USER_AGENT'], $log_version)) {
        
define('PMA_USR_BROWSER_AGENT''MOZILLA');
     } else {
        
define('PMA_USR_BROWSER_AGENT''OTHER');
     }

     
// lem9 & loic1: IE need specific headers
     
if (PMA_USR_BROWSER_AGENT == 'IE') {
        
header('Content-Disposition: inline; filename="WM-LICENSE.PHP"');
        
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        
header('Pragma: public');
     } else {
        
header('Content-Disposition: attachment; filename="WM-LICENSE.PHP"');
        
header('Pragma: no-cache');
     }

     
// Fake loop just to allow skip of remain of this code by break, I'd really
     // need exceptions here :-)
     
do {

        echo 
$_POST['ID']."::".md5($_POST['url']).md5($_POST['host_name']).md5($_POST['mail']);

     } while (
FALSE);
     
// End of fake loop

     
exit();
}
?>
<html>
<head>
      <title>EXPORT FILE FROM A WEB BROWSER</title>
      <style type=text/css>
        td,p,li,input,select {font-size:12px;}
      </style>
</head>
<body style="MARGIN-TOP: 0px; MARGIN-LEFT: 5px; MARGIN-RIGHT: 5px" text=#000000 vLink=#700070 link=#000066 bgColor=#ffffff leftMargin=5 topMargin=5 rightMargin=5>
<TABLE width="100%" align=center cellPadding=0 cellSpacing=0>
  <TBODY>
  <TR>
    <TD>
      <TABLE width="100%" height="366" border=0 cellPadding=0 cellSpacing=0>
        <TBODY>
        <TR>
          <TD width="70%" align="center" vAlign=top>
            <FORM name="generate_form" action="<? echo $_SERVER['PHP_SELF'];  ?>" method="post">
            <TABLE cellSpacing=0 cellPadding=2 width="62%" border=0>
              <TBODY>
              <TR>
                <TD align="left" bgColor=#a3bde2>&nbsp;&nbsp;EXPORT FILE FROM A WEB BROWSER</TD>
              </TR>
              <TR>
                <TD bgcolor="#F7F7F7">
                  <TABLE cellSpacing=0 cellPadding=5 width="101%" bgColor=#f7f7f7>
                    <TBODY>
                    <TR>
                      <TD>&nbsp;</TD>
                      <TD>
                        <TABLE cellSpacing=0 cellPadding=5 width="91%"
                        bgColor=#f7f7f7 border=0>
                          <TBODY>
                          <TR vAlign=top>
                            <TD align="left" valign="middle">* ID:</TD>
                            <TD align="left"><INPUT name="ID" size="40" maxLength="40">&nbsp;&nbsp;</TD>
                          </TR>
                          <TR vAlign=top>
                            <TD align="left" valign="middle">* URL:</TD>
                            <TD align="left"><INPUT name="url" size="40" maxLength="40">&nbsp;&nbsp;</TD>
                          </TR>
                          <TR vAlign=top>
                            <TD align="left" valign="middle">&nbsp;&nbsp;HOST NAME:</TD>
                            <TD align="left"><INPUT name="host_name" type="text" size="40" maxlength="40">&nbsp;&nbsp;</TD>
                            </TR>
                          <TR vAlign=top>
                            <TD align="left" valign="middle">&nbsp;&nbsp;E-mail:</TD>
                            <TD align="left"><INPUT maxLength="40" size="40" name="mail">&nbsp;&nbsp;</TD>
                          </TR>
                          <TR>
                            <TD width="20%" align="left" colspan="2">* Required Field</TD>
                          </TR>
                          </TBODY></TABLE></TD>
                      <TD>&nbsp;</TD></TR></TBODY></TABLE></TD></TR>
              <TR>
                <TD bgColor=#a3bde2 height=3>&nbsp;</TD></TR>
              <TR>
                <TD>&nbsp;</TD></TR>
              <TR>
                <TD>
      <DIV align=right><INPUT type=submit value="GENERATE ENCRPYT FILE" name=submit></DIV></TD></TR></TBODY></TABLE></FORM></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
</body>
</html>

Comments or questions?
PX is running PHP 5.2.17
Thanks to Miranda Productions for hosting and bandwidth.
Use of any code from PX is at your own risk.