Skip to main content

Posts

File uploading in to the public IP address web server

File uploading in to the public IP address web server There are two ways to upload the files from local system to public IP address. One is by using control panel and another one is FTP. Control panel This is an inter face between our system and public IP address.   Web server used to manage the contents of server. We can upload the files, we can create the tables, we can create the mail account etc. FTP For using this transfer protocol we can upload the multiple files at a time and also we can get the states about the uploaded files. In C panel file manager is an option used to upload the files from client system to web server.   We have to place the files in root directory in web server root directory. If any file with name index or default or home comes under start up file.

feof in php example

this function returns the Boolean values if the file pointer is located at the beginning of the file. <?php $fp = fopen("myfile.txt","r"); $count=0; while(!feof($fp)) { echo fgets($fp); $count++; } echo "<br>" total lines are $count"; ?>

fseek function in php example

fseek function in php: by using this function we can locate the file pointer on the specified location. <?php $fp= fopen("myfile.text",' w+'); fwrite ($fp, "hello scott"); fseek($fp,2); $size= file size("myfile.text"); echo fread($fp,$size); ?>