Advertisement

06.24.2008 at 12:56PM PDT, ID: 23512391
[x]
Attachment Details

php file write

Asked by tlavalle in PHP Scripting Language, PHP for Windows

Tags: PHP

ok, I have figured out how to use a class in php and to open a file.  The next item i would like to learn if possible is how to write to this file.

here is what i have so far.
index.php:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form action="processForm.php" method="post">
            <input name="exampleText" type="text" />
            <input type="submit" value="submit" />
</form>
</body>
</html>
what should i add so that i can write to the file

my file options class
<?php
      class fileOptions{
            function fileFind($fileName)
            {
                        if(!($myfile = fopen($fileName, "r+[b]")))
                        {
                                    print ("File could not be opened");
                                    exit;
                        }
                        while(!feof($myfile))
                        {
                                    $myline = fgetss($myfile, 255);
                                    print("$myline <br>\n");
                        }
                       
                        fclose($myfile);
            }
            function fileWrite($fileName)
            {
              what should i put here  i know i need fwrite($myfile), but not sure where to go.              
            }
      }
?>Start Free Trial
[+][-]06.24.2008 at 01:31PM PDT, ID: 21860111

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.24.2008 at 02:19PM PDT, ID: 21860512

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.24.2008 at 02:26PM PDT, ID: 21860562

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.24.2008 at 08:50PM PDT, ID: 21862564

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP Scripting Language, PHP for Windows
Tags: PHP
Sign Up Now!
Solution Provided By: Bivek-jos
Participating Experts: 3
Solution Grade: A
 
 
[+][-]06.24.2008 at 11:29PM PDT, ID: 21863032

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.25.2008 at 02:33AM PDT, ID: 21863894

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628