Last active
December 11, 2015 23:08
-
-
Save tim-peterson/4674287 to your computer and use it in GitHub Desktop.
Dwolla json_decode $_POST
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$file = 'application/views/dwolla/post.php'; | |
// Open the file to get existing content | |
$current = file_get_contents($file); | |
$date=date("Y-m-d H:i:s"); | |
$post=json_decode(file_get_contents('php://input'), TRUE); | |
if($post){ | |
// Append a new person to the file | |
foreach($post as $key=>$value) { | |
$current .= "$key: $value\n"; | |
} | |
} | |
else{ | |
$current .= 'post_$_GET'; | |
$data['title']='post'; | |
$this->view('dwolla/post', $data, 'post', false); | |
} | |
$current .= $date."\n"; | |
$current .= "\n"; | |
// Write the contents back to the file | |
file_put_contents($file, $current); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment