Created
June 3, 2013 23:41
-
-
Save meskarune/5702424 to your computer and use it in GitHub Desktop.
php file save script
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
<?php | |
$title = @$_POST['title']; | |
$date = @$_POST['date']; | |
$excerpt = @$_POST['excerpt']; | |
$tags = @$_POST['tags']; | |
$comment = @$_POST['comment']; | |
// Write the name of text file where data will be store | |
$filename = "mydata.txt"; | |
// Merge all the variables with text in a single variable. | |
$f_data= ' | |
title: '.$title.' | |
date: '.$date.' | |
excerpt: '.$excerpt.' | |
tags: '.$tags.' | |
body: '.$comment.' | |
============================================================================== | |
'; | |
echo 'Form data has been saved to '.$filename.' <br> | |
<a href="'.$filename.'">Click here to read </a> '; | |
$file = fopen($filename, "w"); | |
fwrite($file,$f_data); | |
fclose($file); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment