Made to work with magic quotes on or off.
[openemr.git] / interface / vektis / vk_validate.php
blob7e3ff5e6c138cd4a95032419c32e6ed87faaa249
1 <?php
2 /**
3 * VEKTIS
5 * @author Cristian NAVALICI
6 * @version 1.0 feb 2008
8 */
10 require_once("../globals.php");
11 require_once("$srcdir/acl.inc");
13 // Check authorization.
14 $thisauth = acl_check('admin', 'vektis');
15 if (!$thisauth) die("Not authorized.");
18 <html>
20 <head>
22 <link rel=stylesheet href='<?php echo $css_header ?>' type='text/css'>
23 <LINK href="<?php echo $css_dbc ?>" rel="stylesheet" type="text/css">
24 <title>Vektis Validation</title>
25 </head>
27 <body <?php echo $top_bg_line;?>>
29 <form enctype="multipart/form-data" action="<?echo $_SERVER['PHP_SELF'] ?>" method="POST">
30 <input type="radio" name="resim" value="1" checked="checked" />Simulation <br />
31 <input type="radio" name="resim" value="2" />Real <br />
33 <input type="hidden" name="MAX_FILE_SIZE" value="500000" />
34 Upload the Vektis returning file: <input name="returnfile" type="file" />
35 <input type="submit" value="Upload and validate" name="submitfile" />
36 </form>
38 <?php
39 if ( $_POST['submitfile'] ) {
40 $upddir = 'retuploads/';
41 $updfile = $upddir . basename($_FILES['returnfile']['name']);
43 if (move_uploaded_file($_FILES['returnfile']['tmp_name'], $updfile)) {
44 echo "File was successfully uploaded.<br />";
45 // accept only 1-2
46 $state = ( ($_POST['resim'] == 1) || ($_POST['resim'] == 2) ) ? $_POST['resim'] : 1;
47 vk_parse_returning_file($updfile, $state);
48 } else {
49 echo "Possible file upload attack!\n";
54 </body>
55 </html>