Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title>PHP Get Results</title>
- </head>
- <body>
- <?php
- // Show all URL parameters (and
- // all form data submitted via the
- // 'get' method)
- $file = "test.txt";
- $fh = fopen($file, 'a') or die("Can't open file");
- fwrite($fh, "Timestamp: " . time() . "\n");
- foreach($_GET as $key=>$value) {
- // echo $key, ' => ', $value, "<br/>\n";
- fwrite($fh, $key . ' => ' . $value . "\n");
- }
- fclose($fh);
- $fh = fopen($file, 'r');
- $data = array();
- while (!feof($fh)) {
- // echo fgets($fh), "<br />";
- array_push($data, fgets($fh));
- }
- fclose($fh);
- for ($i=count($data) - 1; $i > 0 ; $i--) {
- echo $data[$i], "<br />";
- }
- /*
- // Show a particular value.
- $id = $_GET['temp'];
- if($id) {
- echo '<p/>ID: ', $id, "<br/>\n";
- }
- else {
- echo '<p>No ID parameter.</p>';
- }
- */
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement