Form Posting from PHP
| From: | Scotland 2000 | Date: | Sun, 20 Aug 2000 19:01:50 +0000 |
| Subject: | Form Posting from PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-12658@lists.php.net to get a copy of this message | ||
My PHP essentially guestbook style program posts users input to
filename.php3 within a directory. This is turn writes a text file which is
picked up within an index.php3 and displayed along with other posts.
[EXAMPLE 1 below]
I need the posts to also be displayed by another index.php3 file on a
different domain without the need for separate posting.
Q? Is it possible to post to 2 different filename.php3 files by the one
action OR can I 'receive' the generated text files by using absolute URL in
a second index.php3 file. Relative URLs work (../2ndindex.php3) but
absolute URLs (http://www.mydomain.com/php-site/textfile.txt)[EXAMPLE 2 below]
[EXAMPLE 1]
<FORM ACTION="../filename.php3" METHOD=POST>
<INPUT TYPE=text NAME=etc SIZE=20 MAXLENGTH=50>
<INPUT TYPE=submit NAME=etc VALUE="Add")>
</form>
[EXAMPLE 2]
The first part fails to work but the second part further down is OK
<?php
if
(file_exists("http://www.mydomain.com/php-site/textfile.txt")):
include("htt
p://www.mydomain.com/php-site/textfile.txt");
endif;
?>
<?php
if (file_exists("file.txt")):
include("file.txt");
endif;
?>
thanks in advance, Robert