FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Nested PHP
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Nested PHP [message #184868 is a reply to message #184866] Wed, 12 February 2014 10:33 Go to previous messageGo to previous message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma:
Senior Member
In article <1lgy8o1.4vb3i3fbpwjqN%adrian(at)poppyrecords(dot)invalid(dot)invalid>,
Adrian Tuddenham <adrian(at)poppyrecords(dot)invalid(dot)invalid> wrote:

> Jerry Stuckle <jstucklex(at)attglobal(dot)net> wrote:
>
>> On 2/11/2014 7:41 PM, Peter H. Coffin wrote:
>>> On Tue, 11 Feb 2014 09:27:54 -0500, Jerry Stuckle wrote:
>>>> On 2/11/2014 9:14 AM, Peter H. Coffin wrote:
>>>> > On Mon, 10 Feb 2014 16:51:37 -0500, Jerry Stuckle wrote:
>>>> >> On 2/10/2014 4:44 PM, Adrian Tuddenham wrote:
>>>> >>> I was using a browser to view it, but the source code was coming from
>>>> >>> a
>>>> >>> php program, not directly from a file on the server.
>>>> >>>
>>>> >>>
>>>> >>
>>>> >> Anything output by a PHP program is sent directly to the client. It is
>>>> >> not processed (again) by the web server, so the php code you generate
>>>> >> will never be processed.
>>>> >>
>>>> >> The browser will see exactly what you sent - nothing more, nothing
>>>> >> less.
>>>> >
>>>> > Right.
>>>> >
>>>> > Hmm... Might be worth trying writing to a temporary file, include()ing
>>>> > it, then cleaning up at the end of the script. It's a LITTLE
>>>> > complicated, but...
>>>> >
>>>>
>>>> And subject to all kinds of problems - such as concurrency with others
>>>> requesting the same page, getting rid of old copies, having to redirect
>>>> the browser to the temporary file, the user bookmarking the temporary
>>>> file... and probably several others.
>>>
>>> I think those are surmountable, with proper planning. Generating a
>>> guaranteed unique filename for the temporary file is essentially a
>>> solved problem, for example.
>>>
>>> The big question, though, is why can't this be solved WITHOUT the clunky
>>> mechanism. It almost smells richard-ish...
>>>
>>
>> That takes care of the concurrency problem - but that's all it takes
>> care of. When do you delete the file, for instance? Or what if the
>> user bookmarks the file?
>
> How do you delete the file? I have tried a few 'obvious' (obvious to
> me, that is) methods, but they don't seem to work. I initially tried
> going down the temporary file route, but my inability to find a way of
> deleting the files was one reason why I abandoned it.

unlink ('/path/to/file');

> I felt I needed to read through a selection of easy-to-follow examples
> of how real programmers solve real (straightforward) problems in the
> world of php - but as these don't seem to be available in any sort of
> collected form, I have turned to this group for guidance.

Yes, in 2000 I was given a 20 minutes tutorial about PHP and webpages
by the chap doing the company's assets database; he then (having
resigned a little before) walked out the door and was not seen again.
Luckily for me I had 35 years of programming experience. That was my
intro to PHP, javascript, and how web servers work.

The best resource is the PHP web site; it's one reason I don't use
perl. PHP folks seem to do things in a straightforward way and don't
try to be smart-alecs.

See here for the docs:

<http://www.php.net/manual/en/>

You can find a simple example of how ajax can be used (how I use it in
my email client, f'rinstance) here:

<http://www.clothears.org.uk>

Anyway, keep coming back here with questions.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Filling an array with random input doesn't quite work
Next Topic: string length
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 00:47:55 GMT 2024

Total time taken to generate the page: 0.04286 seconds