/[webwml]/newmaint/gpgplace.wml
ViewVC logotype

Contents of /newmaint/gpgplace.wml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Sun Jul 15 12:49:12 2001 UTC (11 years, 10 months ago) by tbm
Branch: MAIN
Changes since 1.2: +2 -2 lines
I hate PHP
1 tbm 1.1 <?
2     session_start();
3     include("gpgconfig.inc");
4     include("common.inc");
5     include("gpgcommon.inc");
6    
7     ?>
8     #use wml::gpgpage title="GPG Signing Coordination - Your profile"
9     <?
10     if (!session_is_registered("s_username")) {
11     ?>
12     <STRONG>
13     You should not be here!</STRONG>
14     <? } else {
15     session_register("s_username");
16     }
17     ?>
18    
19     <?
20     if (! ($db = open_db())) {
21     echo "<P>Cannot open database.</P>";
22     return FALSE;
23     }
24    
25     $sql = "SELECT id FROM people WHERE email = '$s_username'";
26     if (! ($result = pg_exec($db, $sql))) {
27     echo "Problem with query", pg_ErrorMessage($db), "<BR>";
28     return FALSE;
29     }
30     if (pg_NumRows($result) != 1) {
31     echo "That e-mail address is wicked.";
32     return FALSE;
33     }
34     $row = pg_Fetch_Array($result, 0);
35     $who = $row["id"];
36    
37    
38     # begin, finish
39    
40     # city, country
41    
42    
43     # modify an entry (if $id exists), or add a new one)
44     if ($id) {
45     $sql = "SELECT begin, finish, city, country FROM places WHERE id = '$id'";
46     if (! ($result = pg_exec($db, $sql))) {
47     echo "Problem with query", pg_ErrorMessage($db), "<BR>";
48     return FALSE;
49     }
50    
51     if (pg_NumRows($result) != 1) {
52     echo "Not enough or too many results. That should not happen.";
53     return FALSE;
54     }
55    
56     $row = pg_Fetch_Array($result, 0);
57     $begin = $row["begin"];
58     $finish = $row["finish"];
59     $city = $row["city"];
60     $country = $row["country"];
61     } else {
62 tbm 1.2 $begin = $finish = "";
63     $city = $country = "";
64 tbm 1.1 }
65 tbm 1.2
66 tbm 1.1 ?>
67 tbm 1.2
68     <div align="center">
69     <TABLE summary="">
70     <FORM method="post" action="gpgregister.php">
71 tbm 1.3 <TR><TD><B>City</B></TD><TD><INPUT name = "city" type = "text" value="<? echo $city ?>"></TD></TR>
72     <TR><TD><B>Country</B></TD><TD><INPUT name = "country" type = "text" value="<? echo $country ?>"></TD></TR>
73 tbm 1.2 </FORM>
74     </TD>
75     </TR>
76     </TABLE>
77 tbm 1.1

  ViewVC Help
Powered by ViewVC 1.1.5