Cheap Web Hosting for Developers

PHP, MySQL, Java, Unix Cheap Web Hosting

CVS: Concurrent Versions System 189 Listing 5.3 Prompt

Filed under: Web Applications Development With PHP4.0 — webmaster @ 02:25

CVS: Concurrent Versions System 189 Listing 5.3 Prompt for user input using PHP input/output streams. function readln() { // Initialize return value $ret = ; // Read from stdin until the user presses enter $fp = fopen( php://stdin , r ) or die( Fatal Error: could not read from .stdin ); do { $char = fread($fp, 1); $ret .= $char; } while($char != n ); return($ret); } print( Please enter your firstname:n ); $firstname = readln(); print( You entered: $firstnamen ); The other available streams are php://stdout and php://sterr.This provides an effective and platform-independent way of accessing standard input, standard output, and the standard error-handling device. Indeed, this works even on Windows 98/NT. The concept of PHP streams was introduced with PHP 4.0 and is not available in the 3.x tree. On UNIX systems, you can work around this limitation by directly accessing the UNIX devices /dev/stdin, /dev/stdout, or /dev/stderr. Of course, this works only on systems with valid devices. Most current UNIX systems have it Windows is left out again. If you use CVS to manage all your files on a Web site project not only source code but also images, archives, Flash, etc. you ll soon notice that there are some limits with binary files.Text diffs don t make sense on binary data it s usually not of much interest to you which bits in an image file have changed. CVS can indeed create problems when treating all files as ASCII. CVS treats certain character sequences as keywords; for example $Id: Basic_Web_Application_Strategies.xml,v 1.5 1999/12/15 15:49:55 tobias Exp $ and substitutes them on commit with the expanded counterpart, which may create a mess with binary data.

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP MySQL Web Hosting services

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Cheap Web Hosting