Re: Newbie Questions
| From: | David Robley | Date: | Fri, 16 Jun 2000 02:09:26 +0000 |
| Subject: | Re: Newbie Questions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-2040@lists.php.net to get a copy of this message | ||
On 15 Jun, Martin Fernandez wrote:
> Hello,
>
> I'm brand new to PHP and this list, so please forgive me if my questions
> have been covered.
>
> 1. How do I write to a specific location in a file? All the fopen()
> modes that I'm aware of either write at the beginning or end of the file
> (or simply write over the file) I want to put data in the middle of my
> file.
That is a limitation of the operating system generally. What you need to
do is read the file in a line at a time into a variable or array, stop
when you get to where you want to add your bit and tack it on, then
continue loading the rest of the file. When done, write the file out
again.
> 2. Can I pass a PHP variable on an anchor tag to another php document?
Yes. <A HREF="script.php?var=value"> and in script.php the variable $var
will have the value "value"
> Thanks.
>
> Martin
>
Cheers
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA