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&...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
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/ |
|
|||
|
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? |
|
|||
|
> 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. |
|
|||
|
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 --------------------------------- |
|
|||
|
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 |
|
|||
|
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 --------------------------------- |