Automatically open HTML file?

This is a discussion on Automatically open HTML file? within the PHP Language forums, part of the PHP Programming Forums category; Hello, do you know wheter PHP program palced in HTML file can automatically open another HTML file? By "automatically&...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-28-2004
Q
 
Posts: n/a
Default Automatically open HTML file?

Hello,

do you know wheter PHP program palced in HTML file can automatically
open another HTML file? By "automatically" I understand "without any
action of user" (like pressing a button).

Thank you!
Reply With Quote
  #2 (permalink)  
Old 11-28-2004
Alan Little
 
Posts: n/a
Default Re: Automatically open HTML file?

Carved in mystic runes upon the very living rock, the last words of Q of
comp.lang.php make plain:

> do you know wheter PHP program palced in HTML file can automatically
> open another HTML file? By "automatically" I understand "without any
> action of user" (like pressing a button).


You can re-direct with the header() function; you can read an HTML file and
display it; can you be more specific about what you're trying to do?

--
Alan Little
Phorm PHP Form Processor
http://www.phorm.com/
Reply With Quote
  #3 (permalink)  
Old 11-28-2004
Razzbar
 
Posts: n/a
Default Re: Automatically open HTML file?

opt_inf_env@yahoo.com (Q) wrote in message news:<5f275cd6.0411280323.7ab669fc@posting.google. com>...
> Hello,
>
> do you know wheter PHP program palced in HTML file can automatically
> open another HTML file? By "automatically" I understand "without any
> action of user" (like pressing a button).


Of course! PHP can open, read and write files on the server.

Am I missing something? What exactly do you want to do?
Reply With Quote
  #4 (permalink)  
Old 11-30-2004
Q
 
Posts: n/a
Default Re: Automatically open HTML file?

> Am I missing something? What exactly do you want to do?
I have an HTML file, with a text field which can be filled by user.
After pressing of button "Send" this HTML file (with ambedded PHP)
generates a new HTML file consisting text printed in the text-field of
the first (initial) file. The next step which has to be performed is
opening of the new generated HTML file. Of course it can be done by
pressing link placed in the first file. But I would like first file
opens automatically the second one after it has been generated.
Reply With Quote
  #5 (permalink)  
Old 12-01-2004
Ginzo
 
Posts: n/a
Default Re: Automatically open HTML file?

header("Location: [generatedfile]\r\n");

2 caveats.

1) the \r\n are not optional
2) you have to do this before sending anything to the browser; and if
you're doing it right, there won't be anything to send other than the
header anyway.

On 30 Nov 2004 12:06:58 -0800, opt_inf_env@yahoo.com (Q) wrote:

>> Am I missing something? What exactly do you want to do?

>I have an HTML file, with a text field which can be filled by user.
>After pressing of button "Send" this HTML file (with ambedded PHP)
>generates a new HTML file consisting text printed in the text-field of
>the first (initial) file. The next step which has to be performed is
>opening of the new generated HTML file. Of course it can be done by
>pressing link placed in the first file. But I would like first file
>opens automatically the second one after it has been generated.



Ciao,


Ginzo
---------------------------------
War is god's way of teaching
Americans geography
-- Ambrose Bierce
---------------------------------
Reply With Quote
  #6 (permalink)  
Old 12-01-2004
John Dunlop
 
Posts: n/a
Default Re: Automatically open HTML file?

Ginzo wrote upside-down:

> header("Location: [generatedfile]


OK, so long as generatedfile is an absolute URI (or absolute
URI reference).

> \r\n");
>
> 2 caveats.
>
> 1) the \r\n are not optional


No, that's not right. A CRLF is indeed the end-of-line
marker for header fields in HTTP; but you need not be
concerned with such details using the header function.

http://www.php.net/manual/en/function.header.php

> 2) you have to do this before sending anything to the browser; and if
> you're doing it right, there won't be anything to send other than the
> header anyway.


Fair enough.

--
Jock
Reply With Quote
  #7 (permalink)  
Old 12-10-2004
Ginzo
 
Posts: n/a
Default Re: Automatically open HTML file?

On Wed, 1 Dec 2004 19:08:17 -0000, John Dunlop
<usenet+2004@john.dunlop.name> wrote:

>Ginzo wrote upside-down:
>
>> header("Location: [generatedfile]

>
>OK, so long as generatedfile is an absolute URI (or absolute
>URI reference).


A nice distinction; but presumably it is, what elese would be the
point of the exercise?

>> \r\n");
>>
>> 2 caveats.
>>
>> 1) the \r\n are not optional

>
>No, that's not right. A CRLF is indeed the end-of-line
>marker for header fields in HTTP; but you need not be
>concerned with such details using the header function.


OK, I reconsider my language - it may work without the CRLF; but it
may not. Adding the CRLF is more reliable in my experience

>http://www.php.net/manual/en/function.header.php
>
>> 2) you have to do this before sending anything to the browser; and if
>> you're doing it right, there won't be anything to send other than the
>> header anyway.

>
>Fair enough.



Ciao,


Ginzo
---------------------------------
War is god's way of teaching
Americans geography
-- Ambrose Bierce
---------------------------------
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 08:03 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0