الفصل الثاني
238
البرنامج النصي track_prefs1.php
4.
5.
6.
session_register("last");
session_register("email");
session_register("news_prefs");
7.
?>
8.
<html>
9.
<head>
10.
11.
12.
13.
14.
<title>Welcome</title>
<style type="text/css">
p, ul, h3 {font-family: verdana, helvetica, sans-serif;} .enabled {font-weight: bold; color: green; }
.disabled (font-weight: bold; color: red;}
15.
</style>
16.
</head>
17.
<body>
18.
<?
19.
20.
21.
22.
23.
24.
25.
26.
27.
function load_user_data() {
global $first, $last, $email, $news_prefs;
$first "Faye";
$last = "Valentine";
$email = "[email protected]";
$news_prefs = array(
"Local" => 0,
"Nation" => 1,
"World" => 1,
28.
"Comics" => 0,
29.
);
30.
}
31.
load_user_data();
32.
?>
33.
34.
<h3>Welcome</h3>
<p>Welcome back <b><?=$first?></b>
35,
<p>Your settings have been loaded.
36.
<p><a href=track_prefs2.php>View Your Settings</a>.
37.
</body>
38. </html>
ص٢٨