PHP Program

Posted on 2007-10-02
Last Modified: 2013-12-13
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....
Question by:RickyXC
    LVL 14

    Expert Comment


    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.

    Author Comment

    Dear Expert,

    Actually i am not a i dont have any ideas on it...
    Anyone can help me ... Sorry and Thanks 1st...
    LVL 5

    Accepted Solution


    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

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
    Part of the Global Positioning System A geocode ( is the major subset of a GPS coordinate (, the other parts being the altitude and t…
    Viewers will get an overview of the benefits and risks of using Bitcoin to accept payments. What Bitcoin is: Legality: Risks: Benefits: Which businesses are best suited?: Other things you should know: How to get started:
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now