var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: How can I send variables from a PHP script to another URL using POST without.........
Every one How can I send variables from a PHP script to another URL using POST without using forms and hidden variables?
I think you shoud make use of sessions. This can be used for this kind. Make a sessionid and declare some session variables in that then pass the session variables through the url.
This one of he method I would do
you could aways send them in a link possibly. for example:
<a href="/links/mylink.php?passvalue=2&anothervalue=yes"> Link </a>
Then you will have 2 values you can retireve. Kinda a round about way, but not complely sure on your complete objective.
It hink you need the post method b'coz you don't want the users to see the variables and the values on the url.
Then you have only one choise that would be sessions.
To Pass Variables without Hidden Form Fields
You can open an HTTP socket connection and send HTTP POST commands. Here is
an example :
// Generate the request header
"POST $URI HTTP/1.1\n" .
"Host: $Host \n" .
"Content-Type: application/x-www-form-urlencoded\n" .
"Content-Length: $ContentLength \n\n" .
" $ReqBody \n" ;
// Open the connection to the host
$socket = fsockopen ( $Host , 80 , & $errno , & $errstr );
if (! $socket )
$Result [ "errno" ] = $errno ;
$Result [ "errstr" ] = $errstr ;
return $Result ;
$idx = 0 ;
fputs ( $socket , $ReqHeader );
while (! feof ( $socket ))
$Result [ $idx ++] = fgets ( $socket , 128 );
Or you can use the cURL extensions for PHP ( http://curl.haxx.se). Once you build it and compile their support into PHP, it is fairly easy to do posting stuff (even over https):
$URL = "www.mysite.com/test.php" ;
$ch = curl_init ();
curl_setopt ( $ch , CURLOPT_URL , "https:// $URL " );
curl_setopt ( $ch , CURLOPT_POST , 1 );
curl_setopt ( $ch , CURLOPT_POSTFIELDS , "Data1=blah&Data2=blah" ); curl_exec ( $ch );
curl_close ( $ch );
This will have the net effect of posting your data to the $URL site, without any header hacking.
You can also do other nifty things with cURL, like retrieve the HTML into variables and scrape through it for neat functionality.
To use cURL you need to recompile PHP or check with your Host to see if they support it ( http://www.tylmail.com does)
Taken From: http://www.alt-php-faq.org/local/55/#id55
Last edited by Tylmail.com; 10-21-04 at
thank you for reply
thank you for reply