My favorites | Sign in
Logo
             
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php

/*
The MIT License

Copyright (c) 2008 Silas Sewell

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/

if (isset($_GET['__action']))
{
// Open the form
$form = sprintf('<form action="%s" method="post" name="form">',
$_GET['__action']
);

// Add non-special parameters to the form
foreach ($_GET as $name => $value)
{
if (substr($name, 0, 2) != '__')
$form .= sprintf('<input type="hidden" name="%s" value="%s" />',
$name,
$value
);
}

// Close the form
$form .= '</form>';
$form .= PHP_EOL;
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />
<title>Post a Get</title>
<style type="text/css">
html, body { margin: 0; padding: 1em; text-align: center; }
form { display: none; }
#c { padding-top: 0.5em; font-size: small; }
</style>
</head>
<body>
<h1>Post a Get</h1>
<?php if (isset($form)) : ?>
<h2>The form is being submitted...</h2>
<p>If you continue to see this message you most likely have Javascript
disabled, you will need to enable it before <strong>Post a Get</strong>
will work.</p>
<?php echo $form; ?>
<script type="text/javascript">
if (document.location.href.indexOf('#') == -1) {
document.location.href += '#';
document.form.submit();
} else {
history.go(-1);
}
</script>
<?php else : ?>
<p>Visit the <a href="http://code.google.com/p/postaget">project website</a>
to get a copy of the code or learn
<a href="http://code.google.com/p/postaget/wiki/HowToUse">how to use</a>
Post a Get.</p>
<?php endif; ?>
<p id="c">&copy;2008 <a href="http://www.silassewell.com/">Silas Sewell</a></p>
</body>
</html>
Show details Hide details

Change log

r246 by si...@sewell.ch on Apr 12, 2009   Diff
Switched back to MIT.
Go to: 
Project members, sign in to write a code review

Older revisions

r123 by silassewell on Oct 18, 2008   Diff
Added Post a Get code.
All revisions of this file

File info

Size: 3050 bytes, 87 lines
Hosted by Google Code