-
Notifications
You must be signed in to change notification settings - Fork 3
/
test_page.php
66 lines (53 loc) · 1.51 KB
/
test_page.php
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<html>
<head>
<title>Test page</title>
</head>
<body>
<?php
if(isset($_FILES['file1'])){
echo 'UPLOADED FILE: ';
$file = dirname(__FILE__).'\\'.$_FILES['file1']['name'];
if(move_uploaded_file($_FILES['file1']['tmp_name'], $file )){
echo $_FILES['file1']['name'];
@unlink( $file );
}
else echo 'ERROR';
}
?>
<?php
if (isset($_POST["product_name"])) {
$prod = $_POST["product_name"];
?><div id="result1" style="background:green"><?php echo $prod; ?><br/><br/></div>
<?php
} else {
?>
<form name="form1" method="post" enctype="multipart/form-data">
product name: <input type="text" name="product_name" id="prod_name" size="40" value="<?php if (isset($prod)) echo $prod;?>"/>
<select name="sel1">
<option id="1" value="1">option 1</option>
<option id="2" value="2">option 2</option>
<option id="3" value="3">option 3</option>
<option id="4" value="4">option 4</option>
</select>
<br/>
<input type="file" id="file1" name="file1"/>
<br/>
<input type="checkbox" name="chbox1"/>checkbox<br/>
<br/>
<input type="submit" value="Confirm"/>
</form>
<?php } ?>
<br/><div name="div1">lorem ipsum</div>
<a href="javascript:sayHelloAlert('computer')">say hello (javascript)</a>
<p>
<a href="http://www.google.com" target="_blank">Open new popup window to Google</a>
<script type="text/javascript">
function sayHello(name) {
return "hello "+name+" !!!";
}
function sayHelloAlert(name) {
alert(sayHello(name));
}
</script>
</body>
</html>