Showing posts with label input. Show all posts
Showing posts with label input. Show all posts

Friday, 19 February 2016

How Does an FTP Work?In Feburary 2016 19,

In Feburary 2016 19,
File Transfer Protocol (FTP) is the protocol used to transfer files between devices on the Internet. Particularly useful for larger files, FTP is a more robust and more capable protocol than the Hypertext Transfer Protocol (HTTP) used to deliver web pages and smaller files from a server to a client by way of a web browser. Since no special browser is required, FTP is also more universal. All major operating systems, including Mac OS, Windows and Linux allow FTP file transfers directly from the command line. Graphical FTP programs do exist though, and help organize and facilitate bulk file transfers that would otherwise require considerable manual input. By using FTP to transfer files between clients and servers, or between network servers, FTP helps webmasters publish the files that drive the Internet.
FTP Transfers Work in Sessions
In order to transfer a file from a client to a server, or to download a file from a server to a computer, a user must authenticate, or identify himself, when logging on to an FTP server. By authenticating, the user creates a session on the server during which he can transfer or modify as many files as necessary. The authentication process also allows remote hosts to set proper file permissions, keeping users from viewing files or directories to which they do not have access, and allowing an individual user to set read, write, and execute permissions on his own files or subdirectories. When the user session is complete, the user simply disconnects from the server and the session is closed. Some FTP servers also allow 'anonymous' connections, where members of the public can connect anonymously to the FTP server and initiate file transfers; these settings are generally used when publicly available information--like program files released for free--needs to be available for download by knowledgeable users.
FTP Uses Multiple Ports
The File Transfer Protocol is unique among protocols used on the Internet in that it actually works across two ports: one port for issuing commands and conveying other administrative information between the client and server, and a separate port for actually transferring files. Users can also transfer files in either an 'active' or a 'passive' mode, allowing flexibility for file transfers from behind a network firewall or other situation that may present difficulty in transferring files.
In Feburary 2016 19,

How to Insert a Time Stamp in PHP MySQLIn Feburary 2016 19,

In Feburary 2016 19,
Create a new field in your database. Open the 'phpMyAdmin' utility for your MySQL databases. Select the database of your choice from the left-hand menu. Select the table in which you wish to place the new time stamp field and click on the 'Structure' action item. Hit the 'Go' button next to the 'Add One New Field' selection.
Set the attributes of the new field. Under the 'Field' input box enter your new field's name. Name the field 'Timestamp.' Select the 'Type' drop-down bar and tag the 'Timestamp' options. This defines your new field as a 'Time Stamp.' Click on the 'Default' drop-down bar. If desired, select the 'Current_Timestamp' option. If selected, this option automatically creates a new time stamp whenever a new record is entered into your database. Now, click the 'Attributes' drop-down box. Select the 'On Update Current_Timestamp' menu item. If this option is selected, the time stamp field will update every time a change is made to your database record.
Save the changes. Select the 'Save' option at the bottom right-hand corner of the window. The changes to your database structure are now saved. From this point on, the time stamp field automatically populates each time a new record is entered.
Using PHP
Capture the current time using the PHP date function and assign it to a PHP variable. The PHP date function takes the current time and formats it according to a set of values that you enter. Consider this example:$current_time = date ('Y-m-d H:i:s');In this line of code, it calls the date function and enters the values which format the output into the format of year, month, day, hour, minute and second or '2012-12-21 06:26:36.' This is the exact time stamp format used by MySQL. In this example, the date is assigned to the current-time variable.
Insert the time stamp into the MySQL time stamp field of the database table of your choice. Use 'PHP's mysql_query' function to complete this step. Here is the example.$query = 'UPDATE
yourDatabaseTable
SET
timestamp
= '$current_time' WHERE
yourPrimaryKey
='$primary_key_variable' ';mysql_query($query) or die('The new time was not inserted');
Upload the PHP file to your server.
In Feburary 2016 19,