[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 211
  • Last Modified:

PHP Program

Dear Expert,

My Boss want to create a web-page (PHP) like follow:
1. The Web-Page's out-look design very simple
- Need one Textbox to key-in the data.
- Common button like "Submit"
<<Common Button function>>
- Ex: when user key-in "1000", after click the submit button it will automatically create a text file.
The file name like as follow. "20071002.txt" <-- which depend on the computer date.
Then it will automatically send this file to a FTPS server.

Please help....
1 Solution

You can do it by yourself. The following tutorial with examples has the answer.


Look into these section:
- PHP forms for the form input.
- PHP date for the date function.
- PHP file for the file opening and writing.

The textbox is called textarea in HTML. To create one, use the following syntax:

<textarea name="area1" rows="5" cols="40"></textarea>

You can adjust the number of rows and columns by changing the figures above.
RickyXCAuthor Commented:
Dear Expert,

Actually i am not a web-programmer....so i dont have any ideas on it...
Anyone can help me ... Sorry and Thanks 1st...

Below code create the file name as current date on system and write the value given in the text box.

      if(isset($_POST['submit'])) {
            $date = date("m/d/Y");
            $date_array = explode("/", $date);
            $writedata = $_POST['key-in'];
            $ourFileName = "$date_array[2]$date_array[0]$date_array[1].txt";
            $ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");
            fwrite($ourFileHandle, $writedata);
<form name="fileform" action="text.php" method="post">
            <td><input type="text" name="key-in" value=""></td>
            <td><input type="submit" name="submit" value="Submit"></td>

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now