AMHSOFT e.K
البلد:
برمج معنا
المكتبات

اتصل بنا في المانيا
الهاتف: 00 49 5312801805
المسنجر:ksa

دخول
اسم المستخدم:
كلمة المرور:



كيفية استعمال مكتبة request.class.lib.php
مكتبة request هى المكتبة المسؤولة على النماذج و الهدف من ورائها هو توحيد التعامل مع المعلومات المرسلة من النماذج فحيث اذا طرا خطا يكون التصحيح في مكان واحد دون عناء البحث

استعمالها يكون كالاتي

1 <form name="myform" action="" method="post">
2     <input type="hidden" name="id" value="5">
3     <input type="text" name="firstname" value="Mohammed Mohammed">
4     <input type="file" name="uploadImage">
5 </form>


1 /*my first Class*/
2 class cMyclass extends Page{
3     function __default()
4     {
5         $id = $this->request->postId();
6         /*$id is now 5*/
7         /*if the method of the form was GET then we would call:*/
8         /*$id = $this->request->getId()*/
9         $firstname = $this->request->post("firstname");
10         /* $firstname is now Mohammed Mohammed*/
11         /*or $firstname = $this->request->get("firstname");*/
12         $file = $this->request->postFile("uploadImage");
13          /* $file is now my uploaded File*/
14     }
15 }
16


1 /*All function/*The functions listed below have the prefix post because*/
2 /*they are used for the form method POST. */
3 /*If the form method was GET all functions would have */
4 /*the prefix get in place of post.$this->request->getId();*/
5
6
7 /*@param string name of the input*/
8 /*@return string value of the input*/
9 $this->request->post($param);
10
11
12 /*@param string name of the input*/
13 /*@return string value of the input*/
14 $this->request->get($param);
15
16
17 /*@param string name of the input*/
18 /*@return integer/boolean false if the value of the input is empty*/
19 $this->request->postIn($param);
20
21
22 /*@param string name of the input*/
23 /*@return integer/boolean false if the value of the input is empty*/
24 $this->request->getIn($param);
25
26
27 /*@param string name of the input*/
28 /*@return float/boolean false if the value of the input is empty*/
29 $this->request->postFloat($param);
30
31
32 /*@param string name of the input*/
33 /*@return float/boolean false if the value of the input is empty*/
34 $this->request->getFloat($param);
35
36
37 /*@param string name of the input*/
38 /*@return Date*/
39 $this->request->postDate($param);
40
41
42 /*@param string name of the input*/
43 /*@return Date*/
44 $this->request->getDate($param);
45
46
47 /*@param string name of the input*/
48 /*@return array of string*/
49 $this->request->posts();
50
51
52 /*@param string name of the input*/
53 /*@return array of string*/
54 $this->request->gets();
55
56
57 /*@param string name of the input*/
58 /*@return array of integer*/
59 $this->request->postInts();
60
61
62 /*@param string name of the input*/
63 /*@return array of integer*/
64 $this->request->getInts();
65
66
67 /*@param string name of the input*/
68 /*@return array of float*/
69 $this->request->postFloats();
70
71
72 /*@param string name of the input*/
73 /*@return array of float*/
74 $this->request->getFloats();
75
76
77 /*@param string name of the input*/
78 /*@return string file*/
79 $this->request->file();
80
  Copyright © by AMHSOFT e.K 2005 - 2008