Skip to content

Commit 297b892

Browse files
committed
new
1 parent 976b393 commit 297b892

File tree

6 files changed

+164
-60
lines changed

6 files changed

+164
-60
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Coder Shiyar</title>
7+
</head>
8+
<body dir="rtl">
9+
10+
<form method="POST">
11+
<label>السعر</label>
12+
<input type="text" name="price" required>
13+
<label>نسبة تخفيض (%)</label>
14+
<input type="text" name="discount" required/>
15+
<button type="submit" name="submit">عرض السعر بعد تخفيض</button>
16+
</form>
17+
<?php
18+
if(isset($_POST['submit'])){
19+
20+
if(is_numeric($_POST['price'])==false){
21+
echo '<h3>بيانات الحقل السعر غير صالح</h3>';
22+
}
23+
if(is_numeric($_POST['discount'])==false){
24+
echo '<h3>بيانات الحقل النسبة تخفيضات غير صالح</h3>';
25+
}
26+
27+
if(is_numeric($_POST['price'])==true && is_numeric($_POST['discount']) == true){
28+
echo "<p>سعر قبل التخفيض ".$_POST['price']."</p>";
29+
$result = $_POST['price'] * (100- $_POST['discount']) / 100;
30+
echo " سعر بعد التخفيض ";
31+
echo "بالنسبة " . $_POST['discount'] . "% ";
32+
echo " يكون " . $result . " ليرة";}
33+
34+
}
35+
?>
36+
37+
<form method="GET">
38+
<div>
39+
<label>أسم : </label> <br>
40+
<input type="text" name="name" required/>
41+
</div>
42+
<div>
43+
<label>إيميل : </label><br>
44+
<input type="email" name="email" required/>
45+
</div>
46+
<div>
47+
<label>موضوع : </label><br>
48+
<input type="text" name="subject" required/>
49+
</div>
50+
51+
<div>
52+
<label>رسالة : </label><br>
53+
<input type="text" name="message" required/>
54+
</div>
55+
56+
<button type="submit" name="send">ارسال رسالة</button>
57+
</form>
58+
59+
<?php
60+
if(isset($_GET['send'])){
61+
echo "الأسم : ".$_GET['name'] . "<br>";
62+
echo "إيميل : ".$_GET['email'] . "<br>";
63+
echo "موضوع : ".$_GET['subject'] . "<br>";
64+
echo "رسالة : ".$_GET['message'] . "<br>";
65+
}
66+
?>
67+
68+
</body>
69+
</html>

LESSON 20 - الدرس/index.php

Lines changed: 0 additions & 60 deletions
This file was deleted.

LESSON 21 - الدرس/index.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
3+
4+
5+
<?php
6+
$name1 = "Coder Shiyar";
7+
$age1 = "1994-11-09";
8+
$birth_place1 = "Kobani";
9+
10+
$ID90324 = array("Shiyar Jamo","1994-11-09","Kobani");
11+
12+
for($counter=0;$counter<count($ID90324) ; $counter++){
13+
echo "<h1>".$ID90324[$counter]."</h1>";
14+
}
15+
?>
16+
17+
18+
19+
20+
21+
22+
23+
24+
25+
<?php
26+
// $fruit = array("تفاح","برتقال","انانس","موز");
27+
// $fruit[0] = "موز";
28+
// $fruit[1] = "تفاح";
29+
// $fruit[2] = "انانس";
30+
// $fruit[3] = "برتقال";
31+
32+
// echo $fruit[1];
33+
34+
// for($counter=0;$counter<count($fruit) ; $counter++){
35+
// echo "<h1>".$fruit[$counter] .": ".$counter."</h1>";
36+
// }
37+
?>
38+
39+

LESSON 22 - الدرس/index.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
<?php
3+
4+
$ID90324 = array("Shiyar Jamo","1994-11-09","Kobani");
5+
6+
for($counter=0;$counter<count($ID90324) ; $counter++){
7+
echo "<h1>".$counter.": ".$ID90324[$counter]."</h1>";
8+
}
9+
10+
foreach($ID90324 as $data){
11+
12+
echo "<h1>" . $data . "</h1>";
13+
}
14+
?>
15+

LESSON 23 - الدرس/index.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
<?php
3+
4+
// $ID90324 = ["Shiyar Jamo","1994-11-09","Kobani"];
5+
6+
$ID90324 = ['name' => 'Shiyar Jamo','age' => '1994-11-09','city' =>"Kobani",'country'=>'Netherlands'];
7+
8+
echo $ID90324['country'];
9+
10+
// foreach($ID90324 as $result => $data){
11+
// echo $result." :".$data."<br>";
12+
// }
13+
14+
15+
?>
16+

LESSON 24 - الدرس/index.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
<?php
3+
// $product = [ ["موز","برتقال","تفاح"] , ["خيار",'كوسا',"بندورة"] ];
4+
5+
// print_r($product);
6+
7+
// // echo "<h1>".$product[1][0]."</h1>";
8+
9+
// foreach($product as $result){
10+
// echo "<h1>" . $result[1] . "</h1>";
11+
// }
12+
13+
$user = [
14+
["id"=>1 , "name"=>"Coder Shiyar" , "email" =>"test@gmail.com"],
15+
["id"=>2 , "name"=>"Hamid" , "email" =>"test2@gmail.com"]
16+
];
17+
18+
foreach($user as $data){
19+
echo "<h3>" . $data['name'] . "</h3>";
20+
echo "<h3>" . $data['email'] . "</h3>";
21+
}
22+
23+
24+
?>
25+

0 commit comments

Comments
 (0)