POSTing without a form
Moderator: General Moderators
POSTing without a form
Is there a simple way to send POST data to another script without the use of a visible form, and automatically - ie. open one page (maybe directly in PHP) and have some data sent to another script
not quite sure what you are asking, but maybe this is close to it.
if you have a variable on a page that you would like to use on another, the best way is to call the include() function.
Example :
you have a php page called bob.php
in it is the following :
and you have another php page called george.php that you want to call bob.php's variable $this.
So, you would do it like so :
Another method is to use Sessions()
you can view information on them here : [php_man]Session[/php_man]
hope that helps.
if you have a variable on a page that you would like to use on another, the best way is to call the include() function.
Example :
you have a php page called bob.php
in it is the following :
Code: Select all
<?php
$this = 'Hello';
?>So, you would do it like so :
Code: Select all
<?php
ob_start();
include "bob.php";
echo ''.$this.' World!';
ob_end_flush();
?>you can view information on them here : [php_man]Session[/php_man]
hope that helps.
I have done it using fsockopen check out this link viewtopic.php?t=7063
BTW the function 'httpParseResponse' in my code is incorrect. It explodes by \r\n\r\n when it should just split the headers from the content at the first occurrance of \r\n\r\n
BTW the function 'httpParseResponse' in my code is incorrect. It explodes by \r\n\r\n when it should just split the headers from the content at the first occurrance of \r\n\r\n
- genetix
- Forum Contributor
- Posts: 115
- Joined: Fri Aug 01, 2003 7:40 pm
- Location: Sask, Regina
- Contact:
Do you kind of mean a link?
I would suggest this. (in steps)
first page: automatically sends a user to next pag with variable:
http://www.yoursite.com/index.php?variable=value
second page: The page you send users to with new info.
I would suggest this. (in steps)
first page: automatically sends a user to next pag with variable:
http://www.yoursite.com/index.php?variable=value
second page: The page you send users to with new info.
well i dont have any yet 
Here's a simple description of the scenario...
I need to send a large amount of text from one script to another, and the limitations of GET will be in the way, so I need to POST it. However, the text being sent will be generated from another source, not by a user. Therefore, what I need is a way for one script to take some text, send it via POST (but transparent to the user) to another script.
Here's a simple description of the scenario...
I need to send a large amount of text from one script to another, and the limitations of GET will be in the way, so I need to POST it. However, the text being sent will be generated from another source, not by a user. Therefore, what I need is a way for one script to take some text, send it via POST (but transparent to the user) to another script.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
- mrvanjohnson
- Forum Contributor
- Posts: 137
- Joined: Wed May 28, 2003 11:38 am
- Location: San Diego, CA