Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[dc207e]: web / htdocs / app / examples_add.html.php Maximize Restore History

Download this file

examples_add.html.php    65 lines (58 with data), 2.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<h3>Add example</h3>
<?php
if ($_POST) {
$channel=isset($_POST['channel'])?htmlspecialchars($_POST['channel']):'';
$url=isset($_POST['url'])?htmlspecialchars($_POST['url']):'';
$network=isset($_POST['network'])?htmlspecialchars($_POST['network']):'';
$maintainer=isset($_POST['maintainer'])?htmlspecialchars($_POST['maintainer']):'';
$email=isset($_POST['email'])?$db->quote($_POST['email']):'';
$sql=sprintf("INSERT INTO examples (channel, url, network, maintainer) VALUES (%s, %s, %s, %s)",$db->quote($channel),$db->quote($url),$db->quote($network),$db->quote($maintainer));
$db->exec($sql);
include'sendmail.php';
$mail=new Sendmail();
$to='pisg-commits@lists.sourceforge.net';
$subject='Example addition';
$message="Example to be added:\n
Channel: $channel\n
URL: $url\n
Network: $network\n
Maintainer: $maintainer";
$mail->send($to, $subject, $message, $email);
?>
<p>Thank you for the submission. The URL and the data you submitted will be
reviewed within the next couple of days, and then your page will appear on
the 'examples' page.</p>
<?php } else { ?>
<p>Here you can add a statistics page. The page will only be added to the
examples if you enter sane input.</p>
<form method="POST" action="">
<table width="100%" cellpadding="2" cellspacing="0" border="0">
<tr>
<td>Channel name:</td>
<td><input type="text" name="channel" maxlength="50" /></td>
<td>Eg. '#channel_name'</td>
</tr>
<tr>
<td>IRC network:</td>
<td><input type="text" name="network" maxlength="50" /></td>
<td>Eg. 'Undernet'</td>
</tr>
<tr>
<td>URL:</td>
<td><input type="text" name="url" maxlength="255" value="http://" /></td>
<td>Eg. 'http://www.example.org/stats/'</td>
</tr>
<tr>
<td>Maintainer:</td>
<td><input type="text" name="maintainer" maxlength="50" /></td>
<td>Eg. 'John'</td>
</tr>
<tr>
<td>Email address:</td>
<td><input type="text" name="email" maxlength="255" /></td>
<td>Eg. 'john@example.org'</td>
</tr>
</table>
<input type="submit" />
</form>
<?php } //end if ?>