متنوعات
الفصل السادس
} else {
print " Did not sign";
echo '<p> <a herf ="new30.php" Click to Sign </a> </p>';
}
?>
http://localhost/test/p7/new31 php
File Edit View Favorites Tools Help
Back
Stop Refresh
Home
Gol Links "
| Addresse alhost/test/p?/new31.php
Welcome: Ahmed
1 Done
Local intranet
ويمكن طبعا وضع ملف متكامل للعمل
الفئات والكائنات Classes and Objects
الفئة class عبارة عن تجميع من المتغيرات والدوال التي تعمل مع هذه المتغيرات ،
class ClassName {
variables
function {
Objects
}
}
وتعرف الفئة باستخدام الصيغة التالية :
<?php
class Cart {
var $items; // Items in our shopping cart
// Add $num articles of $artnr to the cart
۲۱۹
مثال لفئة عربة تسوق cart :
ص ٢١٩