php
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| php [2010/10/08 17:51] – created tkbletsc | php [2010/10/08 18:58] (current) – tkbletsc | ||
|---|---|---|---|
| Line 6: | Line 6: | ||
| function current_url() { | function current_url() { | ||
| $pageURL = ' | $pageURL = ' | ||
| - | if ($_SERVER[" | + | if (@$_SERVER[" |
| $pageURL .= "://"; | $pageURL .= "://"; | ||
| if ($_SERVER[" | if ($_SERVER[" | ||
| Line 19: | Line 19: | ||
| function script_url() { | function script_url() { | ||
| $pageURL = ' | $pageURL = ' | ||
| - | if ($_SERVER[" | + | if (@$_SERVER[" |
| $pageURL .= "://"; | $pageURL .= "://"; | ||
| if ($_SERVER[" | if ($_SERVER[" | ||
| Line 44: | Line 44: | ||
| function script_url() { | function script_url() { | ||
| $pageURL = ' | $pageURL = ' | ||
| - | if ($_SERVER[" | + | if (@$_SERVER[" |
| $pageURL .= "://"; | $pageURL .= "://"; | ||
| if ($_SERVER[" | if ($_SERVER[" | ||
| Line 57: | Line 57: | ||
| if (strpos($uri,' | if (strpos($uri,' | ||
| // We are storing a value in this post | // We are storing a value in this post | ||
| - | $tag =trim($_POST[" | + | $tag |
| - | $value =trim($_POST[" | + | $value = json_decode($_POST[" |
| + | |||
| + | # $value may be a string or array depending on what you sent in your app | ||
| // TODO: Do something with those values | // TODO: Do something with those values | ||
| - | echo '[" | + | echo json_encode(array(" |
| } elseif (strpos($uri,' | } elseif (strpos($uri,' | ||
| // We are retrieving a value in this post | // We are retrieving a value in this post | ||
| - | $tag = trim($_POST[" | + | $tag = $_POST[" |
| // TODO; figure out value | // TODO; figure out value | ||
| - | $value = " | + | $value = " |
| - | $value | + | |
| echo json_encode(array(" | echo json_encode(array(" | ||
php.1286585509.txt.gz · Last modified: by tkbletsc
