-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
35 lines (32 loc) · 1.02 KB
/
index.php
File metadata and controls
35 lines (32 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
ini_set('default_charset', 'utf-8');
$con=mysqli_connect("localhost","root","","test")or die("Connection faild: ".mysqli_connect_error());
if(!mysqli_connect_errno()){
if($_SERVER['REQUEST_METHOD'] == 'POST'){
if(!empty($_POST['control'])){
if($_POST['control'] == 'Import')
require("Pages/import_excel.php");
else if($_POST['control'] == 'Export')
require("Pages/export_excel.php");
else
echo "Please enter control option.";
}
}else{
?>
<form action="" method="post" enctype="multipart/form-data">
<label for="Import">Please choose from bellow:</label><br/>
<input type="radio" name="control" value="Import" checked>
<label for="Import">Import</label>
<input type="radio" name="control" value="Export">
<label for="Export">Export</label><br><br>
<div id='file-div'>
<label for="File" >File: </label>
<input type="file" name="file">
</div><br/>
<input type="submit" value="Submit">
</form>
<?php
}
}else
echo "Connection Error";
?>