Page 1 of 1

one submission page, post the content to two site ?

Posted: Wed Sep 16, 2009 7:25 am
by phpp
one submission page, submit the content to two site at the same time. can you make it help me?How?
-----------------------------------------------------------------
submit page (test.php)

Code: Select all

<table><form name="form" method="post" [color=#40BFFF][b]action=""[/b][/color] >?
<tr><td>name1: <input type="text" name="name1" ></td></tr>
<tr><td>name2: <input type="text" name="name2"></td><td><input type="submit" 
 
name="submit" value="ok"></td></tr></form></table>
// action="http://localhost/one/test1.php" and action="http://localhost/two/test2.php"
------------------------------------------------------------------
accept page1 (test address: http://localhost/one/test1.php)

Code: Select all

<?php
$fp = fopen("test1.txt","a");
$name1=$_POST[name1];
$name2=$_POST[name2];
$str = "name1: ".$name1." name2: ".$name2."\r\n";
fwrite($fp,$str); 
fclose($fp);
?>
-------------------
accept page2 (test address: http://localhost/two/test2.php)

Code: Select all

<?php
$fp = fopen("test2.txt","a");
$name1=$_POST[name1];
$name2=$_POST[name2];
$str = "name1: ".$name1." name2: ".$name2."\r\n";
fwrite($fp,$str); 
fclose($fp);
?>
-----------------------------------------------------------------

Re: one submission page, post the content to two site ?

Posted: Wed Sep 16, 2009 7:42 am
by superdezign
Don't type in pink, please.

I think cURL has mechanisms for posting data to another page. However, if you are planning on going from one page to another, I don't believe that creating another POST request is possible without another form. You would have to use the query string to pass the variables with the GET method, or you would need to save the posted values into a form and have the user submit that form to the next page.

Re: one submission page, post the content to two site ?

Posted: Wed Sep 16, 2009 7:51 am
by phpp
superdezign wrote:Don't type in pink, please.

I think cURL has mechanisms for posting data to another page. However, if you are planning on going from one page to another, I don't believe that creating another POST request is possible without another form. You would have to use the query string to pass the variables with the GET method, or you would need to save the posted values into a form and have the user submit that form to the next page.
but because file type file size is very big! then why?

Code: Select all

<form name="form" method="post" action="" enctype="multipart/form-data">
<input type="hidden" name="file" value="0" >
<input id='file' type="file" name="file"  ><input type="submit" name="submit" value="ok" ></form>

Re: one submission page, post the content to two site ?

Posted: Wed Sep 16, 2009 8:09 am
by superdezign
You are attempting to pass a file from one form to another?

And I'm positive that advertising is not allowed in your signature.

Re: one submission page, post the content to two site ?

Posted: Wed Sep 16, 2009 8:32 am
by phpp
superdezign wrote:You are attempting to pass a file from one form to another?

And I'm positive that advertising is not allowed in your signature.

Re: one submission page, post the content to two site ?

Posted: Wed Sep 16, 2009 11:42 am
by superdezign
phpp wrote:
superdezign wrote:You are attempting to pass a file from one form to another?

And I'm positive that advertising is not allowed in your signature.
I see you removed the ads in your signature. However, just quoting me doesn't really give us much insight into your problem. :?:

Re: one submission page, post the content to two site ?

Posted: Wed Sep 16, 2009 11:45 am
by Mirge
Using cURL you can send data wherever you want via GET _or_ POST... see the manual:

http://us.php.net/curl/