<title>File handling</title>
<body bgcolor=#CCFFFF>
<h1>Managing a file</h1>
<tr><td>Please enter the filename <td><input name = yourfile    value="<?= $yourfile ?>">
<tr><td>Please enter the code     <td><input name = yourcode  value="<?= $yourcode ?>">
<tr><td><input type=submit>
    $yourcode = stripslashes($_REQUEST[yourcode]);
    $yourfile = stripslashes($_REQUEST[yourfile]);
    $myString = "";
    $file = fopen($yourfile,"r") or die ("No such file $yourfile.\n");
   $line = fgets($file,256);
       $myString .= "<br> $line";
    print "<p>Your file is : $yourfile";
    print "<p>Your searchcode is : $yourcode";
    print "<p>And here are the $linecount matches:<p>";
    print $myString;


-- PeterJones - 08 Nov 2006

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2006-11-08 - PeterJones
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback