-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
146 lines (133 loc) · 5.45 KB
/
index.html
File metadata and controls
146 lines (133 loc) · 5.45 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<style type="text/css">
.container
{
width: 200px;
height: 100px;
background-color: #d97855;
text-align: center;
margin-left: 400px;
margin-top: 200px;
}
body
{
background-color: #e6e884;
}
.btn
{
background-color: #e64568;
color: white;
}
</style>
<!DOCTYPE html>
<html>
<head>
<title>Welcome to javascript practice</title>
</head>
<body>
<div class="container">
<label>Type Function Name</label>
<br><br>
<input type="text" name="tx1" id="funnam">
<br><br>
<button class="btn" id="pro">Process</button>
</div>
</body>
<script type="text/javascript">
document.getElementById('pro').addEventListener('click',function Process() {
const txtfun=document.getElementById('funnam').value;
if(txtfun=='lorem()')
{
const ansdv=document.createElement("div");
ansdv.setAttribute("id","divans");
ansdv.innerText="Your Answer Is:"
ansdv.setAttribute("style","width:400px;height:300px;background-color:#fae3b9;margin-left:650px;text-align:center");
const h4=document.createElement("h4");
h4.setAttribute("id","h4data");
h4.innerText="Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed vehicula erat in nibh tempor mollis. Donec eget ipsum tristique justo eleifend tristique. Aliquam scelerisque aliquam mi, vel laoreet eros mollis eget. Pellentesque placerat, orci sit amet consectetur egestas, purus sem dictum velit, eu maximus quam ante non libero. Cras a viverra nunc, ac faucibus lacus. Donec efficitur, libero vulputate accumsan dapibus, ex augue convallis nulla, a mattis sapien ipsum quis massa.";
ansdv.appendChild(h4);
const bd=document.body;
bd.appendChild(ansdv);
}
else if(txtfun=='insert()')
{
const ansdv=document.createElement("div");
ansdv.setAttribute("id","divans");
ansdv.innerText="Your Answer Is:"
ansdv.setAttribute("style","width:400px;height:300px;background-color:#fae3b9;margin-left:650px;text-align:center");
const h4=document.createElement("h4");
h4.setAttribute("id","h4data");
h4.innerText="INSERT INTO table_name (column1, column2, column3,columnN)VALUES (value1, value2, value3,valueN)";
ansdv.appendChild(h4);
const bd=document.body;
bd.appendChild(ansdv);
}
else if(txtfun=='join()')
{
const ansdv=document.createElement("div");
ansdv.setAttribute("id","divans");
ansdv.innerText="Your Answer Is:"
ansdv.setAttribute("style","width:400px;height:300px;background-color:#fae3b9;margin-left:650px;text-align:center");
const h4=document.createElement("h4");
h4.setAttribute("id","h4data");
h4.innerText="SELECT Orders.OrderID, Customers.CustomerName, Orders.OrderDateFROM Orders INNER JOIN Customers ON Orders.CustomerID=Customers.CustomerID;\n\n\n SELECT column_name(s) FROM table1 LEFT JOIN table2 ON table1.column_name = table2.column_name;";
ansdv.appendChild(h4);
const bd=document.body;
bd.appendChild(ansdv);
}
else if(txtfun=='phpstringfun()')
{
const ansdv=document.createElement("div");
ansdv.setAttribute("id","divans");
ansdv.innerText="Your Answer Is:"
ansdv.setAttribute("style","width:400px;height:300px;background-color:#fae3b9;margin-left:650px;text-align:center");
const h4=document.createElement("h4");
h4.setAttribute("id","h4data");
h4.innerText="(1)echo md5($str);\n\n(2)echo sha1($str);\n\n(3)echo str_replace('world','Peter','Hello world!');\n\n(4)echo str_word_count('world Hello !'');\n\n(5)echo strtolower(' WORLD hello');\n\n(6)echo ucwords('world hello')\n\n(7)print_r(str_split('world'));";
ansdv.appendChild(h4);
const bd=document.body;
bd.appendChild(ansdv);
}
else if(txtfun=='mysqlprepared()')
{
const ansdv=document.createElement("div");
ansdv.setAttribute("id","divans");
ansdv.innerText="Your Answer Is:"
ansdv.setAttribute("style","width:400px;height:300px;background-color:#fae3b9;margin-left:650px;text-align:center");
const h4=document.createElement("h4");
h4.setAttribute("id","h4data");
h4.innerText="$stmt = $conn->prepare('INSERT INTO MyGuests (firstname, lastname, email) VALUES (?, ?, ?)'')\n\n$stmt->bind_param('sss', $firstname, $lastname, $email);\n\n$stmt->execute();\n\n\nThe argument may be one of four types:\n\n i - integer\n d - double\n s - string\n b - BLOB";
ansdv.appendChild(h4);
const bd=document.body;
bd.appendChild(ansdv);
}
else if(txtfun=='phpwithajax()')
{
const ansdv=document.createElement("div");
ansdv.setAttribute("id","divans");
ansdv.innerText="Your Answer Is:"
ansdv.setAttribute("style","width:400px;height:300px;background-color:#fae3b9;margin-left:650px;text-align:center");
const h4=document.createElement("h4");
h4.innerText="Folllow this link:-https://www.w3schools.com/php/php_ajax_intro.asp";
ansdv.appendChild(h4);
const bd=document.body;
bd.appendChild(ansdv);
}
else if(txtfun=="phparray()")
{
const ansdv=document.createElement("div");
ansdv.setAttribute("id","divans");
ansdv.innerText="Your Answer Is:"
ansdv.setAttribute("style","width:400px;height:300px;background-color:#fae3b9;margin-left:650px;text-align:center");
const h4=document.createElement("h4");
h4.innerText="$cars=array('Volvo','BMW','Toyota');\n\n(1)print_r(array_chunk($cars,2));\n\n(2)(array_key_exists('Volvo',$cars));\n\n(3)print_r(array_merge($a1,$a2));\n\n(4)print_r(array_slice($cars,2));\n\n(5)print_r(array_unique($cars)); ";
ansdv.appendChild(h4);
const bd=document.body;
bd.appendChild(ansdv);
}
else
{
alert("No Function Found");
}
});
</script>
</html>