سلام عليكم ،،
احب انوه لكل من شاهد الموضوع انا مبتدأ جداً ومعلوماتي بسيطه في PHP وقبل يومين اخذت لفه علي كلاسات والشغلات هذهوكتبت هذا الكود وهو بسيط بنسبه لكم بس احس اني عملت انجاز :eek2:
ملف التشغيل الفورم :كود PHP:class Form
{
function start_form($action,$method){
$otibi_form = "<form action=".$action." method=".$method.">";
return $otibi_form;
}
function openfieldset($name_fieldset){
$otibi_openfieldset = "<fieldset>
<legend>".$name_fieldset."</legend>";
return $otibi_openfieldset;
}
function faled($name_type,$name_faled){
$otibi_faled = "<input type=".$name_type." name=".$name_faled.">";
return $otibi_faled;
}
function checkbox($name_checkbox,$value_checkbox){
$otibi_chckbox = "<input type=\"checkbox\" name=".$name_checkbox."
value=".$value_checkbox.">";
return $otibi_chckbox;
}
function radio($name_radio,$value_radio,$check=''){//checked
$otibi_radio = "<input type=\"radio\" value=".$value_radio."
$check name=".$name_radio.">";
return $otibi_radio;
}
function textarea($name_textarea,$rows=6,$cols=20){
$otibi_textarae = "<textarea rows=".$rows." name=".$name_textarea."
cols=".$cols."></textarea>";
return $otibi_textarae;
}
function submit_form($name_submit,$type_submit,$value_submit){
$otibi_submit = "<input type=".$type_submit." name=".$name_submit."
value=".$value_submit.">";
return $otibi_submit;
}
function end_form(){
return "</form>";
}
function closefieldset(){
return "</fieldset>";
}
}
مثال بالصوره تطبيق :كود PHP:$otibi = new Form;
print $otibi->openfieldset("نموذج تسجيل");
print $otibi->start_form("class.php","POST");
print $otibi->faled("text","user")."<br />";
print $otibi->faled("password","pass")."<br />";
print $otibi->checkbox("php","php")."PHP<br />";
print $otibi->checkbox("asp","asp")."ASP<br />";
print $otibi->radio("***","male")."ذكر<br />";
print $otibi->radio("***","famle")."انثى<br />";
print $otibi->textarea("massge")."النص<br />";
print $otibi->submit_form("reset","reset","مسح");
print $otibi->submit_form("Go","submit","موافق");
print $otibi->end_form();
print $otibi->closefieldset();
![]()
اخواني اتمني ابداء الراي او الافكار او تعديل الي اخره![]()


وكتبت هذا الكود وهو بسيط بنسبه لكم بس احس اني عملت انجاز :eek2:
رد مع اقتباس
