forked from punitkatiyar/php-master-guide
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfunction.php
More file actions
48 lines (47 loc) · 1.22 KB
/
function.php
File metadata and controls
48 lines (47 loc) · 1.22 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
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
developer();
//echo $developer;
$dev="Punit Full Stcak Developer";
echo $dev;
// define the function
function developer(){
echo "<h1>Hi Developer</h1>";
}
// call the function
developer();
// passing the argument
// function developer(){
// echo "<h1>Hi Punit</h1>";
// }
function heading($title="Application user",$size=1,$color="blue"){
echo "<h$size style='color:$color;'>Hi $title</h$size>";
//print_r($_POST);
}
extract($_POST);
//print_r($_POST);
if(isset($_POST['go']))
{
// $title=$_POST['title'];
// $size=$_POST['size'];
// $color=$_POST['color'];
heading($title,$size,$color);
//echo "Hiii";
}
else{
heading();
echo "Byeee";
}
?>
<form method="post">
<input type="text" name="title" value="<?php echo @$title;?>" placeholder="Enter Your Name">
<select name="size">
<option value="1">Heading 1</option>
<option value="2">Heading 2</option>
<option value="3">Heading 3</option>
<option value="4">Heading 4</option>
<option value="5">Heading 5</option>
<option value="6">Heading 6</option>
</select>
<input type="color" name="color">
<input type="submit" name="go">
</form>