p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_php thread: Writing to more than one textfile?


Message #1 by "Sandra Murphy" <sandradmurphy@y...> on Sat, 12 Oct 2002 16:49:37
I have a site that I can update by entering simple data from a form on 
the web which I designed that writes to a textfile.  At the moment I 
write to one textfile at a time and click on submit and it works OK. When 
I finish I use the back button to go back to the form and submit again to 
update another file.  Does anyone know if it is possible to update more 
than one text file at a time.  I have tried all possible ways and cannot 
figure it out.
Thanks,

Sandra
Message #2 by "Luis Morales" <luismorales@j...> on Sat, 12 Oct 2002 19:13:38 -0400
Hia Sandra,

You can try catching form elements,eg:

----- begin sample.php -----
<?

if  ($_POST[submit]){
  $myName = $_POST[myName];
}

?>
<html>
<head>
</head>
<body>

<form method="post" name="formText" action="<? echo $_SERVER['PHP_SELF'] ?>"
ENCTYPE="multipart/form-data">
<blockquote>
  Give me Your name:   <input type="text" name="myName" value="<? echo
$myName ?>" size="30" maxlength="100">
  <input type="submit" name="submit" label="submit">
</form>

</body>

</html>
----- end sample.php -----

Good Luck!

LM

PD: You can use $_POST[myName] better than $myName variable. ;-)

----- Original Message -----
From: "Sandra Murphy" <sandradmurphy@y...>
To: "beginning php" <beginning_php@p...>
Sent: Saturday, October 12, 2002 4:49 PM
Subject: [beginning_php] Writing to more than one textfile?


> I have a site that I can update by entering simple data from a form on
> the web which I designed that writes to a textfile.  At the moment I
> write to one textfile at a time and click on submit and it works OK. When
> I finish I use the back button to go back to the form and submit again to
> update another file.  Does anyone know if it is possible to update more
> than one text file at a time.  I have tried all possible ways and cannot
> figure it out.
> Thanks,
>
> Sandra
>


  Return to Index